char *file_in = NULL;
char *tmp_dir = NULL;
char *file_out = NULL;
-char *progname = NULL;
char *watchfile = NULL;
-int verbose = 0;
+
+static char *progname = NULL;
int no_lossy = 0;
int no_comp = 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
main_help(void)
{
printf
EINA_LOG_ERR("Enable to create a log domain.");
exit(-1);
}
+ progname = (char *)ecore_file_file_get(argv[0]);
+ eina_log_print_cb_set(_edje_cc_log_cb, NULL);
+
tmp_dir = getenv("TMPDIR");
img_dirs = eina_list_append(img_dirs, ".");
/* add defines to epp so edc files can detect edje_cc version */
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++)
{
if (!strcmp(argv[i], "-h"))
}
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 (!file_out)
file_out = argv[i];
}
+
if (!file_in)
{
fprintf(stderr, "%s: Error: no input file specified.\n", progname);
exit(-1);
}
+
+
pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
main, /* an optional symbol to check path of */
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
extern int _edje_cc_log_dom ;
#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
# undef ERR
#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
# undef INF
#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
# undef WRN
#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 */
typedef struct _New_Object_Handler New_Object_Handler;
extern char *file_in;
extern char *tmp_dir;
extern char *file_out;
-extern char *progname;
extern char *watchfile;
-extern int verbose;
extern int no_lossy;
extern int no_comp;
extern int no_raw;
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);
}
epp = (Edje_Program_Parser *)pgrms[i];
if (!epp->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n",
- progname, file_in, line - 1, name);
+ ERR("parse error %s:%i. There is already a program of the name %s",
+ file_in, line - 1, name);
exit(-1);
}
else
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else
{
- ERR("%s: Error. parse error %s:%i. "
- "target may only be used after action",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. target may only be used after action",
+ file_in, line - 1);
exit(-1);
}
}
0, sizeof (Edje_External_Directory));
if (!edje_file->external_dir->entries)
{
- ERR("%s: Error. not enough memory", progname);
+ ERR("not enough memory");
exit(-1);
}
0, sizeof (Edje_Image_Directory_Entry));
if (!edje_file->image_dir->entries)
{
- ERR("%s: Error. No enough memory.", progname);
+ ERR("No enough memory.");
exit(-1);
}
0, sizeof (Edje_Image_Directory_Set));
if (!edje_file->image_dir->sets)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
if (entry->size.min.w > entry->size.max.w
|| 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])",
- progname, file_in, line - 1,
+ ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
+ file_in, line - 1,
entry->size.min.w, entry->size.min.h,
entry->size.max.w, entry->size.max.h);
exit(-1);
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
- ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when opening file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
if (fstat(fd, &buf))
{
- ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when stating file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED)
{
- ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when mapping file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
for (i = 0; i < buf.st_size; ++i, ++over)
if (*over == '\0')
{
- ERR("%s: Error. %s:%i file \"%s\" is a binary file.",
- progname, file_in, line, filename);
+ ERR("%s:%i file \"%s\" is a binary file.", file_in, line, filename);
exit(-1);
}
{
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",
- progname, file_in, line - 1, cc->name);
+ ERR("parse error %s:%i. There is already a color class named \"%s\"",
+ file_in, line - 1, cc->name);
exit(-1);
}
}
{
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\"",
- progname, file_in, line - 1, stl->name);
+ ERR("parse error %s:%i. There is already a style named \"%s\"",
+ file_in, line - 1, stl->name);
exit(-1);
}
}
stl = eina_list_data_get(eina_list_last(edje_file->styles));
if (stl->tags)
{
- ERR("%s: Error. parse error %s:%i. There is already a basic format for the style",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. There is already a basic format for the style",
+ file_in, line - 1);
exit(-1);
}
tag = mem_alloc(SZ(Edje_Style_Tag));
if (!edje_file->sound_dir->samples)
{
- ERR("%s: Error. No enough memory.", progname);
+ ERR("No enough memory.");
exit(-1);
}
if (!edje_file->sound_dir->samples)
{
- ERR("%s: Error. Invalid sound sample source definition.", progname);
+ ERR("Invalid sound sample source definition.");
exit(-1);
}
if (!sample)
{
- ERR("%s: Error. Invalid sound sample source definition.", progname);
+ ERR("Invalid sound sample source definition.");
exit(-1);
}
sample->snd_src = parse_str(0);
{
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);
exit(-1);
}
if (edje_file->sound_dir->tones[i].value == value)
{
- ERR("%s: Error. Tone name %s with same frequency %d exist.",
- progname, edje_file->sound_dir->tones[i].name, value);
+ ERR("Tone name %s with same frequency %d exist.",
+ edje_file->sound_dir->tones[i].name, value);
exit(-1);
}
}
if (!edje_file->sound_dir->tones)
{
- ERR("%s: Error. No enough memory.", progname);
+ ERR("No enough memory.");
exit(-1);
}
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);
}
}
if (!pc2)
{
- ERR("%s: Error. parse error %s:%i. There isn't a group with the name %s",
- progname, file_in, line - 1, parent_name);
+ ERR("parse error %s:%i. There isn't a group with the name %s",
+ file_in, line - 1, parent_name);
exit(-1);
}
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"
"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);
}
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
- ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
exit(-1);
}
cd->shared = s;
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
- ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
exit(-1);
}
cd->shared = s;
pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *));
if (!pc->limits.vertical || !el)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *));
if (!pc->limits.horizontal || !el)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
if (!pc->parts)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
current_part = pc->parts[pc->parts_count - 1] = ep;
epp = (Edje_Part_Parser *)pc->parts[i];
if (!epp->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a part of the name %s",
- progname, file_in, line - 1, ep->name);
+ ERR("parse error %s:%i. There is already a part of the name %s",
+ file_in, line - 1, ep->name);
exit(-1);
}
else
if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE))
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX or TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-BOX or TABLE part.",
+ file_in, line - 1);
exit(-1);
}
ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count);
if (!ep->items)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
s = parse_str(0);
if (strcmp(s, "GROUP"))
{
- ERR("%s: Error. parse error %s:%i. "
- "token %s not one of: GROUP.",
- progname, file_in, line - 1, s);
+ ERR("parse error %s:%i. token %s not one of: GROUP.",
+ file_in, line - 1, s);
exit(-1);
}
/* FIXME: handle the enum, once everything else is supported */
pitem = (Edje_Pack_Element_Parser *)ep->items[i];
if (!pitem->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a item of the name %s",
- progname, file_in, line - 1, item->name);
+ ERR("parse error %s:%i. There is already a item of the name %s",
+ file_in, line - 1, item->name);
exit(-1);
}
else
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (!ed->state.name)
{
- ERR("%s: Error. parse error %s:%i. "
- "inherit may only be used after state",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. inherit may only be used after state",
+ file_in, line - 1);
exit(-1);
}
/* inherit may not be used in the default description */
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",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
if (!parent)
{
- ERR("%s: Error. parse error %s:%i. "
- "cannot find referenced part state %s %lf",
- ep->name, file_in, line - 1, parent_name, parent_val);
+ ERR("parse error %s:%i. "
+ "cannot find referenced part %s state %s %lf",
+ file_in, line - 1, ep->name, parent_name, parent_val);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_PROXY)
{
- ERR("%s: Error. parse error %s:%i. "
- "source attributes in non-PROXY part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. source attributes in non-PROXY part.",
+ file_in, line - 1);
exit(-1);
}
s = parse_str(0);
if (!strcmp (s, "custom"))
{
- ERR("%s: Error. parse error %s:%i. "
- "invalid state name: '%s'.",
- progname, file_in, line - 1, s);
+ ERR("parse error %s:%i. invalid state name: '%s'.",
+ file_in, line - 1, s);
exit(-1);
}
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a visibility defined",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. SPACER part can't have a visibility defined",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) ||
!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",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE ||
!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",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type == EDJE_PART_TYPE_SPACER)
{
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TEXT
&& 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);
}
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.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
}
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).",
- progname, file_in, line - 1, current_part->name, current_part->type);
+ file_in, line - 1, current_part->name, current_part->type);
exit(-1);
}
}
/* XXX this will need to include IMAGES when spread support is added to evas images */
{
- ERR("%s: Error. parse error %s:%i. "
- "fill.spread not supported yet.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. fill.spread not supported yet.",
+ file_in, line - 1);
exit(-1);
}
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
exit(-1);
}
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
ed->text.size_range_max = parse_int_range(1, 0, 255);
if (ed->text.size_range_min > ed->text.size_range_max)
{
- ERR("%s: Error. parse error %s:%i. "
- "min size is bigger than max size.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. min size is bigger than max size.",
+ file_in, line - 1);
exit(-1);
}
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-TABLE part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. box attributes in non-TABLE part.",
+ file_in, line - 1);
exit(-1);
}
if (current_part->type != EDJE_PART_TYPE_EXTERNAL)
{
- ERR("%s: Error. parse error %s:%i. "
- "params in non-EXTERNAL part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. params in non-EXTERNAL part.",
+ file_in, line - 1);
exit(-1);
}
param->s = parse_str(1);
break;
default:
- ERR("%s: Error. parse error %s:%i. Invalid param type.\n",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Invalid param type.",
+ file_in, line - 1);
break;
}
break;
if (i == (int)(edje_file->sound_dir->samples_count - 1))
{
- ERR("%s: Error. No Sample name %s exist.", progname,
- ep->sample_name);
+ ERR("No Sample name %s exist.", ep->sample_name);
exit(-1);
}
}
break;
if (i == (int)(edje_file->sound_dir->tones_count - 1))
{
- ERR("%s: Error. No Tone name %s exist.", progname,
- ep->tone_name);
+ ERR("No Tone name %s exist.", ep->tone_name);
exit(-1);
}
}
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 2)
{
- ERR("%s: Error. parse error %s:%i. "
- "Need 2rd parameter to set time",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Need 2rd parameter to set time",
+ file_in, line - 1);
exit(-1);
}
}
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 3)
{
- ERR("%s: Error. parse error %s:%i. "
- "Need 3rd parameter to set factor",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Need 3rd parameter to set factor",
+ file_in, line - 1);
exit(-1);
}
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
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",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
data_queue_part_lookup(pc, name, &(et->id));
else
{
- ERR("%s: Error. parse error %s:%i. "
- "target may only be used after action",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. target may only be used after action",
+ file_in, line - 1);
exit(-1);
}
free(name);
cp->original = strdup(s);
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",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
+ file_in, line - 1);
exit(-1);
}
cd->is_lua = 0;
mem = calloc(1, size);
if (mem) return mem;
- ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s",
- progname, file_in, line, size, strerror(errno));
+ ERR("%s:%i memory allocation of %zu bytes failed. %s",
+ file_in, line, size, strerror(errno));
exit(-1);
return NULL;
}
str = strdup(s);
if (str) return str;
- ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
- progname, file_in, line, strlen(s) + 1, strerror(errno), s);
+ ERR("%s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
+ file_in, line, strlen(s) + 1, strerror(errno), s);
exit(-1);
return NULL;
}
{
va_list ap;
- fprintf(stderr, "%s: Error. ", progname);
-
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);
unlink(file_out);
exit(-1);
{
if (epd->image.tweens[i]->id == -1)
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);
}
}
{
if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
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);
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 "
- "for part \"%s\" of type TABLE\n",
+ "for part \"%s\" of type TABLE",
pc->id, ep->name);
}
}
check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef)
{
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);
}
/* FIXME: check image set and sort them. */
if (!ep->default_desc)
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)
check_nameless_state(pc, ep, ep->other.desc[i], ef);
/* FIXME: When mask are supported remove this check */
if (ep->clip_to_id != -1 &&
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);
}
case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
if (!ep->targets)
error_and_abort(ef, "Collection %i: target missing in program "
- "\"%s\"\n", pc->id, ep->name);
+ "\"%s\"", pc->id, ep->name);
break;
default:
break;
if (!ce->entry)
{
snprintf(buf, sizeof(buf),
- "Collection %i: name missing.\n", ce->id);
+ "Collection %i: name missing.", ce->id);
hw->errstr = strdup(buf);
return;
}
if (!sce)
{
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);
hw->errstr = strdup(buf);
return;
if (bytes <= 0)
{
snprintf(buf, sizeof(buf),
- "Unable to write \"edje_file\" entry to \"%s\" \n",
+ "Unable to write \"edje_file\" entry to \"%s\"",
file_out);
hw->errstr = strdup(buf);
return;
}
}
- if (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
- progname, bytes, (bytes + 512) / 1024);
+ INF("Wrote %9i bytes (%4iKb) for \"edje_file\" header",
+ bytes, (bytes + 512) / 1024);
}
static void
{
if (f) eina_file_close(f);
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->errstr = strdup(buf);
return;
eina_file_close(f);
snprintf(buf2, sizeof(buf2),
"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);
return;
}
- if (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]\n",
- progname, bytes, (bytes + 512) / 1024, buf, fc->fn->file,
- 100 - (100 * (double)bytes) / ((double)(eina_file_size_get(f)))
- );
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]",
+ bytes, (bytes + 512) / 1024, buf, fc->fn->file,
+ 100 - (100 * (double)bytes) / ((double)(eina_file_size_get(f)))
+ );
eina_file_map_free(f, m);
eina_file_close(f);
}
}
show_err:
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);
}
snprintf(buf2, sizeof(buf2),
"Unable to write image part "
"\"%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);
return;
}
snprintf(buf2, sizeof(buf2),
"Unable to load image part "
"\"%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);
return;
}
- if (verbose)
+ if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
{
struct stat st;
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",
- progname, bytes, (bytes + 512) / 1024, buf, iw->img->entry,
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]",
+ bytes, (bytes + 512) / 1024, buf, iw->img->entry,
100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)),
100 - (100 * (double)bytes) / ((double)(st.st_size))
);
ecore_evas_init();
ee = ecore_evas_buffer_new(1, 1);
if (!ee)
- error_and_abort(ef, "Cannot create buffer engine canvas for image "
- "load.\n");
+ error_and_abort(ef, "Cannot create buffer engine canvas for image load.");
evas = ecore_evas_get(ee);
for (i = 0; i < (int)edje_file->image_dir->entries_count; i++)
#endif
if (!f)
{
- ERR("%s: Error: Unable to load sound data of: %s",
- progname, sw->sample->name);
+ ERR("Unable to load sound data of: %s", sw->sample->name);
exit(-1);
}
EET_COMPRESSION_NONE);
if (eina_file_map_faulted(f, m))
{
- ERR("%s: Error: File access error when reading '%s'",
- progname, eina_file_filename_get(f));
+ ERR("File access error when reading '%s'",
+ eina_file_filename_get(f));
exit(-1);
}
eina_file_map_free(f, m);
//If encoded temporary file, delete it.
if (enc_info->encoded) unlink(enc_info->file);
#endif
- if (verbose)
- {
#ifdef HAVE_LIBSNDFILE
- printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry"
- "\"%s\" \n", progname, bytes, (bytes + 512) / 1024,
- sndid_str, enc_info->comp_type, sw->sample->name);
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
+ bytes, (bytes + 512) / 1024,
+ sndid_str, enc_info->comp_type, sw->sample->name);
#else
- printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry"
- "\"%s\" \n", progname, bytes, (bytes + 512) / 1024,
- sndid_str, "RAW PCM", sw->sample->name);
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
+ bytes, (bytes + 512) / 1024,
+ sndid_str, "RAW PCM", sw->sample->name);
#endif
- }
+
#ifdef HAVE_LIBSNDFILE
if ((enc_info->file) && (!enc_info->encoded))
eina_stringshare_del(enc_info->file);
if (bytes <= 0)
{
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);
gw->errstr = strdup(buf2);
return;
}
-
- if (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n",
- progname, bytes, (bytes + 512) / 1024, buf, gw->pc->part);
+
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry",
+ bytes, (bytes + 512) / 1024, buf, gw->pc->part);
}
static void
gw = calloc(1, sizeof(Group_Write));
if (!gw)
{
- error_and_abort(ef,
- "Error. Cannot allocate memory for group writer\n");
+ error_and_abort(ef, "Cannot allocate memory for group writer");
return;
}
gw->ef = ef;
FILE *f = fdopen(fd, "wb");
if (!f)
error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.\n", filename);
+ "compilation.", filename);
Eina_List *ll;
Code_Program *cp;
if (!f)
{
snprintf(buf, sizeof(buf),
- "Unable to open script object \"%s\" for reading.\n",
+ "Unable to open script object \"%s\" for reading.",
sc->tmpo);
sc->errstr = strdup(buf);
return;
if (fread(dat, size, 1, f) != 1)
{
snprintf(buf, sizeof(buf),
- "Unable to read all of script object \"%s\"\n",
+ "Unable to read all of script object \"%s\"",
sc->tmpo);
sc->errstr = strdup(buf);
return;
else
{
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);
return;
}
if (ecore_exe_data_get(ev->exe) != sc) return ECORE_CALLBACK_RENEW;
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;
}
if (threads)
sc->tmpn_fd = mkstemp(sc->tmpn);
if (sc->tmpn_fd < 0)
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);
sc->tmpo_fd = mkstemp(sc->tmpo);
if (sc->tmpo_fd < 0)
{
unlink(sc->tmpn);
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);
snprintf(buf, sizeof(buf),
break;
}
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);
}
if (!L)
{
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);
return;
}
if (eet_write(sc->ef, buf, dat.buf, dat.size, compress_mode) <= 0)
{
snprintf(buf, sizeof(buf),
- "Unable to write script %i\n", sc->i);
+ "Unable to write script %i", sc->i);
sc->errstr = strdup(buf);
return;
}
if (!edje_file)
{
- ERR("%s: Error. No data to put in \"%s\"",
- progname, file_out);
+ ERR("No data to put in \"%s\"", file_out);
exit(-1);
}
ef = eet_open(file_out, EET_FILE_MODE_WRITE);
if (!ef)
{
- ERR("%s: Error. Unable to open \"%s\" for writing output",
- progname, file_out);
+ ERR("Unable to open \"%s\" for writing output", file_out);
exit(-1);
}
pending_threads++;
t = ecore_time_get();
data_write_header(ef);
- if (verbose)
- {
- printf("header: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+
+ INF("header: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_groups(ef, &collection_num);
- if (verbose)
- {
- printf("groups: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("groups: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_scripts(ef);
- if (verbose)
- {
- printf("scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_lua_scripts(ef);
- if (verbose)
- {
- printf("lua scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("lua scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+
pending_threads++;
if (threads)
ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef);
data_thread_source(ef, NULL);
data_thread_source_end(ef, NULL);
}
- if (verbose)
- {
- printf("source: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("source: %3.5f", ecore_time_get() - t); t = ecore_time_get();
pending_threads++;
if (threads)
ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef);
data_thread_fontmap(ef, NULL);
data_thread_fontmap_end(ef, NULL);
}
- if (verbose)
- {
- printf("fontmap: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_images(ef, &image_num);
- if (verbose)
- {
- printf("images: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_fonts(ef, &font_num);
- if (verbose)
- {
- printf("fonts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_sounds(ef, &sound_num);
- if (verbose)
- {
- printf("sounds: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("sounds: %3.5f", ecore_time_get() - t); t = ecore_time_get();
pending_threads--;
if (pending_threads > 0) ecore_main_loop_begin();
- if (verbose)
- {
- printf("THREADS: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ INF("THREADS: %3.5f", ecore_time_get() - t); t = ecore_time_get();
eet_close(ef);
- if (verbose)
- printf("Summary:\n"
- " Wrote %i collections\n"
- " Wrote %i images\n"
- " Wrote %i sounds\n"
- " Wrote %i fonts\n"
- ,
- collection_num,
- image_num,
- sound_num,
- font_num);
+ if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
+ {
+ printf("Summary:\n"
+ " Wrote %i collections\n"
+ " Wrote %i images\n"
+ " Wrote %i sounds\n"
+ " Wrote %i fonts\n"
+ ,
+ collection_num,
+ image_num,
+ sound_num,
+ font_num);
+ }
}
void
{
ep = (Edje_Part_Parser *)pc->parts[i];
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)
{
{
ep2 = (Edje_Part_Parser *)pc->parts[j];
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)
- 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;
found = EINA_TRUE;
ep2->reorder.linked_prev += ep->reorder.linked_prev + 1;
{
ep2 = (Edje_Part_Parser *)pc->parts[j];
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)
- 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;
found = EINA_TRUE;
ep2->reorder.linked_next += ep->reorder.linked_next + 1;
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|| ((i < k) && ((i + ep->reorder.linked_next) >= k)))
- ERR("%s: Error. The part order is wrong. It has circular dependency.",
- progname);
+ ERR("The part order is wrong. It has circular dependency.");
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
linked = i - ep->reorder.linked_prev;
if (i == part->pc->parts_count)
{
- ERR("%s: Error. Unable to find part name \"%s\" needed in group '%s'.",
- progname, alias, part->pc->part);
+ ERR("Unable to find part name \"%s\" needed in group '%s'.",
+ alias, part->pc->part);
exit(-1);
}
}
if (!find)
{
if (!program->anonymous)
- ERR("%s: Error. Unable to find program name \"%s\".",
- progname, program->u.name);
+ ERR("Unable to find program name \"%s\".",
+ program->u.name);
else
- ERR("%s: Error. Unable to find anonymous program.",
- progname);
+ ERR("Unable to find anonymous program.");
exit(-1);
}
if (!de)
{
- ERR("%s: Error. Unable to find group name \"%s\".",
- progname, group->name);
+ ERR("Unable to find group name \"%s\".", group->name);
exit(-1);
}
if (!find)
{
- ERR("%s: Error. Unable to find image name \"%s\".",
- progname, image->name);
+ ERR("Unable to find image name \"%s\".", image->name);
exit(-1);
}
if (de->entry && eina_hash_find(images_in_use, de->entry))
continue ;
- if (verbose)
- {
- 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);
- }
+ INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
+ de->entry, de->id);
de->entry = NULL;
}
if (set->name && eina_hash_find(images_in_use, set->name))
continue ;
- if (verbose)
- {
- 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);
- }
+ INF("Set '%s' will not be included as it is unused.", set->name);
set->name = NULL;
set->entries = NULL;
n = eina_convert_itoa(cl->val, buf);
if (n > cl->len)
{
- ERR("%s: Error. The unexpected happened. A numeric replacement string was larger than the original!",
- progname);
+ ERR("The unexpected happened. A numeric replacement string was larger than the original!");
exit(-1);
}
memset(cl->ptr, ' ', cl->len);
sh = eina_hash_find(_new_statement_hash, id);
if (!sh)
{
- ERR("%s: Error. %s:%i unhandled keyword %s",
- progname, file_in, line - 1,
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack)));
err_show();
exit(-1);
}
else
{
- ERR("%s: Error. %s:%i unhandled keyword %s",
- progname, file_in, line - 1,
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack)));
err_show();
exit(-1);
tmpstr = alloca(l + 1);
if (!tmpstr)
{
- ERR("%s: Error. %s:%i malloc %i bytes failed",
- progname, file_in, line - 1, l + 1);
+ ERR("%s:%i malloc %i bytes failed",
+ file_in, line - 1, l + 1);
exit(-1);
}
strncpy(tmpstr, p, l);
}
else
{
- ERR("%s: Error. parse error %s:%i. } marker without matching { marker",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. } marker without matching { marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
int delim = 0;
int do_params = 0;
- if (verbose)
- {
- INF("%s: Parsing input file",
- progname);
- }
+ DBG("Parsing input file");
+
p = data;
end = data + size;
line = 1;
*/
if (do_params && delim && *token != ';')
{
- ERR("%s: Error. parse error %s:%i. %c marker before ; marker",
- progname, file_in, line - 1, *token);
+ ERR("parse error %s:%i. %c marker before ; marker",
+ file_in, line - 1, *token);
err_show();
exit(-1);
}
{
if (do_params)
{
- ERR("%s: Error. parse error %s:%i. } marker before ; marker",
- progname, file_in, line - 1);
- err_show();
+ ERR("Parse error %s:%i. } marker before ; marker",
+ file_in, line - 1);
+ err_show();
exit(-1);
}
else
{
if (do_params)
{
- ERR("%s: Error. parse error %s:%i. { marker before ; marker",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. { marker before ; marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
}
else
{
- ERR("%s: Error. parse error %s:%i. { marker does not have matching } marker",
- progname, file_in, line - 1);
+ ERR("Parse error %s:%i. { marker does not have matching } marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
}
}
}
- if (verbose)
- {
- INF("%s: Parsing done",
- progname);
- }
+
+ DBG("Parsing done");
}
static char *clean_file = NULL;
}
else
{
- ERR("Error. Cannot run epp: %s", buf2);
+ ERR("Cannot run epp: %s", buf2);
exit(-1);
}
if (ret == EXIT_SUCCESS)
file_in = tmpn;
else
{
- ERR("Error. Exit code of epp not clean: %i", ret);
+ ERR("Exit code of epp not clean: %i", ret);
exit(-1);
}
free(def);
fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
- ERR("%s: Error. cannot open file \"%s\" for input. %s",
- progname, file_in, strerror(errno));
+ ERR("Cannot open file \"%s\" for input. %s",
+ file_in, strerror(errno));
exit(-1);
}
- if (verbose)
- {
- INF("%s: Opening \"%s\" for input", progname, file_in);
- }
+ DBG("Opening \"%s\" for input", file_in);
size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
parse(data, size);
else
{
- ERR("%s: Error. cannot read file \"%s\". %s",
- progname, file_in, strerror(errno));
+ ERR("Cannot read file \"%s\". %s", file_in, strerror(errno));
exit(-1);
}
free(data);
{
if (!stl->name)
{
- ERR("%s: Error. style must have a name.", progname);
+ ERR("style must have a name.");
exit(-1);
}
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
/* End of the list, nothing matched. */
if (!s)
{
- fprintf(stderr, "%s: Error. %s:%i token %s not one of:",
- progname, file_in, line - 1, str);
+ ERR("%s:%i token %s not one of:", file_in, line - 1, str);
s = va_arg(va2, char *);
while (s)
{
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
i = my_atoi(str);
if ((i < f) || (i > t))
{
- ERR("%s: Error. %s:%i integer %i out of range of %i to %i inclusive",
- progname, file_in, line - 1, i, f, t);
+ ERR("%s:%i integer %i out of range of %i to %i inclusive",
+ file_in, line - 1, i, f, t);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
if (!strstrip(str, buf, sizeof (buf)))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
return 0;
}
i = my_atoi(str);
if ((i < 0) || (i > 1))
{
- ERR("%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive",
- progname, file_in, line - 1, i);
+ ERR("%s:%i integer %i out of range of 0 to 1 inclusive",
+ file_in, line - 1, i);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
i = my_atof(str);
if ((i < f) || (i > t))
{
- ERR("%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
- progname, file_in, line - 1, i, f, t);
+ ERR("%s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
+ file_in, line - 1, i, f, t);
err_show();
exit(-1);
}
if (num_args != required_args)
{
- ERR("%s: Error. %s:%i got %i arguments, but expected %i",
- progname, file_in, line - 1, num_args, required_args);
+ ERR("%s:%i got %i arguments, but expected %i",
+ file_in, line - 1, num_args, required_args);
err_show();
exit(-1);
}
if (num_args < min_required_args)
{
- ERR("%s: Error. %s:%i got %i arguments, "
- "but expected at least %i",
- progname, file_in, line - 1, num_args, min_required_args);
+ ERR("%s:%i got %i arguments, but expected at least %i",
+ file_in, line - 1, num_args, min_required_args);
err_show();
exit(-1);
}
if (!s) return 0;
if (!strstrip(s, buf, sizeof(buf)))
{
- ERR("%s: Error. %s:%i expression is too long\n",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
return 0;
}
_alphai(buf, &res);
if (!val) return NULL;
if ('(' != s[0])
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
return s;
}
else
}
else
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
}
return s;
}
else
{
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);
}
return s;
case '/':
if (0 != b) a /= b;
else
- ERR("%s: Error. %s:%i divide by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i divide by zero", file_in, line - 1);
return a;
case '*':
a *= b;
case '%':
if (0 != b) a = a % b;
else
- ERR("%s: Error. %s:%i modula by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i modula by zero", file_in, line - 1);
return a;
default:
- ERR("%s: Error. %s:%i unexpected character '%c'\n",
- progname, file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
if (!strstrip(s, buf, sizeof (buf)))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long", file_in, line - 1);
return 0;
}
_alphaf(buf, &res);
if (!val) return NULL;
if ('(' != s[0])
{
- ERR("%s: Error. %s:%i unexpected character at %s",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
return s;
}
else
}
else
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
}
return s;
}
else
{
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);
}
return s;
case '/':
if (b != 0) a /= b;
else
- ERR("%s: Error. %s:%i divide by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i divide by zero", file_in, line - 1);
return a;
case '*':
a *= b;
case '%':
if (0 != b) a = (double)((int)a % (int)b);
else
- ERR("%s: Error. %s:%i modula by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i modula by zero", file_in, line - 1);
return a;
default:
- ERR("%s: Error. %s:%i unexpected character '%c'\n",
- progname, file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
{
if ((size -1 ) < strlen(in))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long", file_in, line - 1);
return 0;
}
/* remove spaces and tabs */
f = fopen(fil, "rb");
if (!f)
{
- ERR("%s: Warning. Cannot open file '%s'",
- progname, fil);
+ ERR("Cannot open file '%s'", fil);
exit(-1);
}
tmp = fread(sf->file, sz, 1, f);
if (tmp != 1)
{
- ERR("%s: Warning file length for (%s) doesn't match !",
- progname, filname);
+ ERR("file length for (%s) doesn't match!", filname);
exit(-1);
}
}
/* Change structure layout */
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;
EINA_LIST_FREE(oedc->programs, pg)
edc->parts_count = eina_list_count(oedc->parts);
edc->parts = calloc(edc->parts_count, sizeof (Edje_Part *));
if (edc->parts_count && !edc->parts)
- error_and_abort(ef, "Not enough memory\n");
+ error_and_abort(ef, "Not enough memory");
k = 0;
EINA_LIST_FREE(oedc->parts, part)
replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part));
if (!replacement)
- error_and_abort(ef, "Not enough memory\n");
+ error_and_abort(ef, "Not enough memory");
replacement->name = part->name;
replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
{
va_list ap;
- fprintf(stderr, "%s: Error. ", progname);
-
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);
eet_close(ef);
exit(-1);
#include "edje_decc.h"
int _edje_cc_log_dom = -1;
-char *progname = NULL;
+static char *progname = NULL;
char *file_in = NULL;
char *file_out = NULL;
int compress_mode = EET_COMPRESSION_DEFAULT;
static int compiler_cmd_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
main_help(void)
{
" -main-out\tCreate a symbolic link to the main edc \n"
" -no-build-sh\tDon't output build.sh \n"
" -current-dir\tOutput to current directory \n"
+ " -quiet\t\tProduce less output\n"
"\n"
,progname);
}
eina_shutdown();
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++)
{
if (!strcmp(argv[i], "-h"))
build_sh = 0;
else if (!strcmp(argv[i], "-current-dir"))
new_dir = 0;
+ else if (!strcmp(argv[i], "-quiet"))
+ eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN);
}
if (!file_in)
{
if (!decomp()) return -1;
output();
- fprintf(stderr, "WARNING! If any Image or audio data was encoded in a LOSSY way, then\n"
- "re-encoding will drop quality even more. You need access to the original\n"
- "data to ensure no loss of quality.\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 data to ensure no loss of quality.");
eet_close(ef);
edje_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom);
ef = eet_open(file_in, EET_FILE_MODE_READ);
if (!ef)
{
- ERR("ERROR: cannot open %s", file_in);
+ ERR("cannot open %s", file_in);
return 0;
}
srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list)
{
- ERR("ERROR: %s has no decompile information", file_in);
+ ERR("%s has no decompile information", file_in);
eet_close(ef);
return 0;
}
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);
return 0;
}
edje_file = eet_data_read(ef, _edje_edd_edje_file, "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);
return 0;
}
}
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);
return 0;
}
snprintf(buf, sizeof(buf), "edje/images/%i", ei->id);
evas_object_image_file_set(im, file_in, buf);
snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
- printf("Output Image: %s\n", out);
+ INF("Output Image: %s", out);
pp = strdup(out);
p = strrchr(pp, '/');
*p = 0;
char *pp;
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);
p = strrchr(pp, '/');
*p = 0;
if (build_sh)
{
snprintf(out, sizeof(out), "%s/build.sh", outdir);
- printf("Output Build Script: %s\n", out);
+ INF("Output Build Script: %s", 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);
}
f = fopen(out, "wb");
fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir);
fclose(f);
- WRN("\n*** CAUTION ***\n"
+ WRN("*** CAUTION ***\n"
"Please check the build script for anything malicious "
"before running it!\n\n");
}
snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
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);
}
}
/* logging variables */
extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+
#ifdef ERR
# undef ERR
#endif
# undef WRN
#endif
#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 */
typedef struct _Font Font;
enc_info = calloc(1, sizeof(Edje_Sound_Encode));
if (!enc_info)
{
- ERR("Error. while allocating memory to load file ");
+ ERR("while allocating memory to load file ");
exit(-1);
}
memset (&sfinfo, 0, sizeof (SF_INFO));
sfile = sf_open (filename, SFM_READ, &sfinfo);
if (!sfile)
{
- ERR("Error. Unable to open audio file : %s", filename);
+ ERR("Unable to open audio file: %s", filename);
exit(-1);
}
if (!sf_format_check(&sfinfo))
{
- ERR("Error. Unknown file, not a valid audio file");
+ ERR("Unknown file, not a valid audio file");
exit(-1);
}