fix edje error reporting for once and for all.

edje error was a mess. First someone (maybe myself) added eina log,
then people changed it to be a mix with printf()... then they replaced
eina_log with printf() + colors so it would be less verbose.

It's fixed now! Using eina log infrastructure.

If all that is wanted is specific messages for edje_cc domain, do it
with a specific log print function (eina_log_print_cb_set()). I made
it produce messages in the format:

    <levelcolor><progname>: <levelprefix><message>

Where:
 - levelcolor is defined by eina_log (I hacked the win32 version,
   since no public api to resolve level to color).
 - levelprefix is "Error. " or "Warning. " to cope with traditional
   output.

If it does not look as you wanted, let me know before stuffing some
printf() again.

Bonus point: reduced 2 global variables (progname and verbose),
removed lots of code.



SVN revision: 74701
This commit is contained in:
Gustavo Sverzut Barbieri 2012-07-31 22:42:03 +00:00
parent bb43446421
commit f1e077844e
12 changed files with 572 additions and 536 deletions

View File

@ -19,9 +19,9 @@ Eina_List *defines = NULL;
char *file_in = NULL; char *file_in = NULL;
char *tmp_dir = NULL; char *tmp_dir = NULL;
char *file_out = NULL; char *file_out = NULL;
char *progname = NULL;
char *watchfile = NULL; char *watchfile = NULL;
int verbose = 0;
static char *progname = NULL;
int no_lossy = 0; int no_lossy = 0;
int no_comp = 0; int no_comp = 0;
@ -32,6 +32,86 @@ int max_quality = 100;
int compress_mode = EET_COMPRESSION_DEFAULT; int compress_mode = EET_COMPRESSION_DEFAULT;
int threads = 0; int threads = 0;
static void
_edje_cc_log_cb(const Eina_Log_Domain *d,
Eina_Log_Level level,
const char *file,
const char *fnc,
int line,
const char *fmt,
__UNUSED__ void *data,
va_list args)
{
if ((d->name) && (d->namelen == sizeof("edje_cc") - 1) &&
(memcmp(d->name, "edje_cc", sizeof("edje_cc") - 1) == 0))
{
const char *prefix;
Eina_Bool use_color = !eina_log_color_disable_get();
if (use_color)
{
#ifndef _WIN32
fputs(eina_log_level_color_get(level), stderr);
#else
int color;
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_ERR:
color = FOREGROUND_RED;
break;
case EINA_LOG_LEVEL_WARN:
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_INFO:
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_DBG:
color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
default:
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
#endif
}
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
prefix = "Critical. ";
break;
case EINA_LOG_LEVEL_ERR:
prefix = "Error. ";
break;
case EINA_LOG_LEVEL_WARN:
prefix = "Warning. ";
break;
default:
prefix = "";
}
fprintf(stderr, "%s: %s", progname, prefix);
if (use_color)
{
#ifndef _WIN32
fputs(EINA_COLOR_RESET, stderr);
#else
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
#endif
}
vfprintf(stderr, fmt, args);
putc('\n', stderr);
}
else
eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
}
static void static void
main_help(void) main_help(void)
{ {
@ -80,6 +160,9 @@ main(int argc, char **argv)
EINA_LOG_ERR("Enable to create a log domain."); EINA_LOG_ERR("Enable to create a log domain.");
exit(-1); exit(-1);
} }
progname = (char *)ecore_file_file_get(argv[0]);
eina_log_print_cb_set(_edje_cc_log_cb, NULL);
tmp_dir = getenv("TMPDIR"); tmp_dir = getenv("TMPDIR");
img_dirs = eina_list_append(img_dirs, "."); img_dirs = eina_list_append(img_dirs, ".");
@ -87,7 +170,6 @@ main(int argc, char **argv)
/* add defines to epp so edc files can detect edje_cc version */ /* add defines to epp so edc files can detect edje_cc version */
defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12")); defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
progname = (char *)ecore_file_file_get(argv[0]);
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
if (!strcmp(argv[i], "-h")) if (!strcmp(argv[i], "-h"))
@ -97,7 +179,7 @@ main(int argc, char **argv)
} }
else if (!strcmp(argv[i], "-v")) else if (!strcmp(argv[i], "-v"))
{ {
verbose = 1; eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
} }
else if (!strcmp(argv[i], "-no-lossy")) else if (!strcmp(argv[i], "-no-lossy"))
{ {
@ -186,6 +268,7 @@ main(int argc, char **argv)
else if (!file_out) else if (!file_out)
file_out = argv[i]; file_out = argv[i];
} }
if (!file_in) if (!file_in)
{ {
fprintf(stderr, "%s: Error: no input file specified.\n", progname); fprintf(stderr, "%s: Error: no input file specified.\n", progname);
@ -193,6 +276,8 @@ main(int argc, char **argv)
exit(-1); exit(-1);
} }
pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */ pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
main, /* an optional symbol to check path of */ main, /* an optional symbol to check path of */
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */ "EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */

View File

@ -18,43 +18,26 @@ extern Eina_Prefix *pfx;
extern int _edje_cc_log_dom ; extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN #define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef _WIN32
# define EDJE_ERR_COLOR FOREGROUND_RED | FOREGROUND_INTENSITY
# define EDJE_INF_COLOR FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY
# define EDJE_WRN_COLOR FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY
# define EDJE_LOG(str, color, ...) do { \
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), \
color); \
printf(str); \
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), \
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); \
printf(": "); \
printf(__VA_ARGS__); \
printf("\n"); \
} while (0)
#else
# define EDJE_ERR_COLOR "\033[31m"
# define EDJE_INF_COLOR "\033[35m"
# define EDJE_WRN_COLOR "\033[33m"
# define EDJE_LOG(str, color, ...) do { \
printf("\033[31m"); \
printf(__VA_ARGS__); \
printf("\033[0m\n"); } \
while (0)
#endif
#ifdef ERR #ifdef ERR
# undef ERR # undef ERR
#endif #endif
#define ERR(...) EDJE_LOG("ERR", EDJE_ERR_COLOR, __VA_ARGS__) #define ERR(...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
#ifdef INF #ifdef INF
# undef INF # undef INF
#endif #endif
#define INF(...) EDJE_LOG("INF", EDJE_INF_COLOR, __VA_ARGS__) #define INF(...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
#ifdef WRN #ifdef WRN
# undef WRN # undef WRN
#endif #endif
#define WRN(...) EDJE_LOG("WRN", EDJE_WRN_COLOR, __VA_ARGS__) #define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_cc_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_edje_cc_log_dom, __VA_ARGS__)
/* types */ /* types */
typedef struct _New_Object_Handler New_Object_Handler; typedef struct _New_Object_Handler New_Object_Handler;
@ -231,9 +214,7 @@ extern Eina_List *snd_dirs;
extern char *file_in; extern char *file_in;
extern char *tmp_dir; extern char *tmp_dir;
extern char *file_out; extern char *file_out;
extern char *progname;
extern char *watchfile; extern char *watchfile;
extern int verbose;
extern int no_lossy; extern int no_lossy;
extern int no_comp; extern int no_comp;
extern int no_raw; extern int no_raw;

View File

@ -976,7 +976,8 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
if (!result) if (!result)
{ {
ERR("%s: Error. Unknown type %i of part %s in collection %s.", progname, type, part, collection); ERR("Unknown type %i of part %s in collection %s.",
type, part, collection);
exit(-1); exit(-1);
} }
@ -999,8 +1000,8 @@ _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, un
epp = (Edje_Program_Parser *)pgrms[i]; epp = (Edje_Program_Parser *)pgrms[i];
if (!epp->can_override) if (!epp->can_override)
{ {
ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n", ERR("parse error %s:%i. There is already a program of the name %s",
progname, file_in, line - 1, name); file_in, line - 1, name);
exit(-1); exit(-1);
} }
else else
@ -1078,9 +1079,8 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id)); data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else else
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. target may only be used after action",
"target may only be used after action", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -1169,7 +1169,7 @@ st_externals_external(void)
0, sizeof (Edje_External_Directory)); 0, sizeof (Edje_External_Directory));
if (!edje_file->external_dir->entries) if (!edje_file->external_dir->entries)
{ {
ERR("%s: Error. not enough memory", progname); ERR("not enough memory");
exit(-1); exit(-1);
} }
@ -1257,7 +1257,7 @@ st_images_image(void)
0, sizeof (Edje_Image_Directory_Entry)); 0, sizeof (Edje_Image_Directory_Entry));
if (!edje_file->image_dir->entries) if (!edje_file->image_dir->entries)
{ {
ERR("%s: Error. No enough memory.", progname); ERR("No enough memory.");
exit(-1); exit(-1);
} }
@ -1346,7 +1346,7 @@ ob_images_set(void)
0, sizeof (Edje_Image_Directory_Set)); 0, sizeof (Edje_Image_Directory_Set));
if (!edje_file->image_dir->sets) if (!edje_file->image_dir->sets)
{ {
ERR("%s: Error. Not enough memory.", progname); ERR("Not enough memory.");
exit(-1); exit(-1);
} }
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1; edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
@ -1462,8 +1462,8 @@ st_images_set_image_size(void)
if (entry->size.min.w > entry->size.max.w if (entry->size.min.w > entry->size.max.w
|| entry->size.min.h > entry->size.max.h) || entry->size.min.h > entry->size.max.h)
{ {
ERR("%s: Error. parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])", ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
progname, file_in, line - 1, file_in, line - 1,
entry->size.min.w, entry->size.min.h, entry->size.min.w, entry->size.min.h,
entry->size.max.w, entry->size.max.h); entry->size.max.w, entry->size.max.h);
exit(-1); exit(-1);
@ -1601,23 +1601,23 @@ st_data_file(void)
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR); fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0) if (fd < 0)
{ {
ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"", ERR("%s:%i when opening file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno)); file_in, line, filename, strerror(errno));
exit(-1); exit(-1);
} }
if (fstat(fd, &buf)) if (fstat(fd, &buf))
{ {
ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"", ERR("%s:%i when stating file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno)); file_in, line, filename, strerror(errno));
exit(-1); exit(-1);
} }
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0); data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED) if (data == MAP_FAILED)
{ {
ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"", ERR("%s:%i when mapping file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno)); file_in, line, filename, strerror(errno));
exit(-1); exit(-1);
} }
@ -1625,8 +1625,7 @@ st_data_file(void)
for (i = 0; i < buf.st_size; ++i, ++over) for (i = 0; i < buf.st_size; ++i, ++over)
if (*over == '\0') if (*over == '\0')
{ {
ERR("%s: Error. %s:%i file \"%s\" is a binary file.", ERR("%s:%i file \"%s\" is a binary file.", file_in, line, filename);
progname, file_in, line, filename);
exit(-1); exit(-1);
} }
@ -1710,8 +1709,8 @@ st_color_class_name(void)
{ {
if ((cc != tcc) && (!strcmp(cc->name, tcc->name))) if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
{ {
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a color class named \"%s\"\n", ERR("parse error %s:%i. There is already a color class named \"%s\"",
progname, file_in, line - 1, cc->name); file_in, line - 1, cc->name);
exit(-1); exit(-1);
} }
} }
@ -1841,8 +1840,8 @@ st_styles_style_name(void)
{ {
if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name))) if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name)))
{ {
ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"", ERR("parse error %s:%i. There is already a style named \"%s\"",
progname, file_in, line - 1, stl->name); file_in, line - 1, stl->name);
exit(-1); exit(-1);
} }
} }
@ -1868,8 +1867,8 @@ st_styles_style_base(void)
stl = eina_list_data_get(eina_list_last(edje_file->styles)); stl = eina_list_data_get(eina_list_last(edje_file->styles));
if (stl->tags) if (stl->tags)
{ {
ERR("%s: Error. parse error %s:%i. There is already a basic format for the style", ERR("parse error %s:%i. There is already a basic format for the style",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
tag = mem_alloc(SZ(Edje_Style_Tag)); tag = mem_alloc(SZ(Edje_Style_Tag));
@ -2014,7 +2013,7 @@ st_collections_group_sound_sample_name(void)
if (!edje_file->sound_dir->samples) if (!edje_file->sound_dir->samples)
{ {
ERR("%s: Error. No enough memory.", progname); ERR("No enough memory.");
exit(-1); exit(-1);
} }
@ -2061,7 +2060,7 @@ st_collections_group_sound_sample_source(void)
if (!edje_file->sound_dir->samples) if (!edje_file->sound_dir->samples)
{ {
ERR("%s: Error. Invalid sound sample source definition.", progname); ERR("Invalid sound sample source definition.");
exit(-1); exit(-1);
} }
@ -2071,7 +2070,7 @@ st_collections_group_sound_sample_source(void)
if (!sample) if (!sample)
{ {
ERR("%s: Error. Invalid sound sample source definition.", progname); ERR("Invalid sound sample source definition.");
exit(-1); exit(-1);
} }
sample->snd_src = parse_str(0); sample->snd_src = parse_str(0);
@ -2111,14 +2110,14 @@ st_collections_group_sound_tone(void)
{ {
if (!strcmp(edje_file->sound_dir->tones[i].name, tmp)) if (!strcmp(edje_file->sound_dir->tones[i].name, tmp))
{ {
ERR("%s: Error. Tone name: %s already exist.", progname, tmp); ERR("Tone name: %s already exist.", tmp);
free((char *)tmp); free((char *)tmp);
exit(-1); exit(-1);
} }
if (edje_file->sound_dir->tones[i].value == value) if (edje_file->sound_dir->tones[i].value == value)
{ {
ERR("%s: Error. Tone name %s with same frequency %d exist.", ERR("Tone name %s with same frequency %d exist.",
progname, edje_file->sound_dir->tones[i].name, value); edje_file->sound_dir->tones[i].name, value);
exit(-1); exit(-1);
} }
} }
@ -2130,7 +2129,7 @@ st_collections_group_sound_tone(void)
if (!edje_file->sound_dir->tones) if (!edje_file->sound_dir->tones)
{ {
ERR("%s: Error. No enough memory.", progname); ERR("No enough memory.");
exit(-1); exit(-1);
} }
@ -2179,7 +2178,7 @@ ob_collections_group(void)
if (current_de && !current_de->entry) if (current_de && !current_de->entry)
{ {
ERR("%p: Error. A collection without a name was detected, that's not allowed.", progname); ERR("A collection without a name was detected, that's not allowed.");
exit(-1); exit(-1);
} }
@ -2304,16 +2303,16 @@ st_collections_group_inherit(void)
} }
if (!pc2) if (!pc2)
{ {
ERR("%s: Error. parse error %s:%i. There isn't a group with the name %s", ERR("parse error %s:%i. There isn't a group with the name %s",
progname, file_in, line - 1, parent_name); file_in, line - 1, parent_name);
exit(-1); exit(-1);
} }
if (pc2 == pc) if (pc2 == pc)
{ {
ERR("%s: Error. parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible." ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."
"If there is another group of the same name, you want to inherit from that group and have the" "If there is another group of the same name, you want to inherit from that group and have the"
"same name as that group, there is a trick ! Just put the inherit before the directive that set" "same name as that group, there is a trick ! Just put the inherit before the directive that set"
"the name !", progname, file_in, line - 1, parent_name); "the name !", file_in, line - 1, parent_name);
exit(-1); exit(-1);
} }
@ -2704,8 +2703,8 @@ ob_collections_group_script(void)
cd->l2 = get_verbatim_line2(); cd->l2 = get_verbatim_line2();
if (cd->shared) if (cd->shared)
{ {
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group", ERR("parse error %s:%i. There is already an existing script section for the group",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
cd->shared = s; cd->shared = s;
@ -2735,8 +2734,8 @@ ob_collections_group_lua_script(void)
cd->l2 = get_verbatim_line2(); cd->l2 = get_verbatim_line2();
if (cd->shared) if (cd->shared)
{ {
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group", ERR("parse error %s:%i. There is already an existing script section for the group",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
cd->shared = s; cd->shared = s;
@ -2845,7 +2844,7 @@ st_collections_group_limits_vertical(void)
pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *)); pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *));
if (!pc->limits.vertical || !el) if (!pc->limits.vertical || !el)
{ {
ERR("%s: Error. Not enough memory.", progname); ERR("Not enough memory.");
exit(-1); exit(-1);
} }
@ -2883,7 +2882,7 @@ st_collections_group_limits_horizontal(void)
pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *)); pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *));
if (!pc->limits.horizontal || !el) if (!pc->limits.horizontal || !el)
{ {
ERR("%s: Error. Not enough memory.", progname); ERR("Not enough memory.");
exit(-1); exit(-1);
} }
@ -2977,7 +2976,7 @@ ob_collections_group_parts_part(void)
pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *)); pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
if (!pc->parts) if (!pc->parts)
{ {
ERR("%s: Error. Not enough memory.", progname); ERR("Not enough memory.");
exit(-1); exit(-1);
} }
current_part = pc->parts[pc->parts_count - 1] = ep; current_part = pc->parts[pc->parts_count - 1] = ep;
@ -3044,8 +3043,8 @@ st_collections_group_parts_part_name(void)
epp = (Edje_Part_Parser *)pc->parts[i]; epp = (Edje_Part_Parser *)pc->parts[i];
if (!epp->can_override) if (!epp->can_override)
{ {
ERR("%s: Error. parse error %s:%i. There is already a part of the name %s", ERR("parse error %s:%i. There is already a part of the name %s",
progname, file_in, line - 1, ep->name); file_in, line - 1, ep->name);
exit(-1); exit(-1);
} }
else else
@ -3866,9 +3865,8 @@ static void ob_collections_group_parts_part_box_items_item(void)
if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE)) if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-BOX or TABLE part.",
"box attributes in non-BOX or TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -3876,7 +3874,7 @@ static void ob_collections_group_parts_part_box_items_item(void)
ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count); ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count);
if (!ep->items) if (!ep->items)
{ {
ERR("%s: Error. Not enough memory.", progname); ERR("Not enough memory.");
exit(-1); exit(-1);
} }
@ -3931,9 +3929,8 @@ static void st_collections_group_parts_part_box_items_item_type(void)
s = parse_str(0); s = parse_str(0);
if (strcmp(s, "GROUP")) if (strcmp(s, "GROUP"))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. token %s not one of: GROUP.",
"token %s not one of: GROUP.", file_in, line - 1, s);
progname, file_in, line - 1, s);
exit(-1); exit(-1);
} }
/* FIXME: handle the enum, once everything else is supported */ /* FIXME: handle the enum, once everything else is supported */
@ -3974,8 +3971,8 @@ static void st_collections_group_parts_part_box_items_item_name(void)
pitem = (Edje_Pack_Element_Parser *)ep->items[i]; pitem = (Edje_Pack_Element_Parser *)ep->items[i];
if (!pitem->can_override) if (!pitem->can_override)
{ {
ERR("%s: Error. parse error %s:%i. There is already a item of the name %s", ERR("parse error %s:%i. There is already a item of the name %s",
progname, file_in, line - 1, item->name); file_in, line - 1, item->name);
exit(-1); exit(-1);
} }
else else
@ -4193,9 +4190,8 @@ static void st_collections_group_parts_part_table_items_item_position(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. table attributes in non-TABLE part.",
"table attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4220,9 +4216,8 @@ static void st_collections_group_parts_part_table_items_item_span(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. table attributes in non-TABLE part.",
"table attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4367,9 +4362,8 @@ st_collections_group_parts_part_description_inherit(void)
if (!ed->state.name) if (!ed->state.name)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. inherit may only be used after state",
"inherit may only be used after state", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4381,9 +4375,9 @@ st_collections_group_parts_part_description_inherit(void)
/* inherit may not be used in the default description */ /* inherit may not be used in the default description */
if (!ep->other.desc_count) if (!ep->other.desc_count)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"inherit may not be used in the default description", "inherit may not be used in the default description",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4429,9 +4423,9 @@ st_collections_group_parts_part_description_inherit(void)
if (!parent) if (!parent)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"cannot find referenced part state %s %lf", "cannot find referenced part %s state %s %lf",
ep->name, file_in, line - 1, parent_name, parent_val); file_in, line - 1, ep->name, parent_name, parent_val);
exit(-1); exit(-1);
} }
@ -4590,9 +4584,8 @@ st_collections_group_parts_part_description_source(void)
if (current_part->type != EDJE_PART_TYPE_PROXY) if (current_part->type != EDJE_PART_TYPE_PROXY)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. source attributes in non-PROXY part.",
"source attributes in non-PROXY part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4635,9 +4628,8 @@ st_collections_group_parts_part_description_state(void)
s = parse_str(0); s = parse_str(0);
if (!strcmp (s, "custom")) if (!strcmp (s, "custom"))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. invalid state name: '%s'.",
"invalid state name: '%s'.", file_in, line - 1, s);
progname, file_in, line - 1, s);
exit(-1); exit(-1);
} }
@ -4701,9 +4693,8 @@ st_collections_group_parts_part_description_visible(void)
if (current_part->type == EDJE_PART_TYPE_SPACER) if (current_part->type == EDJE_PART_TYPE_SPACER)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. SPACER part can't have a visibility defined",
"SPACER part can't have a visibility defined", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4820,9 +4811,9 @@ st_collections_group_parts_part_description_min(void)
if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) || if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) ||
!tmp || strcmp(tmp, "SOURCE") != 0) !tmp || strcmp(tmp, "SOURCE") != 0)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"Only IMAGE and GROUP part can have a min: SOURCE; defined", "Only IMAGE and GROUP part can have a min: SOURCE; defined",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4880,9 +4871,9 @@ st_collections_group_parts_part_description_max(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE || if (current_part->type != EDJE_PART_TYPE_IMAGE ||
!tmp || strcmp(tmp, "SOURCE") != 0) !tmp || strcmp(tmp, "SOURCE") != 0)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"Only IMAGE part can have a max: SOURCE; defined", "Only IMAGE part can have a max: SOURCE; defined",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
@ -4978,9 +4969,8 @@ st_collections_group_parts_part_description_color_class(void)
if (current_part->type == EDJE_PART_TYPE_SPACER) if (current_part->type == EDJE_PART_TYPE_SPACER)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. SPACER part can't have a color defined",
"SPACER part can't have a color defined", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5004,9 +4994,8 @@ st_collections_group_parts_part_description_color(void)
if (current_part->type == EDJE_PART_TYPE_SPACER) if (current_part->type == EDJE_PART_TYPE_SPACER)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. SPACER part can't have a color defined",
"SPACER part can't have a color defined", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5033,9 +5022,8 @@ st_collections_group_parts_part_description_color2(void)
if (current_part->type == EDJE_PART_TYPE_SPACER) if (current_part->type == EDJE_PART_TYPE_SPACER)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. SPACER part can't have a color defined",
"SPACER part can't have a color defined", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5068,7 +5056,8 @@ st_collections_group_parts_part_description_color3(void)
if (current_part->type != EDJE_PART_TYPE_TEXT if (current_part->type != EDJE_PART_TYPE_TEXT
&& current_part->type != EDJE_PART_TYPE_TEXTBLOCK) && current_part->type != EDJE_PART_TYPE_TEXTBLOCK)
{ {
ERR("%s: Error. Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.", progname, current_part->name, pc->part); ERR("Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.",
current_part->name, pc->part);
exit(-1); exit(-1);
} }
@ -5349,9 +5338,9 @@ st_collections_group_parts_part_description_image_normal(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image attributes in non-IMAGE part.", "image attributes in non-IMAGE part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5389,9 +5378,8 @@ st_collections_group_parts_part_description_image_tween(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5434,9 +5422,8 @@ st_collections_group_parts_part_description_image_border(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5469,9 +5456,8 @@ st_collections_group_parts_part_description_image_middle(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5512,9 +5498,8 @@ st_collections_group_parts_part_description_image_border_scale_by(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5543,9 +5528,8 @@ st_collections_group_parts_part_description_image_border_scale(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5577,9 +5561,8 @@ st_collections_group_parts_part_description_image_scale_hint(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE) if (current_part->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5659,9 +5642,9 @@ st_collections_group_parts_part_description_fill_smooth(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).", "image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).",
progname, file_in, line - 1, current_part->name, current_part->type); file_in, line - 1, current_part->name, current_part->type);
exit(-1); exit(-1);
} }
} }
@ -5693,9 +5676,8 @@ st_collections_group_parts_part_description_fill_spread(void)
/* XXX this will need to include IMAGES when spread support is added to evas images */ /* XXX this will need to include IMAGES when spread support is added to evas images */
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. fill.spread not supported yet.",
"fill.spread not supported yet.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5706,9 +5688,8 @@ st_collections_group_parts_part_description_fill_spread(void)
if (ep->type != EDJE_PART_TYPE_IMAGE) if (ep->type != EDJE_PART_TYPE_IMAGE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. image attributes in non-IMAGE part.",
"image attributes in non-IMAGE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -5759,9 +5740,9 @@ st_collections_group_parts_part_description_fill_type(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.", "image and proxy attributes in non-IMAGE, non-PROXY part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -5832,9 +5813,9 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.", "image and proxy attributes in non-IMAGE, non-PROXY part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -5882,9 +5863,9 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.", "image and proxy attributes in non-IMAGE, non-PROXY part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -5955,9 +5936,9 @@ st_collections_group_parts_part_description_fill_size_relative(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.", "image and proxy attributes in non-IMAGE, non-PROXY part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -6005,9 +5986,9 @@ st_collections_group_parts_part_description_fill_size_offset(void)
} }
default: default:
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.", "image and proxy attributes in non-IMAGE, non-PROXY part.",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -6069,9 +6050,8 @@ st_collections_group_parts_part_description_text_text(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6116,9 +6096,8 @@ st_collections_group_parts_part_description_text_text_class(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6149,9 +6128,8 @@ st_collections_group_parts_part_description_text_font(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6182,9 +6160,8 @@ st_collections_group_parts_part_description_text_style(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6216,9 +6193,8 @@ st_collections_group_parts_part_description_text_repch(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6249,9 +6225,8 @@ st_collections_group_parts_part_description_text_size(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6283,9 +6258,8 @@ st_collections_group_parts_part_description_text_size_range(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6295,9 +6269,8 @@ st_collections_group_parts_part_description_text_size_range(void)
ed->text.size_range_max = parse_int_range(1, 0, 255); ed->text.size_range_max = parse_int_range(1, 0, 255);
if (ed->text.size_range_min > ed->text.size_range_max) if (ed->text.size_range_min > ed->text.size_range_max)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. min size is bigger than max size.",
"min size is bigger than max size.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -6324,9 +6297,8 @@ st_collections_group_parts_part_description_text_fit(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6359,9 +6331,8 @@ st_collections_group_parts_part_description_text_min(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6394,9 +6365,8 @@ st_collections_group_parts_part_description_text_max(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6428,9 +6398,8 @@ st_collections_group_parts_part_description_text_align(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6465,9 +6434,8 @@ st_collections_group_parts_part_description_text_source(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6507,9 +6475,8 @@ st_collections_group_parts_part_description_text_text_source(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6547,9 +6514,8 @@ st_collections_group_parts_part_description_text_elipsis(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) && if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK)) (current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. text attributes in non-TEXT part.",
"text attributes in non-TEXT part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6643,9 +6609,8 @@ static void st_collections_group_parts_part_description_box_layout(void)
if (current_part->type != EDJE_PART_TYPE_BOX) if (current_part->type != EDJE_PART_TYPE_BOX)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-BOX part.",
"box attributes in non-BOX part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6664,9 +6629,8 @@ static void st_collections_group_parts_part_description_box_align(void)
if (current_part->type != EDJE_PART_TYPE_BOX) if (current_part->type != EDJE_PART_TYPE_BOX)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-BOX part.",
"box attributes in non-BOX part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6684,9 +6648,8 @@ static void st_collections_group_parts_part_description_box_padding(void)
if (current_part->type != EDJE_PART_TYPE_BOX) if (current_part->type != EDJE_PART_TYPE_BOX)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-BOX part.",
"box attributes in non-BOX part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6705,9 +6668,8 @@ st_collections_group_parts_part_description_box_min(void)
if (current_part->type != EDJE_PART_TYPE_BOX) if (current_part->type != EDJE_PART_TYPE_BOX)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-BOX part.",
"box attributes in non-BOX part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6792,9 +6754,8 @@ static void st_collections_group_parts_part_description_table_homogeneous(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. table attributes in non-TABLE part.",
"table attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6815,9 +6776,8 @@ static void st_collections_group_parts_part_description_table_align(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. table attributes in non-TABLE part.",
"table attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6835,9 +6795,8 @@ static void st_collections_group_parts_part_description_table_padding(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. table attributes in non-TABLE part.",
"table attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -6856,9 +6815,8 @@ st_collections_group_parts_part_description_table_min(void)
if (current_part->type != EDJE_PART_TYPE_TABLE) if (current_part->type != EDJE_PART_TYPE_TABLE)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. box attributes in non-TABLE part.",
"box attributes in non-TABLE part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -7265,9 +7223,8 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
if (current_part->type != EDJE_PART_TYPE_EXTERNAL) if (current_part->type != EDJE_PART_TYPE_EXTERNAL)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. params in non-EXTERNAL part.",
"params in non-EXTERNAL part.", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
@ -7310,8 +7267,8 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
param->s = parse_str(1); param->s = parse_str(1);
break; break;
default: default:
ERR("%s: Error. parse error %s:%i. Invalid param type.\n", ERR("parse error %s:%i. Invalid param type.",
progname, file_in, line - 1); file_in, line - 1);
break; break;
} }
@ -7654,8 +7611,7 @@ st_collections_group_programs_program_action(void)
break; break;
if (i == (int)(edje_file->sound_dir->samples_count - 1)) if (i == (int)(edje_file->sound_dir->samples_count - 1))
{ {
ERR("%s: Error. No Sample name %s exist.", progname, ERR("No Sample name %s exist.", ep->sample_name);
ep->sample_name);
exit(-1); exit(-1);
} }
} }
@ -7670,8 +7626,7 @@ st_collections_group_programs_program_action(void)
break; break;
if (i == (int)(edje_file->sound_dir->tones_count - 1)) if (i == (int)(edje_file->sound_dir->tones_count - 1))
{ {
ERR("%s: Error. No Tone name %s exist.", progname, ERR("No Tone name %s exist.", ep->tone_name);
ep->tone_name);
exit(-1); exit(-1);
} }
} }
@ -7835,9 +7790,8 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 2) else if (get_arg_count() != 2)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. Need 2rd parameter to set time",
"Need 2rd parameter to set time", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
} }
@ -7853,9 +7807,8 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 3) else if (get_arg_count() != 3)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. Need 3rd parameter to set factor",
"Need 3rd parameter to set factor", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0)); current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
@ -7872,9 +7825,9 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 4) else if (get_arg_count() != 4)
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. "
"Need 3rd and 4th parameters to set factor and counts", "Need 3rd and 4th parameters to set factor and counts",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0)); current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
@ -7944,9 +7897,8 @@ st_collections_group_programs_program_target(void)
data_queue_part_lookup(pc, name, &(et->id)); data_queue_part_lookup(pc, name, &(et->id));
else else
{ {
ERR("%s: Error. parse error %s:%i. " ERR("parse error %s:%i. target may only be used after action",
"target may only be used after action", file_in, line - 1);
progname, file_in, line - 1);
exit(-1); exit(-1);
} }
free(name); free(name);
@ -8059,8 +8011,8 @@ ob_collections_group_programs_program_script(void)
cp->original = strdup(s); cp->original = strdup(s);
if (cd->shared && cd->is_lua) if (cd->shared && cd->is_lua)
{ {
ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group", ERR("parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
progname, file_in, line - 1); file_in, line - 1);
exit(-1); exit(-1);
} }
cd->is_lua = 0; cd->is_lua = 0;

View File

@ -14,8 +14,8 @@ mem_alloc(size_t size)
mem = calloc(1, size); mem = calloc(1, size);
if (mem) return mem; if (mem) return mem;
ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s", ERR("%s:%i memory allocation of %zu bytes failed. %s",
progname, file_in, line, size, strerror(errno)); file_in, line, size, strerror(errno));
exit(-1); exit(-1);
return NULL; return NULL;
} }
@ -27,8 +27,8 @@ mem_strdup(const char *s)
str = strdup(s); str = strdup(s);
if (str) return str; if (str) return str;
ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"", ERR("%s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
progname, file_in, line, strlen(s) + 1, strerror(errno), s); file_in, line, strlen(s) + 1, strerror(errno), s);
exit(-1); exit(-1);
return NULL; return NULL;
} }

View File

@ -204,10 +204,9 @@ error_and_abort(Eet_File *ef __UNUSED__, const char *fmt, ...)
{ {
va_list ap; va_list ap;
fprintf(stderr, "%s: Error. ", progname);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); eina_log_vprint(_edje_cc_log_dom, EINA_LOG_LEVEL_CRITICAL,
"unknown", "unknown", 0, fmt, ap);
va_end(ap); va_end(ap);
unlink(file_out); unlink(file_out);
exit(-1); exit(-1);
@ -236,7 +235,7 @@ check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
{ {
if (epd->image.tweens[i]->id == -1) if (epd->image.tweens[i]->id == -1)
error_and_abort(ef, "Collection %i: tween image id missing for " error_and_abort(ef, "Collection %i: tween image id missing for "
"part \"%s\", description \"%s\" %f\n", "part \"%s\", description \"%s\" %f",
pc->id, ep->name, epd->common.state.name, epd->common.state.value); pc->id, ep->name, epd->common.state.name, epd->common.state.value);
} }
} }
@ -250,11 +249,11 @@ check_packed_items(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
{ {
if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source) if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
error_and_abort(ef, "Collection %i: missing source on packed item " error_and_abort(ef, "Collection %i: missing source on packed item "
"of type GROUP in part \"%s\"\n", "of type GROUP in part \"%s\"",
pc->id, ep->name); pc->id, ep->name);
if (ep->type == EDJE_PART_TYPE_TABLE && (ep->items[i]->col < 0 || ep->items[i]->row < 0)) if (ep->type == EDJE_PART_TYPE_TABLE && (ep->items[i]->col < 0 || ep->items[i]->row < 0))
error_and_abort(ef, "Collection %i: missing col/row on packed item " error_and_abort(ef, "Collection %i: missing col/row on packed item "
"for part \"%s\" of type TABLE\n", "for part \"%s\" of type TABLE",
pc->id, ep->name); pc->id, ep->name);
} }
} }
@ -263,7 +262,7 @@ static void
check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef) check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef)
{ {
if (!ed->state.name) if (!ed->state.name)
error_and_abort(ef, "Collection %i: description with state missing on part \"%s\"\n", error_and_abort(ef, "Collection %i: description with state missing on part \"%s\"",
pc->id, ep->name); pc->id, ep->name);
} }
@ -274,7 +273,7 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
/* FIXME: check image set and sort them. */ /* FIXME: check image set and sort them. */
if (!ep->default_desc) if (!ep->default_desc)
error_and_abort(ef, "Collection %i: default description missing " error_and_abort(ef, "Collection %i: default description missing "
"for part \"%s\"\n", pc->id, ep->name); "for part \"%s\"", pc->id, ep->name);
for (i = 0; i < ep->other.desc_count; ++i) for (i = 0; i < ep->other.desc_count; ++i)
check_nameless_state(pc, ep, ep->other.desc[i], ef); check_nameless_state(pc, ep, ep->other.desc[i], ef);
@ -293,7 +292,7 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
/* FIXME: When mask are supported remove this check */ /* FIXME: When mask are supported remove this check */
if (ep->clip_to_id != -1 && if (ep->clip_to_id != -1 &&
pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE) pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE)
error_and_abort(ef, "Collection %i: clip_to point to a non RECT part '%s' !\n", error_and_abort(ef, "Collection %i: clip_to point to a non RECT part '%s' !",
pc->id, pc->parts[ep->clip_to_id]->name); pc->id, pc->parts[ep->clip_to_id]->name);
} }
@ -309,7 +308,7 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
case EDJE_ACTION_TYPE_DRAG_VAL_PAGE: case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
if (!ep->targets) if (!ep->targets)
error_and_abort(ef, "Collection %i: target missing in program " error_and_abort(ef, "Collection %i: target missing in program "
"\"%s\"\n", pc->id, ep->name); "\"%s\"", pc->id, ep->name);
break; break;
default: default:
break; break;
@ -337,7 +336,7 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
if (!ce->entry) if (!ce->entry)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Collection %i: name missing.\n", ce->id); "Collection %i: name missing.", ce->id);
hw->errstr = strdup(buf); hw->errstr = strdup(buf);
return; return;
} }
@ -356,7 +355,7 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
if (!sce) if (!sce)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Collection %s (%i) can't find an correct alias.\n", "Collection %s (%i) can't find an correct alias.",
ce->entry, ce->id); ce->entry, ce->id);
hw->errstr = strdup(buf); hw->errstr = strdup(buf);
return; return;
@ -370,16 +369,15 @@ data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
if (bytes <= 0) if (bytes <= 0)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Unable to write \"edje_file\" entry to \"%s\" \n", "Unable to write \"edje_file\" entry to \"%s\"",
file_out); file_out);
hw->errstr = strdup(buf); hw->errstr = strdup(buf);
return; return;
} }
} }
if (verbose) INF("Wrote %9i bytes (%4iKb) for \"edje_file\" header",
printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n", bytes, (bytes + 512) / 1024);
progname, bytes, (bytes + 512) / 1024);
} }
static void static void
@ -453,7 +451,7 @@ data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
{ {
if (f) eina_file_close(f); if (f) eina_file_close(f);
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Unable to load font part \"%s\" entry to %s \n", "Unable to load font part \"%s\" entry to %s",
fc->fn->file, file_out); fc->fn->file, file_out);
fc->errstr = strdup(buf); fc->errstr = strdup(buf);
return; return;
@ -468,16 +466,15 @@ data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
eina_file_close(f); eina_file_close(f);
snprintf(buf2, sizeof(buf2), snprintf(buf2, sizeof(buf2),
"Unable to write font part \"%s\" as \"%s\" " "Unable to write font part \"%s\" as \"%s\" "
"part entry to %s \n", fc->fn->file, buf, file_out); "part entry to %s", fc->fn->file, buf, file_out);
fc->errstr = strdup(buf2); fc->errstr = strdup(buf2);
return; return;
} }
if (verbose) INF("Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]",
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]\n", bytes, (bytes + 512) / 1024, buf, fc->fn->file,
progname, bytes, (bytes + 512) / 1024, buf, fc->fn->file, 100 - (100 * (double)bytes) / ((double)(eina_file_size_get(f)))
100 - (100 * (double)bytes) / ((double)(eina_file_size_get(f))) );
);
eina_file_map_free(f, m); eina_file_map_free(f, m);
eina_file_close(f); eina_file_close(f);
} }
@ -607,7 +604,7 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error)
} }
show_err: show_err:
error_and_abort error_and_abort
(ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s\n", (ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s",
file, file_out, errmsg, hint); file, file_out, errmsg, hint);
} }
@ -691,7 +688,7 @@ data_thread_image(void *data, Ecore_Thread *thread __UNUSED__)
snprintf(buf2, sizeof(buf2), snprintf(buf2, sizeof(buf2),
"Unable to write image part " "Unable to write image part "
"\"%s\" as \"%s\" part entry to " "\"%s\" as \"%s\" part entry to "
"%s\n", iw->img->entry, buf, file_out); "%s", iw->img->entry, buf, file_out);
iw->errstr = strdup(buf2); iw->errstr = strdup(buf2);
return; return;
} }
@ -701,18 +698,18 @@ data_thread_image(void *data, Ecore_Thread *thread __UNUSED__)
snprintf(buf2, sizeof(buf2), snprintf(buf2, sizeof(buf2),
"Unable to load image part " "Unable to load image part "
"\"%s\" as \"%s\" part entry to " "\"%s\" as \"%s\" part entry to "
"%s\n", iw->img->entry, buf, file_out); "%s", iw->img->entry, buf, file_out);
iw->errstr = strdup(buf2); iw->errstr = strdup(buf2);
return; return;
} }
if (verbose) if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
{ {
struct stat st; struct stat st;
if (!iw->path || (stat(iw->path, &st))) st.st_size = 0; if (!iw->path || (stat(iw->path, &st))) st.st_size = 0;
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]\n", INF("Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]",
progname, bytes, (bytes + 512) / 1024, buf, iw->img->entry, bytes, (bytes + 512) / 1024, buf, iw->img->entry,
100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)), 100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)),
100 - (100 * (double)bytes) / ((double)(st.st_size)) 100 - (100 * (double)bytes) / ((double)(st.st_size))
); );
@ -765,8 +762,7 @@ data_write_images(Eet_File *ef, int *image_num)
ecore_evas_init(); ecore_evas_init();
ee = ecore_evas_buffer_new(1, 1); ee = ecore_evas_buffer_new(1, 1);
if (!ee) if (!ee)
error_and_abort(ef, "Cannot create buffer engine canvas for image " error_and_abort(ef, "Cannot create buffer engine canvas for image load.");
"load.\n");
evas = ecore_evas_get(ee); evas = ecore_evas_get(ee);
for (i = 0; i < (int)edje_file->image_dir->entries_count; i++) for (i = 0; i < (int)edje_file->image_dir->entries_count; i++)
@ -878,8 +874,7 @@ data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
#endif #endif
if (!f) if (!f)
{ {
ERR("%s: Error: Unable to load sound data of: %s", ERR("Unable to load sound data of: %s", sw->sample->name);
progname, sw->sample->name);
exit(-1); exit(-1);
} }
@ -891,8 +886,8 @@ data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
EET_COMPRESSION_NONE); EET_COMPRESSION_NONE);
if (eina_file_map_faulted(f, m)) if (eina_file_map_faulted(f, m))
{ {
ERR("%s: Error: File access error when reading '%s'", ERR("File access error when reading '%s'",
progname, eina_file_filename_get(f)); eina_file_filename_get(f));
exit(-1); exit(-1);
} }
eina_file_map_free(f, m); eina_file_map_free(f, m);
@ -903,18 +898,16 @@ data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
//If encoded temporary file, delete it. //If encoded temporary file, delete it.
if (enc_info->encoded) unlink(enc_info->file); if (enc_info->encoded) unlink(enc_info->file);
#endif #endif
if (verbose)
{
#ifdef HAVE_LIBSNDFILE #ifdef HAVE_LIBSNDFILE
printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry" INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
"\"%s\" \n", progname, bytes, (bytes + 512) / 1024, bytes, (bytes + 512) / 1024,
sndid_str, enc_info->comp_type, sw->sample->name); sndid_str, enc_info->comp_type, sw->sample->name);
#else #else
printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry" INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
"\"%s\" \n", progname, bytes, (bytes + 512) / 1024, bytes, (bytes + 512) / 1024,
sndid_str, "RAW PCM", sw->sample->name); sndid_str, "RAW PCM", sw->sample->name);
#endif #endif
}
#ifdef HAVE_LIBSNDFILE #ifdef HAVE_LIBSNDFILE
if ((enc_info->file) && (!enc_info->encoded)) if ((enc_info->file) && (!enc_info->encoded))
eina_stringshare_del(enc_info->file); eina_stringshare_del(enc_info->file);
@ -1002,15 +995,14 @@ data_thread_group(void *data, Ecore_Thread *thread __UNUSED__)
if (bytes <= 0) if (bytes <= 0)
{ {
snprintf(buf2, sizeof(buf2), snprintf(buf2, sizeof(buf2),
"Error. Unable to write \"%s\" part entry to %s\n", "Unable to write \"%s\" part entry to %s",
buf, file_out); buf, file_out);
gw->errstr = strdup(buf2); gw->errstr = strdup(buf2);
return; return;
} }
if (verbose) INF("Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry",
printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n", bytes, (bytes + 512) / 1024, buf, gw->pc->part);
progname, bytes, (bytes + 512) / 1024, buf, gw->pc->part);
} }
static void static void
@ -1040,8 +1032,7 @@ data_write_groups(Eet_File *ef, int *collection_num)
gw = calloc(1, sizeof(Group_Write)); gw = calloc(1, sizeof(Group_Write));
if (!gw) if (!gw)
{ {
error_and_abort(ef, error_and_abort(ef, "Cannot allocate memory for group writer");
"Error. Cannot allocate memory for group writer\n");
return; return;
} }
gw->ef = ef; gw->ef = ef;
@ -1064,7 +1055,7 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
FILE *f = fdopen(fd, "wb"); FILE *f = fdopen(fd, "wb");
if (!f) if (!f)
error_and_abort(ef, "Unable to open temp file \"%s\" for script " error_and_abort(ef, "Unable to open temp file \"%s\" for script "
"compilation.\n", filename); "compilation.", filename);
Eina_List *ll; Eina_List *ll;
Code_Program *cp; Code_Program *cp;
@ -1148,7 +1139,7 @@ data_thread_script(void *data, Ecore_Thread *thread __UNUSED__)
if (!f) if (!f)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Unable to open script object \"%s\" for reading.\n", "Unable to open script object \"%s\" for reading.",
sc->tmpo); sc->tmpo);
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
return; return;
@ -1167,7 +1158,7 @@ data_thread_script(void *data, Ecore_Thread *thread __UNUSED__)
if (fread(dat, size, 1, f) != 1) if (fread(dat, size, 1, f) != 1)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Unable to read all of script object \"%s\"\n", "Unable to read all of script object \"%s\"",
sc->tmpo); sc->tmpo);
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
return; return;
@ -1180,7 +1171,7 @@ data_thread_script(void *data, Ecore_Thread *thread __UNUSED__)
else else
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Alloc failed for %lu bytes\n", (unsigned long)size); "Alloc failed for %lu bytes", (unsigned long)size);
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
return; return;
} }
@ -1238,7 +1229,7 @@ data_scripts_exe_del_cb(void *data __UNUSED__, int evtype __UNUSED__, void *evin
if (ecore_exe_data_get(ev->exe) != sc) return ECORE_CALLBACK_RENEW; if (ecore_exe_data_get(ev->exe) != sc) return ECORE_CALLBACK_RENEW;
if (ev->exit_code != 0) if (ev->exit_code != 0)
{ {
error_and_abort(sc->ef, "Compiling script code not clean.\n"); error_and_abort(sc->ef, "Compiling script code not clean.");
return ECORE_CALLBACK_CANCEL; return ECORE_CALLBACK_CANCEL;
} }
if (threads) if (threads)
@ -1288,14 +1279,14 @@ data_write_scripts(Eet_File *ef)
sc->tmpn_fd = mkstemp(sc->tmpn); sc->tmpn_fd = mkstemp(sc->tmpn);
if (sc->tmpn_fd < 0) if (sc->tmpn_fd < 0)
error_and_abort(ef, "Unable to open temp file \"%s\" for script " error_and_abort(ef, "Unable to open temp file \"%s\" for script "
"compilation.\n", sc->tmpn); "compilation.", sc->tmpn);
snprintf(sc->tmpo, PATH_MAX, "%s/edje_cc.amx-tmp-XXXXXX", tmp_dir); snprintf(sc->tmpo, PATH_MAX, "%s/edje_cc.amx-tmp-XXXXXX", tmp_dir);
sc->tmpo_fd = mkstemp(sc->tmpo); sc->tmpo_fd = mkstemp(sc->tmpo);
if (sc->tmpo_fd < 0) if (sc->tmpo_fd < 0)
{ {
unlink(sc->tmpn); unlink(sc->tmpn);
error_and_abort(ef, "Unable to open temp file \"%s\" for script " error_and_abort(ef, "Unable to open temp file \"%s\" for script "
"compilation.\n", sc->tmpn); "compilation.", sc->tmpn);
} }
create_script_file(ef, sc->tmpn, cd, sc->tmpn_fd); create_script_file(ef, sc->tmpn, cd, sc->tmpn_fd);
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
@ -1354,7 +1345,7 @@ _edje_lua_error_and_abort(lua_State *L, int err_code, Script_Write *sc)
break; break;
} }
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Lua %s error: %s\n", err_type, lua_tostring(L, -1)); "Lua %s error: %s", err_type, lua_tostring(L, -1));
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
} }
@ -1377,7 +1368,7 @@ data_thread_lua_script(void *data, Ecore_Thread *thread __UNUSED__)
if (!L) if (!L)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Lua error: Lua state could not be initialized\n"); "Lua error: Lua state could not be initialized");
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
return; return;
} }
@ -1444,7 +1435,7 @@ data_thread_lua_script(void *data, Ecore_Thread *thread __UNUSED__)
if (eet_write(sc->ef, buf, dat.buf, dat.size, compress_mode) <= 0) if (eet_write(sc->ef, buf, dat.buf, dat.size, compress_mode) <= 0)
{ {
snprintf(buf, sizeof(buf), snprintf(buf, sizeof(buf),
"Unable to write script %i\n", sc->i); "Unable to write script %i", sc->i);
sc->errstr = strdup(buf); sc->errstr = strdup(buf);
return; return;
} }
@ -1540,16 +1531,14 @@ data_write(void)
if (!edje_file) if (!edje_file)
{ {
ERR("%s: Error. No data to put in \"%s\"", ERR("No data to put in \"%s\"", file_out);
progname, file_out);
exit(-1); exit(-1);
} }
ef = eet_open(file_out, EET_FILE_MODE_WRITE); ef = eet_open(file_out, EET_FILE_MODE_WRITE);
if (!ef) if (!ef)
{ {
ERR("%s: Error. Unable to open \"%s\" for writing output", ERR("Unable to open \"%s\" for writing output", file_out);
progname, file_out);
exit(-1); exit(-1);
} }
@ -1560,25 +1549,15 @@ data_write(void)
pending_threads++; pending_threads++;
t = ecore_time_get(); t = ecore_time_get();
data_write_header(ef); data_write_header(ef);
if (verbose)
{ INF("header: %3.5f", ecore_time_get() - t); t = ecore_time_get();
printf("header: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_groups(ef, &collection_num); data_write_groups(ef, &collection_num);
if (verbose) INF("groups: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("groups: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_scripts(ef); data_write_scripts(ef);
if (verbose) INF("scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_lua_scripts(ef); data_write_lua_scripts(ef);
if (verbose) INF("lua scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("lua scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
pending_threads++; pending_threads++;
if (threads) if (threads)
ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef); ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef);
@ -1587,10 +1566,7 @@ data_write(void)
data_thread_source(ef, NULL); data_thread_source(ef, NULL);
data_thread_source_end(ef, NULL); data_thread_source_end(ef, NULL);
} }
if (verbose) INF("source: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("source: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
pending_threads++; pending_threads++;
if (threads) if (threads)
ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef); ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef);
@ -1599,45 +1575,32 @@ data_write(void)
data_thread_fontmap(ef, NULL); data_thread_fontmap(ef, NULL);
data_thread_fontmap_end(ef, NULL); data_thread_fontmap_end(ef, NULL);
} }
if (verbose) INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("fontmap: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_images(ef, &image_num); data_write_images(ef, &image_num);
if (verbose) INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("images: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_fonts(ef, &font_num); data_write_fonts(ef, &font_num);
if (verbose) INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("fonts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
data_write_sounds(ef, &sound_num); data_write_sounds(ef, &sound_num);
if (verbose) INF("sounds: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("sounds: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
pending_threads--; pending_threads--;
if (pending_threads > 0) ecore_main_loop_begin(); if (pending_threads > 0) ecore_main_loop_begin();
if (verbose) INF("THREADS: %3.5f", ecore_time_get() - t); t = ecore_time_get();
{
printf("THREADS: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
}
eet_close(ef); eet_close(ef);
if (verbose) if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
printf("Summary:\n" {
" Wrote %i collections\n" printf("Summary:\n"
" Wrote %i images\n" " Wrote %i collections\n"
" Wrote %i sounds\n" " Wrote %i images\n"
" Wrote %i fonts\n" " Wrote %i sounds\n"
, " Wrote %i fonts\n"
collection_num, ,
image_num, collection_num,
sound_num, image_num,
font_num); sound_num,
font_num);
}
} }
void void
@ -1658,7 +1621,7 @@ reorder_parts(void)
{ {
ep = (Edje_Part_Parser *)pc->parts[i]; ep = (Edje_Part_Parser *)pc->parts[i];
if (ep->reorder.insert_before && ep->reorder.insert_after) if (ep->reorder.insert_before && ep->reorder.insert_after)
ERR("%s: Error. Unable to use together insert_before and insert_after in part \"%s\".", progname, pc->parts[i]->name); ERR("Unable to use together insert_before and insert_after in part \"%s\".", pc->parts[i]->name);
if (ep->reorder.done) if (ep->reorder.done)
{ {
@ -1674,9 +1637,11 @@ reorder_parts(void)
{ {
ep2 = (Edje_Part_Parser *)pc->parts[j]; ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.after) if (ep2->reorder.after)
ERR("%s: Error. The part \"%s\" is ambiguous ordered part.", progname, pc->parts[i]->name); ERR("The part \"%s\" is ambiguous ordered part.",
pc->parts[i]->name);
if (ep2->reorder.linked_prev) if (ep2->reorder.linked_prev)
ERR("%s: Error. Unable to insert two or more parts in same part \"%s\".", progname, pc->parts[j]->name); ERR("Unable to insert two or more parts in same part \"%s\".",
pc->parts[j]->name);
k = j - 1; k = j - 1;
found = EINA_TRUE; found = EINA_TRUE;
ep2->reorder.linked_prev += ep->reorder.linked_prev + 1; ep2->reorder.linked_prev += ep->reorder.linked_prev + 1;
@ -1693,9 +1658,9 @@ reorder_parts(void)
{ {
ep2 = (Edje_Part_Parser *)pc->parts[j]; ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.before) if (ep2->reorder.before)
ERR("%s: Error. The part \"%s\" is ambiguous ordered part.", progname, pc->parts[i]->name); ERR("The part \"%s\" is ambiguous ordered part.", pc->parts[i]->name);
if (ep2->reorder.linked_next) if (ep2->reorder.linked_next)
ERR("%s: Error. Unable to insert two or more parts in same part \"%s\".", progname, pc->parts[j]->name); ERR("Unable to insert two or more parts in same part \"%s\".", pc->parts[j]->name);
k = j; k = j;
found = EINA_TRUE; found = EINA_TRUE;
ep2->reorder.linked_next += ep->reorder.linked_next + 1; ep2->reorder.linked_next += ep->reorder.linked_next + 1;
@ -1714,8 +1679,7 @@ reorder_parts(void)
if (((i > k) && ((i - ep->reorder.linked_prev) <= k)) if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|| ((i < k) && ((i + ep->reorder.linked_next) >= k))) || ((i < k) && ((i + ep->reorder.linked_next) >= k)))
ERR("%s: Error. The part order is wrong. It has circular dependency.", ERR("The part order is wrong. It has circular dependency.");
progname);
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1; amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
linked = i - ep->reorder.linked_prev; linked = i - ep->reorder.linked_prev;
@ -2175,8 +2139,8 @@ data_process_lookups(void)
if (i == part->pc->parts_count) if (i == part->pc->parts_count)
{ {
ERR("%s: Error. Unable to find part name \"%s\" needed in group '%s'.", ERR("Unable to find part name \"%s\" needed in group '%s'.",
progname, alias, part->pc->part); alias, part->pc->part);
exit(-1); exit(-1);
} }
} }
@ -2217,11 +2181,10 @@ data_process_lookups(void)
if (!find) if (!find)
{ {
if (!program->anonymous) if (!program->anonymous)
ERR("%s: Error. Unable to find program name \"%s\".", ERR("Unable to find program name \"%s\".",
progname, program->u.name); program->u.name);
else else
ERR("%s: Error. Unable to find anonymous program.", ERR("Unable to find anonymous program.");
progname);
exit(-1); exit(-1);
} }
@ -2260,8 +2223,7 @@ data_process_lookups(void)
if (!de) if (!de)
{ {
ERR("%s: Error. Unable to find group name \"%s\".", ERR("Unable to find group name \"%s\".", group->name);
progname, group->name);
exit(-1); exit(-1);
} }
@ -2333,8 +2295,7 @@ free_group:
if (!find) if (!find)
{ {
ERR("%s: Error. Unable to find image name \"%s\".", ERR("Unable to find image name \"%s\".", image->name);
progname, image->name);
exit(-1); exit(-1);
} }
@ -2355,14 +2316,8 @@ free_group:
if (de->entry && eina_hash_find(images_in_use, de->entry)) if (de->entry && eina_hash_find(images_in_use, de->entry))
continue ; continue ;
if (verbose) INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
{ de->entry, de->id);
printf("%s: Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.\n", progname, de->entry, de->id);
}
else
{
INF("Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.", de->entry, de->id);
}
de->entry = NULL; de->entry = NULL;
} }
@ -2374,14 +2329,7 @@ free_group:
if (set->name && eina_hash_find(images_in_use, set->name)) if (set->name && eina_hash_find(images_in_use, set->name))
continue ; continue ;
if (verbose) INF("Set '%s' will not be included as it is unused.", set->name);
{
printf("%s: Set '%s' will not be included as it is unused.\n", progname, set->name);
}
else
{
INF("Set '%s' will not be included as it is unused.", set->name);
}
set->name = NULL; set->name = NULL;
set->entries = NULL; set->entries = NULL;
@ -2607,8 +2555,7 @@ data_process_script_lookups(void)
n = eina_convert_itoa(cl->val, buf); n = eina_convert_itoa(cl->val, buf);
if (n > cl->len) if (n > cl->len)
{ {
ERR("%s: Error. The unexpected happened. A numeric replacement string was larger than the original!", ERR("The unexpected happened. A numeric replacement string was larger than the original!");
progname);
exit(-1); exit(-1);
} }
memset(cl->ptr, ' ', cl->len); memset(cl->ptr, ' ', cl->len);

View File

@ -163,8 +163,8 @@ new_object(void)
sh = eina_hash_find(_new_statement_hash, id); sh = eina_hash_find(_new_statement_hash, id);
if (!sh) if (!sh)
{ {
ERR("%s: Error. %s:%i unhandled keyword %s", ERR("%s:%i unhandled keyword %s",
progname, file_in, line - 1, file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack))); (char *)eina_list_data_get(eina_list_last(stack)));
err_show(); err_show();
exit(-1); exit(-1);
@ -188,8 +188,8 @@ new_statement(void)
} }
else else
{ {
ERR("%s: Error. %s:%i unhandled keyword %s", ERR("%s:%i unhandled keyword %s",
progname, file_in, line - 1, file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack))); (char *)eina_list_data_get(eina_list_last(stack)));
err_show(); err_show();
exit(-1); exit(-1);
@ -286,8 +286,8 @@ next_token(char *p, char *end, char **new_p, int *delim)
tmpstr = alloca(l + 1); tmpstr = alloca(l + 1);
if (!tmpstr) if (!tmpstr)
{ {
ERR("%s: Error. %s:%i malloc %i bytes failed", ERR("%s:%i malloc %i bytes failed",
progname, file_in, line - 1, l + 1); file_in, line - 1, l + 1);
exit(-1); exit(-1);
} }
strncpy(tmpstr, p, l); strncpy(tmpstr, p, l);
@ -467,8 +467,8 @@ stack_chop_top(void)
} }
else else
{ {
ERR("%s: Error. parse error %s:%i. } marker without matching { marker", ERR("parse error %s:%i. } marker without matching { marker",
progname, file_in, line - 1); file_in, line - 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -481,11 +481,8 @@ parse(char *data, off_t size)
int delim = 0; int delim = 0;
int do_params = 0; int do_params = 0;
if (verbose) DBG("Parsing input file");
{
INF("%s: Parsing input file",
progname);
}
p = data; p = data;
end = data + size; end = data + size;
line = 1; line = 1;
@ -496,8 +493,8 @@ parse(char *data, off_t size)
*/ */
if (do_params && delim && *token != ';') if (do_params && delim && *token != ';')
{ {
ERR("%s: Error. parse error %s:%i. %c marker before ; marker", ERR("parse error %s:%i. %c marker before ; marker",
progname, file_in, line - 1, *token); file_in, line - 1, *token);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -508,9 +505,9 @@ parse(char *data, off_t size)
{ {
if (do_params) if (do_params)
{ {
ERR("%s: Error. parse error %s:%i. } marker before ; marker", ERR("Parse error %s:%i. } marker before ; marker",
progname, file_in, line - 1); file_in, line - 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
else else
@ -536,8 +533,8 @@ parse(char *data, off_t size)
{ {
if (do_params) if (do_params)
{ {
ERR("%s: Error. parse error %s:%i. { marker before ; marker", ERR("parse error %s:%i. { marker before ; marker",
progname, file_in, line - 1); file_in, line - 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -620,8 +617,8 @@ parse(char *data, off_t size)
} }
else else
{ {
ERR("%s: Error. parse error %s:%i. { marker does not have matching } marker", ERR("Parse error %s:%i. { marker does not have matching } marker",
progname, file_in, line - 1); file_in, line - 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -631,11 +628,8 @@ parse(char *data, off_t size)
} }
} }
} }
if (verbose)
{ DBG("Parsing done");
INF("%s: Parsing done",
progname);
}
} }
static char *clean_file = NULL; static char *clean_file = NULL;
@ -750,14 +744,14 @@ compile(void)
} }
else else
{ {
ERR("Error. Cannot run epp: %s", buf2); ERR("Cannot run epp: %s", buf2);
exit(-1); exit(-1);
} }
if (ret == EXIT_SUCCESS) if (ret == EXIT_SUCCESS)
file_in = tmpn; file_in = tmpn;
else else
{ {
ERR("Error. Exit code of epp not clean: %i", ret); ERR("Exit code of epp not clean: %i", ret);
exit(-1); exit(-1);
} }
free(def); free(def);
@ -765,14 +759,11 @@ compile(void)
fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR); fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0) if (fd < 0)
{ {
ERR("%s: Error. cannot open file \"%s\" for input. %s", ERR("Cannot open file \"%s\" for input. %s",
progname, file_in, strerror(errno)); file_in, strerror(errno));
exit(-1); exit(-1);
} }
if (verbose) DBG("Opening \"%s\" for input", file_in);
{
INF("%s: Opening \"%s\" for input", progname, file_in);
}
size = lseek(fd, 0, SEEK_END); size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET); lseek(fd, 0, SEEK_SET);
@ -781,8 +772,7 @@ compile(void)
parse(data, size); parse(data, size);
else else
{ {
ERR("%s: Error. cannot read file \"%s\". %s", ERR("Cannot read file \"%s\". %s", file_in, strerror(errno));
progname, file_in, strerror(errno));
exit(-1); exit(-1);
} }
free(data); free(data);
@ -792,7 +782,7 @@ compile(void)
{ {
if (!stl->name) if (!stl->name)
{ {
ERR("%s: Error. style must have a name.", progname); ERR("style must have a name.");
exit(-1); exit(-1);
} }
} }
@ -818,8 +808,8 @@ is_num(int n)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -843,8 +833,8 @@ parse_str(int n)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -868,8 +858,7 @@ _parse_enum(char *str, va_list va)
/* End of the list, nothing matched. */ /* End of the list, nothing matched. */
if (!s) if (!s)
{ {
fprintf(stderr, "%s: Error. %s:%i token %s not one of:", ERR("%s:%i token %s not one of:", file_in, line - 1, str);
progname, file_in, line - 1, str);
s = va_arg(va2, char *); s = va_arg(va2, char *);
while (s) while (s)
{ {
@ -908,8 +897,8 @@ parse_enum(int n, ...)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -946,8 +935,8 @@ parse_int(int n)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -964,16 +953,16 @@ parse_int_range(int n, int f, int t)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
i = my_atoi(str); i = my_atoi(str);
if ((i < f) || (i > t)) if ((i < f) || (i > t))
{ {
ERR("%s: Error. %s:%i integer %i out of range of %i to %i inclusive", ERR("%s:%i integer %i out of range of %i to %i inclusive",
progname, file_in, line - 1, i, f, t); file_in, line - 1, i, f, t);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -989,16 +978,16 @@ parse_bool(int n)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
if (!strstrip(str, buf, sizeof (buf))) if (!strstrip(str, buf, sizeof (buf)))
{ {
ERR("%s: Error. %s:%i expression is too long", ERR("%s:%i expression is too long",
progname, file_in, line - 1); file_in, line - 1);
return 0; return 0;
} }
@ -1010,8 +999,8 @@ parse_bool(int n)
i = my_atoi(str); i = my_atoi(str);
if ((i < 0) || (i > 1)) if ((i < 0) || (i > 1))
{ {
ERR("%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive", ERR("%s:%i integer %i out of range of 0 to 1 inclusive",
progname, file_in, line - 1, i); file_in, line - 1, i);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -1027,8 +1016,8 @@ parse_float(int n)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -1045,16 +1034,16 @@ parse_float_range(int n, double f, double t)
str = eina_list_nth(params, n); str = eina_list_nth(params, n);
if (!str) if (!str)
{ {
ERR("%s: Error. %s:%i no parameter supplied as argument %i", ERR("%s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1); file_in, line - 1, n + 1);
err_show(); err_show();
exit(-1); exit(-1);
} }
i = my_atof(str); i = my_atof(str);
if ((i < f) || (i > t)) if ((i < f) || (i > t))
{ {
ERR("%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f inclusive", ERR("%s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
progname, file_in, line - 1, i, f, t); file_in, line - 1, i, f, t);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -1074,8 +1063,8 @@ check_arg_count(int required_args)
if (num_args != required_args) if (num_args != required_args)
{ {
ERR("%s: Error. %s:%i got %i arguments, but expected %i", ERR("%s:%i got %i arguments, but expected %i",
progname, file_in, line - 1, num_args, required_args); file_in, line - 1, num_args, required_args);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -1088,9 +1077,8 @@ check_min_arg_count(int min_required_args)
if (num_args < min_required_args) if (num_args < min_required_args)
{ {
ERR("%s: Error. %s:%i got %i arguments, " ERR("%s:%i got %i arguments, but expected at least %i",
"but expected at least %i", file_in, line - 1, num_args, min_required_args);
progname, file_in, line - 1, num_args, min_required_args);
err_show(); err_show();
exit(-1); exit(-1);
} }
@ -1117,8 +1105,8 @@ my_atoi(const char *s)
if (!s) return 0; if (!s) return 0;
if (!strstrip(s, buf, sizeof(buf))) if (!strstrip(s, buf, sizeof(buf)))
{ {
ERR("%s: Error. %s:%i expression is too long\n", ERR("%s:%i expression is too long",
progname, file_in, line - 1); file_in, line - 1);
return 0; return 0;
} }
_alphai(buf, &res); _alphai(buf, &res);
@ -1131,8 +1119,8 @@ _deltai(char *s, int *val)
if (!val) return NULL; if (!val) return NULL;
if ('(' != s[0]) if ('(' != s[0])
{ {
ERR("%s: Error. %s:%i unexpected character at %s\n", ERR("%s:%i unexpected character at %s",
progname, file_in, line - 1, s); file_in, line - 1, s);
return s; return s;
} }
else else
@ -1162,8 +1150,8 @@ _funci(char *s, int *val)
} }
else else
{ {
ERR("%s: Error. %s:%i unexpected character at %s\n", ERR("%s:%i unexpected character at %s",
progname, file_in, line - 1, s); file_in, line - 1, s);
} }
return s; return s;
} }
@ -1185,7 +1173,7 @@ _gammai(char *s, int *val)
else else
{ {
s = _funci(s, val); s = _funci(s, val);
// ERR("%s: Error. %s:%i unexpected character at %s\n", // ERR("%s:%i unexpected character at %s",
// progname, file_in, line - 1, s); // progname, file_in, line - 1, s);
} }
return s; return s;
@ -1295,8 +1283,7 @@ _calci(char op, int a, int b)
case '/': case '/':
if (0 != b) a /= b; if (0 != b) a /= b;
else else
ERR("%s: Error. %s:%i divide by zero\n", ERR("%s:%i divide by zero", file_in, line - 1);
progname, file_in, line - 1);
return a; return a;
case '*': case '*':
a *= b; a *= b;
@ -1304,12 +1291,10 @@ _calci(char op, int a, int b)
case '%': case '%':
if (0 != b) a = a % b; if (0 != b) a = a % b;
else else
ERR("%s: Error. %s:%i modula by zero\n", ERR("%s:%i modula by zero", file_in, line - 1);
progname, file_in, line - 1);
return a; return a;
default: default:
ERR("%s: Error. %s:%i unexpected character '%c'\n", ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
progname, file_in, line - 1, op);
} }
return a; return a;
} }
@ -1326,8 +1311,7 @@ my_atof(const char *s)
if (!strstrip(s, buf, sizeof (buf))) if (!strstrip(s, buf, sizeof (buf)))
{ {
ERR("%s: Error. %s:%i expression is too long", ERR("%s:%i expression is too long", file_in, line - 1);
progname, file_in, line - 1);
return 0; return 0;
} }
_alphaf(buf, &res); _alphaf(buf, &res);
@ -1340,8 +1324,7 @@ _deltaf(char *s, double *val)
if (!val) return NULL; if (!val) return NULL;
if ('(' != s[0]) if ('(' != s[0])
{ {
ERR("%s: Error. %s:%i unexpected character at %s", ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
progname, file_in, line - 1, s);
return s; return s;
} }
else else
@ -1370,8 +1353,7 @@ _funcf(char *s, double *val)
} }
else else
{ {
ERR("%s: Error. %s:%i unexpected character at %s\n", ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
progname, file_in, line - 1, s);
} }
return s; return s;
} }
@ -1394,7 +1376,7 @@ _gammaf(char *s, double *val)
else else
{ {
s = _funcf(s, val); s = _funcf(s, val);
// ERR("%s: Error. %s:%i unexpected character at %s\n", // ERR("%s:%i unexpected character at %s",
// progname, file_in, line - 1, s); // progname, file_in, line - 1, s);
} }
return s; return s;
@ -1508,8 +1490,7 @@ _calcf(char op, double a, double b)
case '/': case '/':
if (b != 0) a /= b; if (b != 0) a /= b;
else else
ERR("%s: Error. %s:%i divide by zero\n", ERR("%s:%i divide by zero", file_in, line - 1);
progname, file_in, line - 1);
return a; return a;
case '*': case '*':
a *= b; a *= b;
@ -1517,12 +1498,10 @@ _calcf(char op, double a, double b)
case '%': case '%':
if (0 != b) a = (double)((int)a % (int)b); if (0 != b) a = (double)((int)a % (int)b);
else else
ERR("%s: Error. %s:%i modula by zero\n", ERR("%s:%i modula by zero", file_in, line - 1);
progname, file_in, line - 1);
return a; return a;
default: default:
ERR("%s: Error. %s:%i unexpected character '%c'\n", ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
progname, file_in, line - 1, op);
} }
return a; return a;
} }
@ -1532,8 +1511,7 @@ strstrip(const char *in, char *out, size_t size)
{ {
if ((size -1 ) < strlen(in)) if ((size -1 ) < strlen(in))
{ {
ERR("%s: Error. %s:%i expression is too long", ERR("%s:%i expression is too long", file_in, line - 1);
progname, file_in, line - 1);
return 0; return 0;
} }
/* remove spaces and tabs */ /* remove spaces and tabs */

View File

@ -66,8 +66,7 @@ source_fetch_file(const char *fil, const char *filname)
f = fopen(fil, "rb"); f = fopen(fil, "rb");
if (!f) if (!f)
{ {
ERR("%s: Warning. Cannot open file '%s'", ERR("Cannot open file '%s'", fil);
progname, fil);
exit(-1); exit(-1);
} }
@ -82,8 +81,7 @@ source_fetch_file(const char *fil, const char *filname)
tmp = fread(sf->file, sz, 1, f); tmp = fread(sf->file, sz, 1, f);
if (tmp != 1) if (tmp != 1)
{ {
ERR("%s: Warning file length for (%s) doesn't match !", ERR("file length for (%s) doesn't match!", filname);
progname, filname);
exit(-1); exit(-1);
} }
} }

View File

@ -259,7 +259,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
/* Change structure layout */ /* Change structure layout */
edc = calloc(1, sizeof (Edje_Part_Collection)); edc = calloc(1, sizeof (Edje_Part_Collection));
if (!edc) error_and_abort(ef, "Not enough memory\n"); if (!edc) error_and_abort(ef, "Not enough memory");
ce->ref = edc; ce->ref = edc;
EINA_LIST_FREE(oedc->programs, pg) EINA_LIST_FREE(oedc->programs, pg)
@ -306,7 +306,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
edc->parts_count = eina_list_count(oedc->parts); edc->parts_count = eina_list_count(oedc->parts);
edc->parts = calloc(edc->parts_count, sizeof (Edje_Part *)); edc->parts = calloc(edc->parts_count, sizeof (Edje_Part *));
if (edc->parts_count && !edc->parts) if (edc->parts_count && !edc->parts)
error_and_abort(ef, "Not enough memory\n"); error_and_abort(ef, "Not enough memory");
k = 0; k = 0;
EINA_LIST_FREE(oedc->parts, part) EINA_LIST_FREE(oedc->parts, part)
@ -318,7 +318,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part)); replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part));
if (!replacement) if (!replacement)
error_and_abort(ef, "Not enough memory\n"); error_and_abort(ef, "Not enough memory");
replacement->name = part->name; replacement->name = part->name;
replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc); replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);

View File

@ -24,10 +24,9 @@ error_and_abort(Eet_File *ef, const char *fmt, ...)
{ {
va_list ap; va_list ap;
fprintf(stderr, "%s: Error. ", progname);
va_start(ap, fmt); va_start(ap, fmt);
vfprintf(stderr, fmt, ap); eina_log_vprint(_edje_cc_log_dom, EINA_LOG_LEVEL_CRITICAL,
"unknown", "unknown", 0, fmt, ap);
va_end(ap); va_end(ap);
eet_close(ef); eet_close(ef);
exit(-1); exit(-1);

View File

@ -19,7 +19,7 @@
#include "edje_decc.h" #include "edje_decc.h"
int _edje_cc_log_dom = -1; int _edje_cc_log_dom = -1;
char *progname = NULL; static char *progname = NULL;
char *file_in = NULL; char *file_in = NULL;
char *file_out = NULL; char *file_out = NULL;
int compress_mode = EET_COMPRESSION_DEFAULT; int compress_mode = EET_COMPRESSION_DEFAULT;
@ -37,6 +37,87 @@ void output(void);
static int compiler_cmd_is_sane(); static int compiler_cmd_is_sane();
static int root_filename_is_sane(); static int root_filename_is_sane();
static void
_edje_cc_log_cb(const Eina_Log_Domain *d,
Eina_Log_Level level,
const char *file,
const char *fnc,
int line,
const char *fmt,
__UNUSED__ void *data,
va_list args)
{
if ((d->name) && (d->namelen == sizeof("edje_decc") - 1) &&
(memcmp(d->name, "edje_decc", sizeof("edje_decc") - 1) == 0))
{
const char *prefix;
Eina_Bool use_color = !eina_log_color_disable_get();
if (use_color)
{
#ifndef _WIN32
fputs(eina_log_level_color_get(level), stderr);
#else
int color;
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
color = FOREGROUND_RED | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_ERR:
color = FOREGROUND_RED;
break;
case EINA_LOG_LEVEL_WARN:
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_INFO:
color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
break;
case EINA_LOG_LEVEL_DBG:
color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
break;
default:
color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
#endif
}
switch (level)
{
case EINA_LOG_LEVEL_CRITICAL:
prefix = "Critical. ";
break;
case EINA_LOG_LEVEL_ERR:
prefix = "Error. ";
break;
case EINA_LOG_LEVEL_WARN:
prefix = "Warning. ";
break;
default:
prefix = "";
}
fprintf(stderr, "%s: %s", progname, prefix);
if (use_color)
{
#ifndef _WIN32
fputs(EINA_COLOR_RESET, stderr);
#else
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
#endif
}
vfprintf(stderr, fmt, args);
putc('\n', stderr);
}
else
eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
}
static void static void
main_help(void) main_help(void)
{ {
@ -47,6 +128,7 @@ main_help(void)
" -main-out\tCreate a symbolic link to the main edc \n" " -main-out\tCreate a symbolic link to the main edc \n"
" -no-build-sh\tDon't output build.sh \n" " -no-build-sh\tDon't output build.sh \n"
" -current-dir\tOutput to current directory \n" " -current-dir\tOutput to current directory \n"
" -quiet\t\tProduce less output\n"
"\n" "\n"
,progname); ,progname);
} }
@ -70,7 +152,10 @@ main(int argc, char **argv)
eina_shutdown(); eina_shutdown();
exit(-1); exit(-1);
} }
progname = argv[0]; progname = (char *)ecore_file_file_get(argv[0]);
eina_log_print_cb_set(_edje_cc_log_cb, NULL);
eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_INFO);
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
if (!strcmp(argv[i], "-h")) if (!strcmp(argv[i], "-h"))
@ -89,6 +174,8 @@ main(int argc, char **argv)
build_sh = 0; build_sh = 0;
else if (!strcmp(argv[i], "-current-dir")) else if (!strcmp(argv[i], "-current-dir"))
new_dir = 0; new_dir = 0;
else if (!strcmp(argv[i], "-quiet"))
eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN);
} }
if (!file_in) if (!file_in)
{ {
@ -104,9 +191,9 @@ main(int argc, char **argv)
if (!decomp()) return -1; if (!decomp()) return -1;
output(); output();
fprintf(stderr, "WARNING! If any Image or audio data was encoded in a LOSSY way, then\n" WRN("If any Image or audio data was encoded in a LOSSY way, then "
"re-encoding will drop quality even more. You need access to the original\n" "re-encoding will drop quality even more. "
"data to ensure no loss of quality.\n"); "You need access to the original data to ensure no loss of quality.");
eet_close(ef); eet_close(ef);
edje_shutdown(); edje_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom); eina_log_domain_unregister(_edje_cc_log_dom);
@ -121,27 +208,27 @@ decomp(void)
ef = eet_open(file_in, EET_FILE_MODE_READ); ef = eet_open(file_in, EET_FILE_MODE_READ);
if (!ef) if (!ef)
{ {
ERR("ERROR: cannot open %s", file_in); ERR("cannot open %s", file_in);
return 0; return 0;
} }
srcfiles = source_load(ef); srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list) if (!srcfiles || !srcfiles->list)
{ {
ERR("ERROR: %s has no decompile information", file_in); ERR("%s has no decompile information", file_in);
eet_close(ef); eet_close(ef);
return 0; return 0;
} }
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane()) if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
{ {
ERR("ERROR: Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list)); ERR("Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list));
eet_close(ef); eet_close(ef);
return 0; return 0;
} }
edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje/file"); edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje/file");
if (!edje_file) if (!edje_file)
{ {
ERR("ERROR: %s does not appear to be an edje file", file_in); ERR("%s does not appear to be an edje file", file_in);
eet_close(ef); eet_close(ef);
return 0; return 0;
} }
@ -153,7 +240,7 @@ decomp(void)
} }
else if (!compiler_cmd_is_sane()) else if (!compiler_cmd_is_sane())
{ {
ERR("ERROR: invalid compiler executable: '%s'", edje_file->compiler); ERR("invalid compiler executable: '%s'", edje_file->compiler);
eet_close(ef); eet_close(ef);
return 0; return 0;
} }
@ -225,7 +312,7 @@ output(void)
snprintf(buf, sizeof(buf), "edje/images/%i", ei->id); snprintf(buf, sizeof(buf), "edje/images/%i", ei->id);
evas_object_image_file_set(im, file_in, buf); evas_object_image_file_set(im, file_in, buf);
snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry); snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
printf("Output Image: %s\n", out); INF("Output Image: %s", out);
pp = strdup(out); pp = strdup(out);
p = strrchr(pp, '/'); p = strrchr(pp, '/');
*p = 0; *p = 0;
@ -256,7 +343,7 @@ output(void)
char *pp; char *pp;
snprintf(out, sizeof(out), "%s/%s", outdir, sf->name); snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
INF("Output Source File: %s\n", out); INF("Output Source File: %s", out);
pp = strdup(out); pp = strdup(out);
p = strrchr(pp, '/'); p = strrchr(pp, '/');
*p = 0; *p = 0;
@ -345,10 +432,10 @@ output(void)
if (build_sh) if (build_sh)
{ {
snprintf(out, sizeof(out), "%s/build.sh", outdir); snprintf(out, sizeof(out), "%s/build.sh", outdir);
printf("Output Build Script: %s\n", out); INF("Output Build Script: %s", out);
if (strstr(out, "../")) if (strstr(out, "../"))
{ {
ERR("potential security violation. attempt to write in parent dir.\n"); ERR("potential security violation. attempt to write in parent dir.");
exit (-1); exit (-1);
} }
f = fopen(out, "wb"); f = fopen(out, "wb");
@ -356,7 +443,7 @@ output(void)
fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir); fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir);
fclose(f); fclose(f);
WRN("\n*** CAUTION ***\n" WRN("*** CAUTION ***\n"
"Please check the build script for anything malicious " "Please check the build script for anything malicious "
"before running it!\n\n"); "before running it!\n\n");
} }
@ -366,7 +453,7 @@ output(void)
snprintf(out, sizeof(out), "%s/%s", outdir, file_out); snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
if (ecore_file_symlink(sf->name, out) != EINA_TRUE) if (ecore_file_symlink(sf->name, out) != EINA_TRUE)
{ {
ERR("symlink %s -> %s failed\n", sf->name, out); ERR("symlink %s -> %s failed", sf->name, out);
} }
} }

View File

@ -6,6 +6,7 @@
/* logging variables */ /* logging variables */
extern int _edje_cc_log_dom ; extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN #define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR #ifdef ERR
# undef ERR # undef ERR
#endif #endif
@ -18,6 +19,14 @@ extern int _edje_cc_log_dom ;
# undef WRN # undef WRN
#endif #endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__) #define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_cc_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_edje_cc_log_dom, __VA_ARGS__)
/* types */ /* types */
typedef struct _Font Font; typedef struct _Font Font;

View File

@ -21,7 +21,7 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
enc_info = calloc(1, sizeof(Edje_Sound_Encode)); enc_info = calloc(1, sizeof(Edje_Sound_Encode));
if (!enc_info) if (!enc_info)
{ {
ERR("Error. while allocating memory to load file "); ERR("while allocating memory to load file ");
exit(-1); exit(-1);
} }
memset (&sfinfo, 0, sizeof (SF_INFO)); memset (&sfinfo, 0, sizeof (SF_INFO));
@ -33,13 +33,13 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
sfile = sf_open (filename, SFM_READ, &sfinfo); sfile = sf_open (filename, SFM_READ, &sfinfo);
if (!sfile) if (!sfile)
{ {
ERR("Error. Unable to open audio file : %s", filename); ERR("Unable to open audio file: %s", filename);
exit(-1); exit(-1);
} }
if (!sf_format_check(&sfinfo)) if (!sf_format_check(&sfinfo))
{ {
ERR("Error. Unknown file, not a valid audio file"); ERR("Unknown file, not a valid audio file");
exit(-1); exit(-1);
} }