Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/bin
Modified Files:
Makefile.am edje_cc_out.c edje_cc_parse.c edje_decc.c
edje_prefix.c
Log Message:
make edje binaries compile and allow the creation of the edje shared lib on
windows. Remove some trailing spaces
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/Makefile.am,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- Makefile.am 21 Mar 2007 15:36:26 -0000 1.36
+++ Makefile.am 26 Aug 2007 12:54:51 -0000 1.37
@@ -8,7 +8,7 @@
-DPACKAGE_BIN_DIR=\"@[EMAIL PROTECTED]" \
-DPACKAGE_LIB_DIR=\"@[EMAIL PROTECTED]" \
-DPACKAGE_DATA_DIR=\"@[EMAIL PROTECTED]"
-
+
bin_SCRIPTS = \
@EDJE_RECC_PRG@
@@ -16,8 +16,8 @@
EXTRA_SCRIPTS = edje_recc
bin_PROGRAMS = \
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
+edje_cc \
+edje_decc
EXTRA_PROGRAMS = \
edje_cc \
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_cc_out.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- edje_cc_out.c 21 Jul 2007 05:06:39 -0000 1.56
+++ edje_cc_out.c 26 Aug 2007 12:54:51 -0000 1.57
@@ -2,6 +2,11 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
+#ifdef _WIN32
+# include <windows.h>
+#endif /* _WIN32 */
+
+
#include "edje_cc.h"
typedef struct _Part_Lookup Part_Lookup;
@@ -156,14 +161,14 @@
static void
check_program (Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
{
- switch (ep->action)
+ switch (ep->action)
{
case EDJE_ACTION_TYPE_STATE_SET:
case EDJE_ACTION_TYPE_ACTION_STOP:
case EDJE_ACTION_TYPE_DRAG_VAL_SET:
case EDJE_ACTION_TYPE_DRAG_VAL_STEP:
case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
- if (!ep->targets)
+ if (!ep->targets)
{
fprintf(stderr, "%s: Error. collection %i: "
"target missing in program %s\n",
@@ -179,7 +184,7 @@
static void
check_spectrum (Edje_Spectrum_Directory_Entry *se, Eet_File *ef)
{
- if (!se->entry)
+ if (!se->entry)
fprintf(stderr, "%s: Error. Spectrum missing a name.\n", progname);
else if (!se->color_list)
fprintf(stderr, "%s: Error. Spectrum %s is empty. At least one color must
be given.", progname, se->entry);
@@ -204,7 +209,7 @@
int font_num;
int collection_num;
int i;
-
+
bytes = 0;
input_bytes = 0;
total_bytes = 0;
@@ -224,7 +229,7 @@
if (edje_file)
{
- if (edje_file->collection_dir)
+ if (edje_file->collection_dir)
{
/* copy aliases into collection directory */
while (aliases)
@@ -237,7 +242,7 @@
if (bytes <= 0)
{
fprintf(stderr, "%s: Error. unable to write \"edje_file\" entry to
\"%s\" \n",
- progname, file_out);
+ progname, file_out);
ABORT_WRITE(ef, file_out);
}
else
@@ -255,13 +260,13 @@
int fsize = 0;
Evas_List *ll;
FILE *f;
-
+
fn = l->data;
f = fopen(fn->file, "rb");
if (f)
{
long pos;
-
+
fseek(f, 0, SEEK_END);
pos = ftell(f);
rewind(f);
@@ -283,13 +288,13 @@
for (ll = fnt_dirs; ll; ll = ll->next)
{
char buf[4096];
-
+
snprintf(buf, sizeof(buf), "%s/%s", (char *)(ll->data),
fn->file);
f = fopen(buf, "rb");
if (f)
{
long pos;
-
+
fseek(f, 0, SEEK_END);
pos = ftell(f);
rewind(f);
@@ -318,13 +323,13 @@
else
{
char buf[4096];
-
+
snprintf(buf, sizeof(buf), "fonts/%s", fn->name);
bytes = eet_write(ef, buf, fdata, fsize, 1);
if (bytes <= 0)
{
fprintf(stderr, "%s: Error. unable to write font part \"%s\"
as \"%s\" part entry to %s \n",
- progname, fn->file, buf, file_out);
+ progname, fn->file, buf, file_out);
ABORT_WRITE(ef, file_out);
}
else
@@ -348,7 +353,7 @@
{
Ecore_Evas *ee;
Evas *evas;
-
+
ecore_init();
ecore_evas_init();
ee = ecore_evas_buffer_new(1, 1);
@@ -361,8 +366,8 @@
for (l = edje_file->image_dir->entries; l; l = l->next)
{
Edje_Image_Directory_Entry *img;
-
- img = l->data;
+
+ img = l->data;
if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL)
{
}
@@ -370,19 +375,19 @@
{
Evas_Object *im;
Evas_List *ll;
-
+
im = NULL;
for (ll = img_dirs; ll; ll = ll->next)
{
char buf[4096];
-
- snprintf(buf, sizeof(buf), "%s/%s",
+
+ snprintf(buf, sizeof(buf), "%s/%s",
(char *)(ll->data), img->entry);
im = evas_object_image_add(evas);
if (im)
{
evas_object_image_file_set(im, buf, NULL);
- if (evas_object_image_load_error_get(im) ==
+ if (evas_object_image_load_error_get(im) ==
EVAS_LOAD_ERROR_NONE)
{
break;
@@ -397,7 +402,7 @@
if (im)
{
evas_object_image_file_set(im, img->entry, NULL);
- if (evas_object_image_load_error_get(im) !=
+ if (evas_object_image_load_error_get(im) !=
EVAS_LOAD_ERROR_NONE)
{
evas_object_del(im);
@@ -411,14 +416,14 @@
int im_w, im_h;
int im_alpha;
char buf[256];
-
+
evas_object_image_size_get(im, &im_w, &im_h);
im_alpha = evas_object_image_alpha_get(im);
im_data = evas_object_image_data_get(im, 0);
if ((im_data) && (im_w > 0) && (im_h > 0))
{
int mode, qual;
-
+
snprintf(buf, sizeof(buf), "images/%i", img->id);
mode = 2;
qual = 80;
@@ -452,24 +457,24 @@
if (qual > max_quality) qual = max_quality;
}
if (mode == 0)
- bytes = eet_data_image_write(ef, buf,
+ bytes = eet_data_image_write(ef, buf,
im_data, im_w, im_h,
- im_alpha,
+ im_alpha,
0, 0, 0);
else if (mode == 1)
- bytes = eet_data_image_write(ef, buf,
+ bytes = eet_data_image_write(ef, buf,
im_data, im_w, im_h,
- im_alpha,
+ im_alpha,
1, 0, 0);
else if (mode == 2)
- bytes = eet_data_image_write(ef, buf,
+ bytes = eet_data_image_write(ef, buf,
im_data, im_w, im_h,
im_alpha,
0, qual, 1);
if (bytes <= 0)
{
fprintf(stderr, "%s: Error. unable to write
image part \"%s\" as \"%s\" part entry to %s\n",
- progname, img->entry, buf, file_out);
+ progname, img->entry, buf, file_out);
ABORT_WRITE(ef, file_out);
}
else
@@ -481,14 +486,14 @@
else
{
fprintf(stderr, "%s: Error. unable to load image
for image part \"%s\" as \"%s\" part entry to %s\n",
- progname, img->entry, buf, file_out);
+ progname, img->entry, buf, file_out);
ABORT_WRITE(ef, file_out);
}
if (verbose)
{
struct stat st;
const char *file = NULL;
-
+
evas_object_image_file_get(im, &file, NULL);
if ((file) && (stat(file, &st) != 0))
st.st_size = 0;
@@ -505,7 +510,7 @@
else
{
fprintf(stderr, "%s: Error. unable to load image for
image \"%s\" part entry to %s. Missing PNG or JPEG loader modules for Evas or
file does not exist, or is not readable.\n",
- progname, img->entry, file_out);
+ progname, img->entry, file_out);
ABORT_WRITE(ef, file_out);
}
}
@@ -542,7 +547,7 @@
{
Edje_Part_Collection *pc;
Evas_List *ll;
-
+
pc = l->data;
for (ll = pc->parts; ll; ll = ll->next)
check_part (pc, ll->data, ef);
@@ -553,14 +558,14 @@
{
Edje_Part_Collection *pc;
char buf[4096];
-
+
pc = l->data;
snprintf(buf, sizeof(buf), "collections/%i", pc->id);
bytes = eet_data_write(ef, edd_edje_part_collection, buf, pc, 1);
if (bytes <= 0)
{
fprintf(stderr, "%s: Error. unable to write \"%s\" part entry to
%s \n",
- progname, buf, file_out);
+ progname, buf, file_out);
ABORT_WRITE(ef, file_out);
}
else
@@ -578,27 +583,44 @@
{
Code *cd;
int ln = 0;
-
+
cd = l->data;
if ((cd->shared) || (cd->programs))
{
int fd;
+#ifdef _WIN32
+ int ret;
+ char path[4096];
+#endif /* _WIN32 */
char tmpn[4096];
-
+
+#ifdef _WIN32
+ ret = GetTempPath(_MAX_PATH, path);
+ if ((ret > _MAX_PATH) || (ret == 0))
+ fd = -1;
+ else
+ {
+ if (!GetTempFileName(path, "edj", 0, tmpn))
+ fd = -1;
+ else
+ fd = open(tmpn, _O_RDWR | _O_BINARY | _O_CREAT, 0444);
+ }
+#else
strcpy(tmpn, "/tmp/edje_cc.sma-tmp-XXXXXX");
fd = mkstemp(tmpn);
+#endif /* _WIN32 */
if (fd >= 0)
{
FILE *f;
char buf[4096];
char tmpo[4096];
int ret;
-
+
f = fopen(tmpn, "w");
if (f)
{
Evas_List *ll;
-
+
fprintf(f, "#include <edje>\n");
ln = 2;
if (cd->shared)
@@ -612,7 +634,7 @@
char *sp;
int hash = 0;
int newlined = 0;
-
+
for (sp = cd->shared; *sp; sp++)
{
if ((sp[0] == '#') && (newlined))
@@ -631,7 +653,7 @@
for (ll = cd->programs; ll; ll = ll->next)
{
Code_Program *cp;
-
+
cp = ll->data;
if (cp->script)
{
@@ -647,7 +669,7 @@
char *sp;
int hash = 0;
int newlined = 0;
-
+
for (sp = cp->script; *sp; sp++)
{
if ((sp[0] == '#') && (newlined))
@@ -667,8 +689,21 @@
fclose(f);
}
close(fd);
+#ifdef _WIN32
+ ret = GetTempPath(_MAX_PATH, path);
+ if ((ret > _MAX_PATH) || (ret == 0))
+ fd = -1;
+ else
+ {
+ if (!GetTempFileName(path, "edj", 0, tmpo))
+ fd = -1;
+ else
+ fd = open(tmpo, _O_RDWR | _O_BINARY | _O_CREAT, 0444);
+ }
+#else
strcpy(tmpo, "/tmp/edje_cc.amx-tmp-XXXXXX");
fd = mkstemp(tmpo);
+#endif /* _WIN32 */
if (fd >= 0)
{
snprintf(buf, sizeof(buf),
@@ -679,7 +714,7 @@
if (ret < 0 || ret > 1)
{
fprintf(stderr, "%s: Warning. Compiling script code
not clean.\n",
- progname);
+ progname);
ABORT_WRITE(ef, file_out);
}
close(fd);
@@ -689,14 +724,14 @@
{
int size;
void *data;
-
+
fseek(f, 0, SEEK_END);
size = ftell(f);
rewind(f);
if (size > 0)
{
int bt;
-
+
data = malloc(size);
if (data)
{
@@ -726,7 +761,7 @@
if (verbose)
{
struct stat st;
-
+
if (stat(file_in, &st) != 0)
st.st_size = 0;
input_bytes += st.st_size;
@@ -768,7 +803,7 @@
data_queue_part_lookup(Edje_Part_Collection *pc, char *name, int *dest)
{
Part_Lookup *pl;
-
+
pl = mem_alloc(SZ(Part_Lookup));
part_lookups = evas_list_append(part_lookups, pl);
pl->pc = pc;
@@ -780,7 +815,7 @@
data_queue_program_lookup(Edje_Part_Collection *pc, char *name, int *dest)
{
Program_Lookup *pl;
-
+
pl = mem_alloc(SZ(Program_Lookup));
program_lookups = evas_list_append(program_lookups, pl);
pl->pc = pc;
@@ -792,7 +827,7 @@
data_queue_image_lookup(char *name, int *dest)
{
Image_Lookup *il;
-
+
il = mem_alloc(SZ(Image_Lookup));
image_lookups = evas_list_append(image_lookups, il);
il->name = mem_strdup(name);
@@ -803,7 +838,7 @@
data_queue_spectrum_lookup(char *name, int *dest)
{
Spectrum_Lookup *sl;
-
+
sl = mem_alloc(SZ(Spectrum_Lookup));
spectrum_lookups = evas_list_append(spectrum_lookups, sl);
sl->name = mem_strdup(name);
@@ -861,17 +896,17 @@
data_process_lookups(void)
{
Evas_List *l;
-
+
while (part_lookups)
{
Part_Lookup *pl;
-
+
pl = part_lookups->data;
-
+
for (l = pl->pc->parts; l; l = l->next)
{
Edje_Part *ep;
-
+
ep = l->data;
if ((ep->name) && (!strcmp(ep->name, pl->name)))
{
@@ -894,13 +929,13 @@
while (program_lookups)
{
Program_Lookup *pl;
-
+
pl = program_lookups->data;
-
+
for (l = pl->pc->programs; l; l = l->next)
{
Edje_Program *ep;
-
+
ep = l->data;
if ((ep->name) && (!strcmp(ep->name, pl->name)))
{
@@ -918,13 +953,13 @@
free(pl->name);
free(pl);
}
-
+
while (image_lookups)
{
Image_Lookup *il;
-
+
il = image_lookups->data;
-
+
if (!edje_file->image_dir)
l = NULL;
else
@@ -932,7 +967,7 @@
for (l = edje_file->image_dir->entries; l; l = l->next)
{
Edje_Image_Directory_Entry *de;
-
+
de = l->data;
if ((de->entry) && (!strcmp(de->entry, il->name)))
{
@@ -945,7 +980,7 @@
}
}
}
-
+
if (!l)
{
fprintf(stderr, "%s: Error. unable to find image name %s\n",
@@ -960,7 +995,7 @@
while (spectrum_lookups)
{
Spectrum_Lookup *il;
-
+
il = spectrum_lookups->data;
if (!edje_file->spectrum_dir)
@@ -970,7 +1005,7 @@
for (l = edje_file->spectrum_dir->entries; l; l = l->next)
{
Edje_Spectrum_Directory_Entry *de;
-
+
de = l->data;
*(il->dest) = 1;
if ((de->entry) && (!strcmp(de->entry, il->name)))
@@ -981,7 +1016,7 @@
}
}
}
-
+
if (!l)
{
fprintf(stderr, "%s: Error. unable to find spectrum name %s\n",
@@ -1019,7 +1054,7 @@
char *key;
int keyl;
int quote, escape;
-
+
key = alloca(strlen(prefix) + 2 + 1);
if (!key) return;
strcpy(key, prefix);
@@ -1042,13 +1077,13 @@
if (!strncmp(p, key, keyl))
{
Code_Lookup *cl;
-
+
cl = mem_alloc(SZ(Code_Lookup));
if (cl)
{
int inesc = 0;
char *name;
-
+
cl->ptr = p;
p += keyl;
while ((*p))
@@ -1075,7 +1110,7 @@
{
char *pp;
int i;
-
+
name[0] = 0;
pp = cl->ptr + keyl;
inesc = 0;
@@ -1145,18 +1180,18 @@
data_process_scripts(void)
{
Evas_List *l, *l2;
-
+
for (l = codes, l2 = edje_collections; (l) && (l2); l = l->next, l2 =
l2->next)
{
Code *cd;
Edje_Part_Collection *pc;
-
+
cd = l->data;
pc = l2->data;
if ((cd->shared) || (cd->programs))
{
Evas_List *ll;
-
+
if (cd->shared)
{
data_process_string(pc, "PART", cd->shared,
data_queue_part_lookup);
@@ -1166,7 +1201,7 @@
for (ll = cd->programs; ll; ll = ll->next)
{
Code_Program *cp;
-
+
cp = ll->data;
if (cp->script)
{
@@ -1183,7 +1218,7 @@
data_process_script_lookups(void)
{
Evas_List *l;
-
+
for (l = code_lookups; l; l = l->next)
{
Code_Lookup *cl;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_cc_parse.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- edje_cc_parse.c 21 Jul 2007 05:06:39 -0000 1.45
+++ edje_cc_parse.c 26 Aug 2007 12:54:51 -0000 1.46
@@ -2,6 +2,10 @@
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
+#ifdef _WIN32
+# include <windows.h>
+#endif /* _WIN32 */
+
#include "edje_cc.h"
static void new_object(void);
@@ -54,7 +58,7 @@
char *id;
int i;
int handled = 0;
-
+
id = stack_id();
for (i = 0; i < object_handler_num(); i++)
{
@@ -95,7 +99,7 @@
char *id;
int i;
int handled = 0;
-
+
id = stack_id();
for (i = 0; i < statement_handler_num(); i++)
{
@@ -144,7 +148,7 @@
{
const char *delims = "{},;:";
char *d;
-
+
d = (char *)delims;
while (*d)
{
@@ -198,14 +202,14 @@
char *pp, fl[4096];
char *tmpstr = NULL;
int l, nm;
-
+
/* handle cpp comments */
/* their line format is
* # <line no. of next line> <filename from next line on> [??]
*/
cpp_token_line = NULL;
cpp_token_file = NULL;
-
+
pp = p;
while ((pp < end) && (*pp != '\n'))
{
@@ -304,10 +308,10 @@
}
if (!in_tok) return NULL;
tok_end = p - 1;
-
+
done:
*new_p = p;
-
+
tok = mem_alloc(tok_end - tok_start + 2);
strncpy(tok, tok_start, tok_end - tok_start + 1);
tok[tok_end - tok_start + 1] = 0;
@@ -381,7 +385,7 @@
stack_chop_top(void)
{
char *top;
-
+
/* remove top from stack */
top = evas_list_data(evas_list_last(stack));
if (top)
@@ -459,7 +463,7 @@
{
fprintf(stderr, "%s: Error. parse error %s:%i. { marker
before ; marker\n",
progname, file_in, line - 1);
- exit(-1);
+ exit(-1);
}
}
free(token);
@@ -481,7 +485,7 @@
int l1 = 0, l2 = 0;
char *verbatim_1;
char *verbatim_2;
-
+
l1 = line;
while ((p[0] != '{') && (p < end))
{
@@ -531,7 +535,7 @@
{
int l;
char *v;
-
+
l = verbatim_2 - verbatim_1 + 1;
v = malloc(l + 1);
strncpy(v, verbatim_1, l);
@@ -608,22 +612,38 @@
int fd;
off_t size;
char *data, *p;
+#ifdef _WIN32
+ int ret;
+#endif /* _WIN32 */
char buf[4096];
char inc[4096];
static char tmpn[4096];
- strcpy(tmpn, "/tmp/edje_cc.edc-tmp-XXXXXX");
strncpy(inc, file_in, 4000);
inc[4001] = 0;
p = strrchr(inc, '/');
if (!p) strcpy(inc, "./");
else *p = 0;
+#ifdef _WIN32
+ ret = GetTempPath(4096, buf);
+ if ((ret > 4096) || (ret == 0))
+ fd = -1;
+ else
+ {
+ if (!GetTempFileName(buf, "edj", 0, tmpn))
+ fd = -1;
+ else
+ fd = open(tmpn, _O_RDWR | _O_BINARY | _O_CREAT, 0444);
+ }
+#else
+ strcpy(tmpn, "/tmp/edje_cc.edc-tmp-XXXXXX");
fd = mkstemp(tmpn);
+#endif /* _WIN32 */
if (fd >= 0)
{
int ret;
char *def;
-
+
clean_file = tmpn;
close(fd);
atexit(clean_tmp_file);
@@ -633,7 +653,7 @@
{
Evas_List *l;
int len;
-
+
len = 0;
for (l = defines; l; l = l->next)
{
@@ -656,7 +676,7 @@
* If the preprocessor is invoked via gcc -E, it will treat
* file_in as a linker file. The safest route seems to be to
* run cpp with the output as the second non-option argument.
- *
+ *
* Redirecting the output is required for MacOS 10.3, and works fine
* on other systems.
*/
@@ -673,7 +693,7 @@
file_in = tmpn;
free(def);
/* OLD CODE
- snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s -E -o %s",
+ snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s -E -o %s",
file_in, inc, def, tmpn);
ret = system(buf);
if (ret < 0)
@@ -698,7 +718,7 @@
printf("%s: Opening \"%s\" for input\n",
progname, file_in);
}
-
+
size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
data = malloc(size);
@@ -718,7 +738,7 @@
is_param(int n)
{
char *str;
-
+
str = evas_list_nth(params, n);
if (str) return 1;
return 0;
@@ -730,13 +750,13 @@
char *str;
long int ret;
char *end;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
if (str[0] == 0) return 0;
end = str;
@@ -750,13 +770,13 @@
{
char *str;
char *s;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
s = mem_strdup(str);
return s;
@@ -767,20 +787,20 @@
{
char *str;
va_list va;
-
- str = evas_list_nth(params, n);
+
+ str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
va_start(va, n);
for (;;)
{
char *s;
int v;
-
+
s = va_arg(va, char *);
if (!s)
{
@@ -797,7 +817,7 @@
}
fprintf(stderr, "\n");
va_end(va);
- exit(-1);
+ exit(-1);
}
v = va_arg(va, int);
if (!strcmp(s, str))
@@ -815,13 +835,13 @@
{
char *str;
int i;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
i = my_atoi(str);
return i;
@@ -832,13 +852,13 @@
{
char *str;
int i;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
i = my_atoi(str);
if ((i < f) || (i > t))
@@ -891,13 +911,13 @@
{
char *str;
double i;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
i = my_atof(str);
return i;
@@ -908,13 +928,13 @@
{
char *str;
double i;
-
+
str = evas_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument
%i\n",
progname, file_in, line - 1, n + 1);
- exit(-1);
+ exit(-1);
}
i = my_atof(str);
if ((i < f) || (i > t))
@@ -946,7 +966,7 @@
* beta ::= gamma + gamma || gamma
* gamma ::= num || delta
* delta ::= '(' alpha ')'
- *
+ *
*/
/* int set of function */
@@ -956,17 +976,17 @@
{
int res = 0;
char buf[4096];
-
+
if (!s)
return 0;
-
+
if (!strstrip(s, buf, sizeof (buf)))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
progname, file_in, line - 1);
return 0;
}
-
+
_alphai(buf, &res);
return res;
}
@@ -975,9 +995,9 @@
_deltai(char *s, int * val)
{
if (!val) return NULL;
-
+
if ('(' != s[0])
- {
+ {
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
progname, file_in, line - 1, s);
return s;
@@ -989,7 +1009,7 @@
s++;
return s;
}
-
+
return s;
}
@@ -997,7 +1017,7 @@
_gammai(char *s, int * val)
{
if (!val) return NULL;
-
+
if (_is_numi(s[0]))
{
s = _get_numi(s, val);
@@ -1019,12 +1039,12 @@
{
int a1, a2;
char op;
-
+
if (!val)
return NULL;
-
+
s = _gammai(s, &a1);
-
+
while (_is_op1i(s[0]))
{
op = s[0];
@@ -1032,9 +1052,9 @@
s = _gammai(s, &a2);
a1 = _calci(op, a1, a2);
}
-
+
(*val) = a1;
-
+
return s;
}
@@ -1043,12 +1063,12 @@
{
int a1, a2;
char op;
-
+
if (!val)
return NULL;
-
+
s = _betai(s, &a1);
-
+
while (_is_op2i(s[0]))
{
op = s[0];
@@ -1056,7 +1076,7 @@
s = _betai(s, &a2);
a1 = _calci(op, a1, a2);
}
-
+
(*val) = a1;
return s;
}
@@ -1066,10 +1086,10 @@
{
char buf[4096];
int pos = 0;
-
+
if (!val)
- return s;
-
+ return s;
+
while (
(('0' <= s[pos]) && ('9' >= s[pos])) ||
((0 == pos) && ('-' == s[pos]))
@@ -1078,7 +1098,7 @@
buf[pos] = s[pos];
pos++;
}
-
+
buf[pos] = '\0';
(*val) = atoi(buf);
return (s+pos);
@@ -1125,7 +1145,7 @@
case '+':
a += b;
return a;
- case '-':
+ case '-':
a -= b;
return a;
case '/':
@@ -1152,17 +1172,17 @@
{
double res = 0;
char buf[4096];
-
+
if (!s)
return 0;
-
+
if (!strstrip(s, buf, sizeof (buf)))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
progname, file_in, line - 1);
return 0;
}
-
+
_alphaf(buf, &res);
return res;
}
@@ -1171,7 +1191,7 @@
_deltaf(char *s, double * val)
{
if (!val) return NULL;
-
+
if ('(' != s[0])
{
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
@@ -1185,7 +1205,7 @@
s++;
return s;
}
-
+
return s;
}
@@ -1193,7 +1213,7 @@
_gammaf(char *s, double * val)
{
if (!val) return NULL;
-
+
if (_is_numf(s[0]))
{
s = _get_numf(s, val);
@@ -1215,12 +1235,12 @@
{
double a1=0, a2=0;
char op;
-
+
if (!val)
return NULL;
-
+
s = _gammaf(s, &a1);
-
+
while (_is_op1f(s[0]))
{
op = s[0];
@@ -1228,9 +1248,9 @@
s = _gammaf(s, &a2);
a1 = _calcf(op, a1, a2);
}
-
+
(*val) = a1;
-
+
return s;
}
@@ -1239,12 +1259,12 @@
{
double a1=0, a2=0;
char op;
-
+
if (!val)
return NULL;
-
+
s = _betaf(s, &a1);
-
+
while (_is_op2f(s[0]))
{
op = s[0];
@@ -1252,9 +1272,9 @@
s = _betaf(s, &a2);
a1 = _calcf(op, a1, a2);
}
-
+
(*val) = a1;
-
+
return s;
}
@@ -1263,10 +1283,10 @@
{
char buf[4096];
int pos = 0;
-
+
if (!val)
- return s;
-
+ return s;
+
while (
(('0' <= s[pos]) && ('9' >= s[pos])) ||
('.' == s[pos]) ||
@@ -1276,7 +1296,7 @@
buf[pos] = s[pos];
pos++;
}
-
+
buf[pos] = '\0';
(*val) = atof(buf);
return (s+pos);
@@ -1285,8 +1305,8 @@
static int
_is_numf(char c)
{
- if (((c >= '0') && (c <= '9'))
- || ('-' == c)
+ if (((c >= '0') && (c <= '9'))
+ || ('-' == c)
|| ('.' == c)
|| ('+' == c))
return 1;
@@ -1326,7 +1346,7 @@
case '+':
a += b;
return a;
- case '-':
+ case '-':
a -= b;
return a;
case '/':
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_decc.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- edje_decc.c 12 Aug 2007 02:48:13 -0000 1.20
+++ edje_decc.c 26 Aug 2007 12:54:51 -0000 1.21
@@ -8,6 +8,9 @@
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef _WIN32
+# include <windows.h>
+#endif /* _WIN32 */
char *progname = NULL;
char *file_in = NULL;
@@ -43,7 +46,7 @@
int i;
setlocale(LC_NUMERIC, "C");
-
+
progname = argv[0];
for (i = 1; i < argc; i++)
{
@@ -65,7 +68,7 @@
edje_init();
eet_init();
source_edd();
-
+
if (!decomp()) return -1;
output();
@@ -83,7 +86,7 @@
printf("ERROR: cannot open %s\n", file_in);
return 0;
}
-
+
srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list)
{
@@ -125,7 +128,7 @@
Evas_List *l;
Eet_File *ef;
char *outdir, *p;
-
+
p = strrchr(file_in, '/');
if (p)
outdir = strdup(p + 1);
@@ -133,9 +136,9 @@
outdir = strdup(file_in);
p = strrchr(outdir, '.');
if (p) *p = 0;
-
+
e_file_mkpath(outdir);
-
+
ef = eet_open(file_in, EET_FILE_MODE_READ);
if (edje_file->image_dir)
@@ -143,9 +146,9 @@
for (l = edje_file->image_dir->entries; l; l = l->next)
{
Edje_Image_Directory_Entry *ei;
-
+
ei = l->data;
- if ((ei->source_type > EDJE_IMAGE_SOURCE_TYPE_NONE) &&
+ if ((ei->source_type > EDJE_IMAGE_SOURCE_TYPE_NONE) &&
(ei->source_type < EDJE_IMAGE_SOURCE_TYPE_LAST) &&
(ei->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
(ei->entry))
@@ -156,7 +159,7 @@
char buf[4096];
char out[4096];
char *pp;
-
+
ecore_init();
ecore_evas_init();
ee = ecore_evas_buffer_new(1, 1);
@@ -205,7 +208,7 @@
char out[4096];
FILE *f;
char *pp;
-
+
sf = l->data;
snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
printf("Output Source File: %s\n", out);
@@ -225,7 +228,7 @@
exit (-1);
}
f = fopen(out, "w");
- if (!f)
+ if (!f)
{
printf("ERROR: unable to write file (%s).\n", out);
exit (-1);
@@ -245,7 +248,7 @@
void *font;
int fontsize;
char out[4096];
-
+
fn = l->data;
snprintf(out, sizeof(out), "fonts/%s", fn->name);
font = eet_read(ef, out, &fontsize);
@@ -253,7 +256,7 @@
{
FILE *f;
char *pp;
-
+
snprintf(out, sizeof(out), "%s/%s", outdir, fn->file);
printf("Output Font: %s\n", out);
pp = strdup(out);
@@ -282,7 +285,7 @@
char out[4096];
FILE *f;
SrcFile *sf = srcfiles->list->data;
-
+
snprintf(out, sizeof(out), "%s/build.sh", outdir);
printf("Output Build Script: %s\n", out);
if (strstr(out, "../"))
@@ -294,16 +297,20 @@
fprintf(f, "#!/bin/sh\n");
fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler,
sf->name, outdir);
fclose(f);
-
+
if (file_out)
{
snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
+#ifdef _WIN32
+ CopyFile(sf->name, out, TRUE);
+#else
symlink(sf->name, out);
+#endif /* _WIN32 */
}
-#ifndef WIN32
+#ifndef _WIN32
chmod(out, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP);
-#endif
+#endif /* _WIN32 */
printf("\n*** CAUTION ***\n"
"Please check the build script for anything malicious "
@@ -316,7 +323,7 @@
e_file_is_dir(char *file)
{
struct stat st;
-
+
if (stat(file, &st) < 0) return 0;
if (S_ISDIR(st.st_mode)) return 1;
return 0;
@@ -325,13 +332,13 @@
int
e_file_mkdir(char *dir)
{
-#ifndef WIN32
+#ifndef _WIN32
static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP |
S_IXGRP | S_IROTH | S_IXOTH;
if (mkdir(dir, default_mode) < 0) return 0;
#else
if (mkdir(dir) < 0) return 0;
-#endif
+#endif /* _WIN32 */
return 1;
}
@@ -340,7 +347,7 @@
{
char ss[PATH_MAX];
int i, ii;
-
+
ss[0] = 0;
i = 0;
ii = 0;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_prefix.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- edje_prefix.c 12 Aug 2006 14:40:59 -0000 1.4
+++ edje_prefix.c 26 Aug 2007 12:54:51 -0000 1.5
@@ -11,16 +11,13 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/param.h>
-#include <dlfcn.h>
#include <math.h>
#include <fnmatch.h>
#include <limits.h>
#include <ctype.h>
#include <time.h>
#include <dirent.h>
-#include <pwd.h>
-#include <grp.h>
-#include <glob.h>
+
#include "edje_prefix.h"
/* local subsystem functions */
@@ -377,7 +374,11 @@
if (getcwd(buf3, sizeof(buf3)))
{
snprintf(buf2, sizeof(buf2), "%s/%s", buf3, argv0);
+#ifdef _WIN32
+ if (_fullpath(buf2, buf, _MAX_PATH))
+#else
if (realpath(buf2, buf))
+#endif /* _WIN32 */
{
_exe_path = strdup(buf);
if (access(_exe_path, X_OK) == 0) return 1;
@@ -401,7 +402,11 @@
strncpy(s, cp, len);
s[len] = '/';
strcpy(s + len + 1, argv0);
+#ifdef _WIN32
+ if (_fullpath(s, buf, _MAX_PATH))
+#else
if (realpath(s, buf))
+#endif /* _WIN32 */
{
if (access(buf, X_OK) == 0)
{
@@ -421,7 +426,11 @@
strncpy(s, cp, len);
s[len] = '/';
strcpy(s + len + 1, argv0);
+#ifdef _WIN32
+ if (_fullpath(s, buf, _MAX_PATH))
+#else
if (realpath(s, buf))
+#endif /* _WIN32 */
{
if (access(buf, X_OK) == 0)
{
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs