* edje: Use Eina_Log.

Patch from Mathieu Taillefumier.


SVN revision: 44655
This commit is contained in:
Cedric BAIL 2009-12-22 13:46:00 +00:00
parent bd60dfd40e
commit 018a9dad66
24 changed files with 508 additions and 449 deletions

View File

@ -3,3 +3,4 @@ Tilman Sauerbeck (tilman at code-monkey de)
ZigsMcKenzie <zigsmckenzie@gmail.com>
Cedric BAIL <cedric.bail@free.fr>
Brian Mattern <rephorm@rephorm.com>
Mathieu Taillefumier <mathieu.taillefumier@free.fr>

View File

@ -13,7 +13,7 @@
#include "edje_cc.h"
#include "edje_prefix.h"
int _edje_cc_log_dom = -1;
static void main_help(void);
Eina_List *img_dirs = NULL;
@ -63,7 +63,12 @@ main(int argc, char **argv)
setlocale(LC_NUMERIC, "C");
eina_init();
_edje_cc_log_dom = eina_log_domain_register("EDJE_CC", EDJE_DEFAULT_LOG_COLOR);
if(_edje_cc_log_dom<0)
{
EINA_LOG_ERR("Enable to create a log domain.");
exit(1);
}
tmp_dir = getenv("TMPDIR");
@ -210,7 +215,7 @@ main(int argc, char **argv)
data_write();
edje_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom);
eina_shutdown();
return 0;

View File

@ -12,6 +12,23 @@
# define O_BINARY 0
#endif
/* logging variables */
extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
/* types */
typedef struct _New_Object_Handler New_Object_Handler;
typedef struct _New_Statement_Handler New_Statement_Handler;

View File

@ -928,14 +928,14 @@ st_data_file(void)
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
fprintf(stderr, "%s: Error. %s:%i when opening file \"%s\": \"%s\"\n",
ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno));
exit(-1);
}
if (fstat(fd, &buf))
{
fprintf(stderr, "%s: Error. %s:%i when stating file \"%s\": \"%s\"\n",
ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno));
exit(-1);
}
@ -943,7 +943,7 @@ st_data_file(void)
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED)
{
fprintf(stderr, "%s: Error. %s:%i when mapping file \"%s\": \"%s\"\n",
ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"",
progname, file_in, line, filename, strerror(errno));
exit(-1);
}
@ -952,7 +952,7 @@ st_data_file(void)
for (i = 0; i < buf.st_size; ++i, ++over)
if (*over == '\0')
{
fprintf(stderr, "%s: Error. %s:%i file \"%s\" is a binary file.\n",
ERR("%s: Error. %s:%i file \"%s\" is a binary file.",
progname, file_in, line, filename);
exit(-1);
}
@ -1251,7 +1251,7 @@ st_styles_style_name(void)
{
if ((stl != tstl) && (!strcmp(stl->name, tstl->name)))
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a style named \"%s\"\n",
ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"",
progname, file_in, line - 1, stl->name);
exit(-1);
}
@ -1278,7 +1278,7 @@ st_styles_style_base(void)
stl = eina_list_data_get(eina_list_last(edje_file->styles));
if (stl->tags)
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a basic format for the style\n",
ERR("%s: Error. parse error %s:%i. There is already a basic format for the style",
progname, file_in, line - 1);
exit(-1);
}
@ -1596,7 +1596,7 @@ ob_collections_group_script(void)
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already an existing script section for the group\n",
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
progname, file_in, line - 1);
exit(-1);
}
@ -1628,7 +1628,7 @@ ob_collections_group_lua_script(void)
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already an existing script section for the group\n",
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
progname, file_in, line - 1);
exit(-1);
}
@ -1742,7 +1742,7 @@ st_collections_group_parts_part_name(void)
{
if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a part of the name %s\n",
ERR("%s: Error. parse error %s:%i. There is already a part of the name %s",
progname, file_in, line - 1, ep->name);
exit(-1);
}
@ -2505,8 +2505,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))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"box attributes in non-BOX or TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"box attributes in non-BOX or TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -2569,8 +2569,8 @@ static void st_collections_group_parts_part_box_items_item_type(void)
s = parse_str(0);
if (strcmp(s, "GROUP"))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"token %s not one of: GROUP.\n",
ERR("%s: Error. parse error %s:%i. "
"token %s not one of: GROUP.",
progname, file_in, line - 1, s);
exit(-1);
}
@ -2892,8 +2892,8 @@ static void st_collections_group_parts_part_table_items_item_position(void)
if (ep->type != EDJE_PART_TYPE_TABLE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -2927,8 +2927,8 @@ static void st_collections_group_parts_part_table_items_item_span(void)
if (ep->type != EDJE_PART_TYPE_TABLE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -3088,8 +3088,8 @@ st_collections_group_parts_part_description_inherit(void)
/* inherit may not be used in the default description */
if (!ep->other_desc)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"inherit may not be used in the default description\n",
ERR("%s: Error. parse error %s:%i. "
"inherit may not be used in the default description",
progname, file_in, line - 1);
exit(-1);
}
@ -3098,8 +3098,8 @@ st_collections_group_parts_part_description_inherit(void)
if (!ed->state.name)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"inherit may only be used after state\n",
ERR("%s: Error. parse error %s:%i. "
"inherit may only be used after state",
progname, file_in, line - 1);
exit(-1);
}
@ -3139,8 +3139,8 @@ st_collections_group_parts_part_description_inherit(void)
if (!parent)
{
fprintf (stderr, "%s: Error. parse error %s:%i. "
"cannot find referenced part state %s %lf\n",
ERR("%s: Error. parse error %s:%i. "
"cannot find referenced part state %s %lf",
ep->name, file_in, line - 1, parent_name, parent_val);
exit(-1);
}
@ -3235,8 +3235,8 @@ st_collections_group_parts_part_description_state(void)
s = parse_str(0);
if (!strcmp (s, "custom"))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"invalid state name: '%s'.\n",
ERR("%s: Error. parse error %s:%i. "
"invalid state name: '%s'.",
progname, file_in, line - 1, s);
exit(-1);
}
@ -3914,8 +3914,8 @@ st_collections_group_parts_part_description_image_normal(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -3957,8 +3957,8 @@ st_collections_group_parts_part_description_image_tween(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4003,8 +4003,8 @@ st_collections_group_parts_part_description_image_border(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4043,8 +4043,8 @@ st_collections_group_parts_part_description_image_middle(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4085,8 +4085,8 @@ st_collections_group_parts_part_description_image_scale_hint(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"image attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4149,8 +4149,8 @@ st_collections_group_parts_part_description_fill_smooth(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill.type attribute in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill.type attribute in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4224,8 +4224,8 @@ st_collections_group_parts_part_description_fill_angle(void)
/* XXX this will need to include IMAGES when angle support is added to evas images */
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4262,8 +4262,8 @@ st_collections_group_parts_part_description_fill_type(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4319,8 +4319,8 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4355,8 +4355,8 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4416,8 +4416,8 @@ st_collections_group_parts_part_description_fill_size_relative(void)
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4452,8 +4452,8 @@ st_collections_group_parts_part_description_fill_size_offset(void)
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.\n",
ERR("%s: Error. parse error %s:%i. "
"fill attributes in non-IMAGE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4515,8 +4515,8 @@ st_collections_group_parts_part_description_text_text(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4567,8 +4567,8 @@ st_collections_group_parts_part_description_text_text_class(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4604,8 +4604,8 @@ st_collections_group_parts_part_description_text_font(void)
if (ep->type != EDJE_PART_TYPE_TEXT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4641,8 +4641,8 @@ st_collections_group_parts_part_description_text_style(void)
if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXTBLOCK part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXTBLOCK part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4679,8 +4679,8 @@ st_collections_group_parts_part_description_text_repch(void)
if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXTBLOCK part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXTBLOCK part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4716,8 +4716,8 @@ st_collections_group_parts_part_description_text_size(void)
if (ep->type != EDJE_PART_TYPE_TEXT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4753,8 +4753,8 @@ st_collections_group_parts_part_description_text_fit(void)
if (ep->type != EDJE_PART_TYPE_TEXT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4793,8 +4793,8 @@ st_collections_group_parts_part_description_text_min(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4833,8 +4833,8 @@ st_collections_group_parts_part_description_text_max(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4871,8 +4871,8 @@ st_collections_group_parts_part_description_text_align(void)
if (ep->type != EDJE_PART_TYPE_TEXT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4910,8 +4910,8 @@ st_collections_group_parts_part_description_text_source(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4954,8 +4954,8 @@ st_collections_group_parts_part_description_text_text_source(void)
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -4998,8 +4998,8 @@ st_collections_group_parts_part_description_text_elipsis(void)
if (ep->type != EDJE_PART_TYPE_TEXT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.\n",
ERR("%s: Error. parse error %s:%i. "
"text attributes in non-TEXT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5068,8 +5068,8 @@ st_collections_group_parts_part_description_gradient_type(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5105,8 +5105,8 @@ st_collections_group_parts_part_description_gradient_spectrum(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5150,8 +5150,8 @@ st_collections_group_parts_part_description_gradient_rel1_relative(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5193,8 +5193,8 @@ st_collections_group_parts_part_description_gradient_rel1_offset(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5223,8 +5223,8 @@ st_collections_group_parts_part_description_gradient_rel2_relative(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5253,8 +5253,8 @@ st_collections_group_parts_part_description_gradient_rel2_offset(void)
if (ep->type != EDJE_PART_TYPE_GRADIENT)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.\n",
ERR("%s: Error. parse error %s:%i. "
"gradient attributes in non-GRADIENT part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5354,8 +5354,8 @@ static void st_collections_group_parts_part_description_box_layout(void)
if (ep->type != EDJE_PART_TYPE_BOX)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.\n",
ERR("%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5380,8 +5380,8 @@ static void st_collections_group_parts_part_description_box_align(void)
if (ep->type != EDJE_PART_TYPE_BOX)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.\n",
ERR("%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5405,8 +5405,8 @@ static void st_collections_group_parts_part_description_box_padding(void)
if (ep->type != EDJE_PART_TYPE_BOX)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.\n",
ERR("%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5431,8 +5431,8 @@ st_collections_group_parts_part_description_box_min(void)
if (ep->type != EDJE_PART_TYPE_BOX)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.\n",
ERR("%s: Error. parse error %s:%i. "
"box attributes in non-BOX part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5507,8 +5507,8 @@ static void st_collections_group_parts_part_description_table_homogeneous(void)
if (ep->type != EDJE_PART_TYPE_TABLE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5535,8 +5535,8 @@ static void st_collections_group_parts_part_description_table_align(void)
if (ep->type != EDJE_PART_TYPE_TABLE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5560,8 +5560,8 @@ static void st_collections_group_parts_part_description_table_padding(void)
if (ep->type != EDJE_PART_TYPE_TABLE)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.\n",
ERR("%s: Error. parse error %s:%i. "
"table attributes in non-TABLE part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5590,8 +5590,8 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
if (ep->type != EDJE_PART_TYPE_EXTERNAL)
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"params in non-EXTERNAL part.\n",
ERR("%s: Error. parse error %s:%i. "
"params in non-EXTERNAL part.",
progname, file_in, line - 1);
exit(-1);
}
@ -5759,7 +5759,7 @@ st_collections_group_programs_program_name(void)
{
if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
{
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a program of the name %s\n",
ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n",
progname, file_in, line - 1, ep->name);
exit(-1);
}
@ -6002,8 +6002,8 @@ st_collections_group_programs_program_target(void)
data_queue_part_lookup(pc, name, &(et->id));
else
{
fprintf(stderr, "%s: Error. parse error %s:%i. "
"target may only be used after action\n",
ERR("%s: Error. parse error %s:%i. "
"target may only be used after action",
progname, file_in, line - 1);
exit(-1);
}
@ -6076,7 +6076,7 @@ ob_collections_group_programs_program_script(void)
cp->script = s;
if (cd->shared && cd->is_lua)
{
fprintf(stderr, "%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group\n",
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);
exit(-1);
}
@ -6116,7 +6116,7 @@ ob_collections_group_programs_program_lua_script(void)
cp->script = s;
if (cd->shared && !cd->is_lua)
{
fprintf(stderr, "%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group\n",
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);
exit(-1);
}

View File

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

View File

@ -133,7 +133,7 @@ error_and_abort(Eet_File *ef, const char *fmt, ...)
{
va_list ap;
fprintf(stderr, "%s: Error. ", progname);
ERR("%s: Error. ", progname);
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
@ -979,7 +979,7 @@ data_write(void)
ef = eet_open(file_out, EET_FILE_MODE_WRITE);
if (!ef)
{
fprintf(stderr, "%s: Error. Unable to open \"%s\" for writing output\n",
ERR("%s: Error. Unable to open \"%s\" for writing output",
progname, file_out);
exit(-1);
}
@ -1169,7 +1169,7 @@ data_process_lookups(void)
}
if (!l)
{
fprintf(stderr, "%s: Error. Unable to find part name \"%s\".\n",
ERR("%s: Error. Unable to find part name \"%s\".",
progname, pl->name);
exit(-1);
}
@ -1195,7 +1195,7 @@ data_process_lookups(void)
}
if (!l)
{
fprintf(stderr, "%s: Error. Unable to find program name \"%s\".\n",
ERR("%s: Error. Unable to find program name \"%s\".",
progname, pl->name);
exit(-1);
}
@ -1220,7 +1220,7 @@ data_process_lookups(void)
}
if (!l)
{
fprintf(stderr, "%s: Error. Unable to find group name \"%s\".\n",
ERR("%s: Error. Unable to find group name \"%s\".",
progname, gl->name);
exit(-1);
}
@ -1256,7 +1256,7 @@ data_process_lookups(void)
if (!l)
{
fprintf(stderr, "%s: Error. Unable to find image name \"%s\".\n",
ERR("%s: Error. Unable to find image name \"%s\".",
progname, il->name);
exit(-1);
}
@ -1290,7 +1290,7 @@ data_process_lookups(void)
if (!l)
{
fprintf(stderr, "%s: Error. unable to find spectrum name %s\n",
ERR("%s: Error. unable to find spectrum name %s",
progname, il->name);
exit(-1);
}
@ -1525,7 +1525,7 @@ data_process_script_lookups(void)
n = eina_convert_itoa(cl->val, buf);
if (n > cl->len)
{
fprintf(stderr, "%s: Error. The unexpected happened. A numeric replacement string was larger than the original!\n",
ERR("%s: Error. The unexpected happened. A numeric replacement string was larger than the original!",
progname);
exit(-1);
}

View File

@ -114,7 +114,7 @@ new_object(void)
}
if (!handled)
{
fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
ERR("%s: Error. %s:%i unhandled keyword %s",
progname, file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack)));
exit(-1);
@ -144,7 +144,7 @@ new_statement(void)
}
if (!handled)
{
fprintf(stderr, "%s: Error. %s:%i unhandled keyword %s\n",
ERR("%s: Error. %s:%i unhandled keyword %s",
progname, file_in, line - 1,
(char *)eina_list_data_get(eina_list_last(stack)));
exit(-1);
@ -247,7 +247,7 @@ next_token(char *p, char *end, char **new_p, int *delim)
tmpstr = alloca(l + 1);
if (!tmpstr)
{
fprintf(stderr, "%s: Error. %s:%i malloc %i bytes failed\n",
ERR("%s: Error. %s:%i malloc %i bytes failed",
progname, file_in, line - 1, l + 1);
exit(-1);
}
@ -424,7 +424,7 @@ stack_chop_top(void)
}
else
{
fprintf(stderr, "%s: Error. parse error %s:%i. } marker without matching { marker\n",
ERR("%s: Error. parse error %s:%i. } marker without matching { marker",
progname, file_in, line - 1);
exit(-1);
}
@ -439,7 +439,7 @@ parse(char *data, off_t size)
if (verbose)
{
printf("%s: Parsing input file\n",
INF("%s: Parsing input file",
progname);
}
p = data;
@ -452,7 +452,7 @@ parse(char *data, off_t size)
*/
if (do_params && delim && *token != ';')
{
fprintf(stderr, "%s: Error. parse error %s:%i. %c marker before ; marker\n",
ERR("%s: Error. parse error %s:%i. %c marker before ; marker",
progname, file_in, line - 1, *token);
exit(-1);
}
@ -463,7 +463,7 @@ parse(char *data, off_t size)
{
if (do_params)
{
fprintf(stderr, "%s: Error. parse error %s:%i. } marker before ; marker\n",
ERR("%s: Error. parse error %s:%i. } marker before ; marker",
progname, file_in, line - 1);
exit(-1);
}
@ -490,7 +490,7 @@ parse(char *data, off_t size)
{
if (do_params)
{
fprintf(stderr, "%s: Error. parse error %s:%i. { marker before ; marker\n",
ERR("%s: Error. parse error %s:%i. { marker before ; marker",
progname, file_in, line - 1);
exit(-1);
}
@ -573,7 +573,7 @@ parse(char *data, off_t size)
}
else
{
fprintf(stderr, "%s: Error. parse error %s:%i. { marker does not have matching } marker\n",
ERR("%s: Error. parse error %s:%i. { marker does not have matching } marker",
progname, file_in, line - 1);
exit(-1);
}
@ -585,7 +585,7 @@ parse(char *data, off_t size)
}
if (verbose)
{
printf("%s: Parsing done\n",
INF("%s: Parsing done",
progname);
}
}
@ -766,13 +766,13 @@ compile(void)
fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
fprintf(stderr, "%s: Error. cannot open file \"%s\" for input. %s\n",
ERR("%s: Error. cannot open file \"%s\" for input. %s",
progname, file_in, strerror(errno));
exit(-1);
}
if (verbose)
{
printf("%s: Opening \"%s\" for input\n",
INF("%s: Opening \"%s\" for input",
progname, file_in);
}
@ -783,7 +783,7 @@ compile(void)
parse(data, size);
else
{
fprintf(stderr, "%s: Error. cannot read file \"%s\". %s\n",
ERR("%s: Error. cannot read file \"%s\". %s",
progname, file_in, strerror(errno));
exit(-1);
}
@ -811,7 +811,7 @@ is_num(int n)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
@ -831,7 +831,7 @@ parse_str(int n)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
@ -894,7 +894,7 @@ parse_enum(int n, ...)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
@ -931,7 +931,7 @@ parse_int(int n)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
@ -948,14 +948,14 @@ parse_int_range(int n, int f, int t)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
i = my_atoi(str);
if ((i < f) || (i > t))
{
fprintf(stderr, "%s: Error. %s:%i integer %i out of range of %i to %i inclusive\n",
ERR("%s: Error. %s:%i integer %i out of range of %i to %i inclusive",
progname, file_in, line - 1, i, f, t);
exit(-1);
}
@ -971,14 +971,14 @@ parse_bool(int n)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
if (!strstrip(str, buf, sizeof (buf)))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
ERR("%s: Error. %s:%i expression is too long",
progname, file_in, line - 1);
return 0;
}
@ -991,7 +991,7 @@ parse_bool(int n)
i = my_atoi(str);
if ((i < 0) || (i > 1))
{
fprintf(stderr, "%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive\n",
ERR("%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive",
progname, file_in, line - 1, i);
exit(-1);
}
@ -1007,7 +1007,7 @@ parse_float(int n)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
@ -1024,14 +1024,14 @@ parse_float_range(int n, double f, double t)
str = eina_list_nth(params, n);
if (!str)
{
fprintf(stderr, "%s: Error. %s:%i no parameter supplied as argument %i\n",
ERR("%s: Error. %s:%i no parameter supplied as argument %i",
progname, file_in, line - 1, n + 1);
exit(-1);
}
i = my_atof(str);
if ((i < f) || (i > t))
{
fprintf(stderr, "%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f inclusive\n",
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);
exit(-1);
}
@ -1045,7 +1045,7 @@ check_arg_count(int required_args)
if (num_args != required_args)
{
fprintf(stderr, "%s: Error. %s:%i got %i arguments, but expected %i\n",
ERR("%s: Error. %s:%i got %i arguments, but expected %i",
progname, file_in, line - 1, num_args, required_args);
exit(-1);
}
@ -1058,8 +1058,8 @@ check_min_arg_count(int min_required_args)
if (num_args < min_required_args)
{
fprintf(stderr, "%s: Error. %s:%i got %i arguments, "
"but expected at least %i\n",
ERR("%s: Error. %s:%i got %i arguments, "
"but expected at least %i",
progname, file_in, line - 1, num_args, min_required_args);
exit(-1);
}
@ -1086,7 +1086,7 @@ my_atoi(const char *s)
if (!s) return 0;
if (!strstrip(s, buf, sizeof(buf)))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
ERR("%s: Error. %s:%i expression is too long\n",
progname, file_in, line - 1);
return 0;
}
@ -1100,7 +1100,7 @@ _deltai(char *s, int *val)
if (!val) return NULL;
if ('(' != s[0])
{
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
ERR("%s: Error. %s:%i unexpected character at %s\n",
progname, file_in, line - 1, s);
return s;
}
@ -1131,7 +1131,7 @@ _funci(char *s, int *val)
}
else
{
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
ERR("%s: Error. %s:%i unexpected character at %s\n",
progname, file_in, line - 1, s);
}
return s;
@ -1154,7 +1154,7 @@ _gammai(char *s, int *val)
else
{
s = _funci(s, val);
// fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
// ERR("%s: Error. %s:%i unexpected character at %s\n",
// progname, file_in, line - 1, s);
}
return s;
@ -1264,7 +1264,7 @@ _calci(char op, int a, int b)
case '/':
if (0 != b) a /= b;
else
fprintf(stderr, "%s: Error. %s:%i divide by zero\n",
ERR("%s: Error. %s:%i divide by zero\n",
progname, file_in, line - 1);
return a;
case '*':
@ -1273,11 +1273,11 @@ _calci(char op, int a, int b)
case '%':
if (0 != b) a = a % b;
else
fprintf(stderr, "%s: Error. %s:%i modula by zero\n",
ERR("%s: Error. %s:%i modula by zero\n",
progname, file_in, line - 1);
return a;
default:
fprintf(stderr, "%s: Error. %s:%i unexpected character '%c'\n",
ERR("%s: Error. %s:%i unexpected character '%c'\n",
progname, file_in, line - 1, op);
return a;
}
@ -1295,7 +1295,7 @@ my_atof(const char *s)
if (!strstrip(s, buf, sizeof (buf)))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
ERR("%s: Error. %s:%i expression is too long",
progname, file_in, line - 1);
return 0;
}
@ -1309,7 +1309,7 @@ _deltaf(char *s, double *val)
if (!val) return NULL;
if ('(' != s[0])
{
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
ERR("%s: Error. %s:%i unexpected character at %s",
progname, file_in, line - 1, s);
return s;
}
@ -1340,7 +1340,7 @@ _funcf(char *s, double *val)
}
else
{
fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
ERR("%s: Error. %s:%i unexpected character at %s\n",
progname, file_in, line - 1, s);
}
return s;
@ -1364,7 +1364,7 @@ _gammaf(char *s, double *val)
else
{
s = _funcf(s, val);
// fprintf(stderr, "%s: Error. %s:%i unexpected character at %s\n",
// ERR("%s: Error. %s:%i unexpected character at %s\n",
// progname, file_in, line - 1, s);
}
return s;
@ -1479,7 +1479,7 @@ _calcf(char op, double a, double b)
case '/':
if (b != 0) a /= b;
else
fprintf(stderr, "%s: Error. %s:%i divide by zero\n",
ERR("%s: Error. %s:%i divide by zero\n",
progname, file_in, line - 1);
return a;
case '*':
@ -1488,11 +1488,11 @@ _calcf(char op, double a, double b)
case '%':
if (0 != b) a = (double)((int)a % (int)b);
else
fprintf(stderr, "%s: Error. %s:%i modula by zero\n",
ERR("%s: Error. %s:%i modula by zero\n",
progname, file_in, line - 1);
return a;
default:
fprintf(stderr, "%s: Error. %s:%i unexpected character '%c'\n",
ERR("%s: Error. %s:%i unexpected character '%c'\n",
progname, file_in, line - 1, op);
return a;
}
@ -1503,7 +1503,7 @@ strstrip(const char *in, char *out, size_t size)
{
if ((size -1 ) < strlen(in))
{
fprintf(stderr, "%s: Error. %s:%i expression is too long\n",
ERR("%s: Error. %s:%i expression is too long",
progname, file_in, line - 1);
return 0;
}

View File

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

View File

@ -21,6 +21,7 @@
#include "edje_decc.h"
int _edje_cc_log_dom = -1;
char *progname = NULL;
char *file_in = NULL;
char *file_out = NULL;
@ -57,7 +58,15 @@ main(int argc, char **argv)
int i;
setlocale(LC_NUMERIC, "C");
eina_init();
_edje_cc_log_dom = eina_log_domain_register("edje_decc", EDJE_CC_DEFAULT_LOG_COLOR);
if(_edje_cc_log_dom < 0)
{
EINA_LOG_ERR("Edje_decc: Impossible to create a log domain for edje_decc");
eina_shutdown();
exit(-1);
}
eina_log_level_set(EINA_LOG_LEVEL_INFO);
progname = argv[0];
for (i = 1; i < argc; i++)
{
@ -75,7 +84,7 @@ main(int argc, char **argv)
}
if (!file_in)
{
fprintf(stderr, "%s: Error: no input file specified.\n", progname);
ERR("%s: Error: no input file specified.", progname);
main_help();
exit(-1);
}
@ -89,6 +98,9 @@ main(int argc, char **argv)
eet_close(ef);
eet_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom);
_edje_cc_log_dom = -1;
eina_shutdown();
return 0;
}
@ -98,27 +110,27 @@ decomp(void)
ef = eet_open(file_in, EET_FILE_MODE_READ);
if (!ef)
{
printf("ERROR: cannot open %s\n", file_in);
ERR("ERROR: cannot open %s", file_in);
return 0;
}
srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list)
{
printf("ERROR: %s has no decompile information\n", file_in);
ERR("ERROR: %s has no decompile information", file_in);
eet_close(ef);
return 0;
}
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
{
printf("ERROR: Invalid root filename: '%s'\n", (char *) eina_list_data_get(srcfiles->list));
ERR("ERROR: 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)
{
printf("ERROR: %s does not appear to be an edje file\n", file_in);
ERR("ERROR: %s does not appear to be an edje file", file_in);
eet_close(ef);
return 0;
}
@ -128,7 +140,7 @@ decomp(void)
}
else if (!compiler_cmd_is_sane())
{
printf("ERROR: invalid compiler executable: '%s'\n", edje_file->compiler);
ERR("ERROR: invalid compiler executable: '%s'", edje_file->compiler);
eet_close(ef);
return 0;
}
@ -184,14 +196,14 @@ output(void)
ee = ecore_evas_buffer_new(1, 1);
if (!ee)
{
fprintf(stderr, "Error. cannot create buffer engine canvas for image save.\n");
ERR("Cannot create buffer engine canvas for image save.");
exit(-1);
}
evas = ecore_evas_get(ee);
im = evas_object_image_add(evas);
if (!im)
{
fprintf(stderr, "Error. cannot create image object for save.\n");
ERR("Cannot create image object for save.");
exit(-1);
}
snprintf(buf, sizeof(buf), "images/%i", ei->id);
@ -203,14 +215,14 @@ output(void)
*p = 0;
if (strstr(pp, "../"))
{
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
ERR("Potential security violation. attempt to write in parent dir.");
exit(-1);
}
ecore_file_mkpath(pp);
free(pp);
if (!evas_object_image_save(im, out, NULL, "quality=100 compress=9"))
{
printf("ERROR: cannot write file %s. Perhaps missing JPEG or PNG saver modules for Evas.\n", out);
ERR("Cannot write file %s. Perhaps missing JPEG or PNG saver modules for Evas.", out);
exit(-1);
}
evas_object_del(im);
@ -228,26 +240,26 @@ output(void)
char *pp;
snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
printf("Output Source File: %s\n", out);
INF("Output Source File: %s\n", out);
pp = strdup(out);
p = strrchr(pp, '/');
*p = 0;
if (strstr(pp, "../"))
{
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
ERR("Potential security violation. attempt to write in parent dir.");
exit (-1);
}
ecore_file_mkpath(pp);
free(pp);
if (strstr(out, "../"))
{
printf("ERROR: 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");
if (!f)
{
printf("ERROR: unable to write file (%s).\n", out);
ERR("Unable to write file (%s).", out);
exit (-1);
}
@ -275,20 +287,20 @@ output(void)
char *pp;
snprintf(out, sizeof(out), "%s/%s", outdir, fn->file);
printf("Output Font: %s\n", out);
INF("Output Font: %s", out);
pp = strdup(out);
p = strrchr(pp, '/');
*p = 0;
if (strstr(pp, "../"))
{
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
ERR("Potential security violation. attempt to write in parent dir.");
exit (-1);
}
ecore_file_mkpath(pp);
free(pp);
if (strstr(out, "../"))
{
printf("ERROR: 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");
@ -310,7 +322,7 @@ output(void)
printf("Output Build Script: %s\n", out);
if (strstr(out, "../"))
{
printf("ERROR: potential security violation. attempt to write in parent dir.\n");
ERR("potential security violation. attempt to write in parent dir.\n");
exit (-1);
}
f = fopen(out, "wb");
@ -318,7 +330,7 @@ output(void)
fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir);
fclose(f);
printf("\n*** CAUTION ***\n"
WRN("\n*** CAUTION ***\n"
"Please check the build script for anything malicious "
"before running it!\n\n");
}
@ -328,7 +340,7 @@ output(void)
snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
if (symlink(sf->name, out) != 0)
{
printf("ERROR: symlink %s -> %s failed\n", sf->name, out);
ERR("symlink %s -> %s failed\n", sf->name, out);
}
}

View File

@ -3,6 +3,22 @@
#include <edje_private.h>
/* logging variables */
extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_edje_cc_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_edje_cc_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
/* types */
typedef struct _Font Font;
typedef struct _Font_List Font_List;

View File

@ -26,7 +26,7 @@
#endif
#include "edje_prefix.h"
#include "edje_cc.h"
#ifdef _WIN32
# define EDJE_DIR_SEPARATOR '\\'
# define EDJE_DIR_SEPARATOR_S "\\"
@ -301,7 +301,7 @@ _e_prefix_fallbacks(void)
_prefix_path_bin = strdup(PACKAGE_BIN_DIR);
_prefix_path_data = strdup(PACKAGE_DATA_DIR);
_prefix_path_lib = strdup(PACKAGE_LIB_DIR);
printf("WARNING: Edje could not determine its installed prefix\n"
WRN("WARNING: Edje could not determine its installed prefix\n"
" and is falling back on the compiled in default:\n"
" %s\n"
" You might like to try setting the following environment variables:\n"
@ -311,8 +311,7 @@ _e_prefix_fallbacks(void)
" EDJE_LIB_DIR - optional in addition to E_PREFIX to provide\n"
" a more specific library dir\n"
" EDJE_DATA_DIR- optional in addition to E_PREFIX to provide\n"
" a more specific location for shared data\n"
,
" a more specific location for shared data",
_prefix_path);
return 1;
}

View File

@ -105,12 +105,12 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
if ((err_code = luaL_loadbuffer(edc->L, data, size, "edje_lua_script")))
{
if (err_code == LUA_ERRSYNTAX)
printf("lua load syntax error: %s\n", lua_tostring(edc->L, -1));
ERR("lua load syntax error: %s", lua_tostring(edc->L, -1));
else if (err_code == LUA_ERRMEM)
printf("lua load memory allocation error: %s\n", lua_tostring(edc->L, -1));
ERR("lua load memory allocation error: %s", lua_tostring(edc->L, -1));
}
if (lua_pcall(edc->L, 0, 0, 0))
printf("lua call error: %s\n", lua_tostring(edc->L, -1));
ERR("lua call error: %s", lua_tostring(edc->L, -1));
free(data);
}
@ -315,7 +315,7 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
ep2 = eina_list_nth(edc->parts, ep2->dragable.confine_id);
if (eina_list_data_find(hist, ep2))
{
printf("EDJE ERROR: confine_to loops. invalidating loop.\n");
ERR("confine_to loops. invalidating loop.");
ep2->dragable.confine_id = -1;
break;
}
@ -340,7 +340,7 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
if (eina_list_data_find(hist, ep2))
{
printf("EDJE ERROR: events_to loops. invalidating loop.\n");
ERR("events_to loops. invalidating loop.");
ep2->dragable.events_id = -1;
break;
}
@ -355,7 +355,7 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
ep2 = eina_list_nth(edc->parts, ep2->clip_to_id);
if (eina_list_data_find(hist, ep2))
{
printf("EDJE ERROR: clip_to loops. invalidating loop.\n");
ERR("clip_to loops. invalidating loop.");
ep2->clip_to_id = -1;
break;
}

View File

@ -1452,7 +1452,7 @@ _edje_box_recalc_apply(Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params
if ((!chosen_desc->box.alt_layout) ||
(!_edje_box_layout_find(chosen_desc->box.alt_layout, &layout, &data, &free_data)))
{
fprintf(stderr, "ERROR: box layout '%s' (fallback '%s') not available, using horizontal.\n",
ERR("ERROR: box layout '%s' (fallback '%s') not available, using horizontal.",
chosen_desc->box.layout, chosen_desc->box.alt_layout);
layout = evas_object_box_layout_horizontal;
free_data = NULL;
@ -1547,8 +1547,8 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
}
if (image_id < 0)
{
printf("EDJE ERROR: part \"%s\" has description, "
"\"%s\" %3.3f with a missing image id!!!\n",
ERR("¨Part \"%s\" has description, "
"\"%s\" %3.3f with a missing image id!!!",
ep->part->name,
ep->param1.description->state.name,
ep->param1.description->state.value);
@ -1565,28 +1565,28 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
evas_object_image_file_set(ep->object, ed->file->path, buf);
if (evas_object_image_load_error_get(ep->object) != EVAS_LOAD_ERROR_NONE)
{
printf("EDJE: Error loading image collection \"%s\" from "
"file \"%s\". Missing EET Evas loader module?\n",
ERR("Error loading image collection \"%s\" from "
"file \"%s\". Missing EET Evas loader module?",
buf, ed->file->path);
switch (evas_object_image_load_error_get(ep->object))
{
case EVAS_LOAD_ERROR_GENERIC:
printf("Error type: EVAS_LOAD_ERROR_GENERIC\n");
ERR("Error type: EVAS_LOAD_ERROR_GENERIC");
break;
case EVAS_LOAD_ERROR_DOES_NOT_EXIST:
printf("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST\n");
ERR("Error type: EVAS_LOAD_ERROR_DOES_NOT_EXIST");
break;
case EVAS_LOAD_ERROR_PERMISSION_DENIED:
printf("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED\n");
ERR("Error type: EVAS_LOAD_ERROR_PERMISSION_DENIED");
break;
case EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED:
printf("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED\n");
ERR("Error type: EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED");
break;
case EVAS_LOAD_ERROR_CORRUPT_FILE:
printf("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE\n");
ERR("Error type: EVAS_LOAD_ERROR_CORRUPT_FILE");
break;
case EVAS_LOAD_ERROR_UNKNOWN_FORMAT:
printf("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT\n");
ERR("Error type: EVAS_LOAD_ERROR_UNKNOWN_FORMAT");
break;
}
}
@ -1635,9 +1635,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags)
faxes = "X";
else if ((flags & FLAG_Y))
faxes = "Y";
printf("EDJE ERROR: Circular dependency when calculating part \"%s\"\n"
ERR("Circular dependency when calculating part \"%s\"\n"
"Already calculating %s [%02x] axes\n"
" Need to calculate %s [%02x] axes\n",
"Need to calculate %s [%02x] axes",
ep->part->name,
axes, ep->calculating,
faxes, flags);

View File

@ -72,7 +72,7 @@ _alloc(size_t size)
mem = calloc(1, size);
if (mem) return mem;
fprintf(stderr, "Edje_Edit: Error. memory allocation of %i bytes failed. %s\n",
ERR("Edje_Edit: Error. memory allocation of %i bytes failed. %s",
(int)size, strerror(errno));
return NULL;
}
@ -228,9 +228,9 @@ _edje_import_image_file(Edje *ed, const char *path, int id)
evas_object_image_file_set(im, path, NULL);
if (evas_object_image_load_error_get(im) != EVAS_LOAD_ERROR_NONE)
{
fprintf(stderr, "Edje_Edit: Error. unable to load image \"%s\"."
ERR("Edje_Edit: unable to load image \"%s\"."
"Missing PNG or JPEG loader modules for Evas or "
"file does not exist, or is not readable.\n", path);
"file does not exist, or is not readable.", path);
evas_object_del(im);
im = NULL;
return 0;
@ -253,8 +253,7 @@ _edje_import_image_file(Edje *ed, const char *path, int id)
eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE);
if (!eetf)
{
fprintf(stderr,
"Edje_Edit: Error. unable to open \"%s\" for writing output\n",
ERR("Edje_Edit: Error. unable to open \"%s\" for writing output",
ed->path);
evas_object_del(im);
return 0;
@ -270,8 +269,8 @@ _edje_import_image_file(Edje *ed, const char *path, int id)
0, 100, 1);
if (bytes <= 0)
{
fprintf(stderr, "Edje_Edit: Error. unable to write image part \"%s\" "
"part entry to %s\n", buf, ed->path);
ERR("Edje_Edit: Error. unable to write image part \"%s\" "
"part entry to %s", buf, ed->path);
evas_object_del(im);
return 0;
}
@ -283,8 +282,8 @@ _edje_import_image_file(Edje *ed, const char *path, int id)
bytes = eet_data_write(eetf, _edje_edd_edje_file, "edje_file", ed->file, 1);
if (bytes <= 0)
{
fprintf(stderr, "Edje_Edit: Error. unable to write \"edje_file\" "
"entry to \"%s\" \n", ed->path);
ERR("Edje_Edit: Error. unable to write \"edje_file\" "
"entry to \"%s\"", ed->path);
eet_close(eetf);
return 0;
}
@ -780,8 +779,8 @@ edje_edit_group_del(Evas_Object *obj)
eetf = eet_open(ed->file->path, EET_FILE_MODE_READ_WRITE);
if (!eetf)
{
fprintf(stderr, "Edje_Edit: Error. unable to open \"%s\" "
"for writing output\n", ed->file->path);
ERR("Edje_Edit: Error. unable to open \"%s\" "
"for writing output", ed->file->path);
return 0;
}
snprintf(buf, sizeof(buf), "collections/%d", g->id);
@ -3822,7 +3821,7 @@ edje_edit_font_add(Evas_Object *obj, const char* path)
{
if (fread(fdata, pos, 1, f) != 1)
{
fprintf(stderr, "Edje_Edit: Error. unable to read all of font file \"%s\"\n",
ERR("Edje_Edit: Error. unable to read all of font file \"%s\"",
path);
return 0;
}
@ -3839,15 +3838,14 @@ edje_edit_font_add(Evas_Object *obj, const char* path)
eetf = eet_open(ed->path, EET_FILE_MODE_READ_WRITE);
if (!eetf)
{
fprintf(stderr,
"Edje_Edit: Error. unable to open \"%s\" for writing output\n",
ERR("Edje_Edit: Error. unable to open \"%s\" for writing output",
ed->path);
return 0;
}
if (eet_write(eetf, buf, fdata, fsize, 1) <= 0)
{
fprintf(stderr, "Edje_Edit: Error. unable to write font part \"%s\" as \"%s\" part entry\n",
ERR("Edje_Edit: Error. unable to write font part \"%s\" as \"%s\" part entry",
path, buf);
eet_close(eetf);
free(fdata);
@ -5941,7 +5939,7 @@ _edje_generate_source(Evas_Object *obj)
strcpy(tmpn, "/tmp/edje_edit.edc-tmp-XXXXXX");
#endif
if (!(fd = mkstemp(tmpn))) return NULL;
printf("*** tmp file: %s\n", tmpn);
INF("*** tmp file: %s", tmpn);
if (!(f = fdopen(fd, "wb"))) return NULL;
/* Write edc into file */
@ -6109,8 +6107,8 @@ edje_edit_save(Evas_Object *obj)
ef = ed->file;
if (!ef) return 0;
printf("*********** Saving file ******************\n");
printf("** path: %s\n", ef->path);
INF("*********** Saving file ******************");
INF("** path: %s", ef->path);
/* Set compiler name */
if (strcmp(ef->compiler, "edje_edit"))
@ -6123,18 +6121,18 @@ edje_edit_save(Evas_Object *obj)
eetf = eet_open(ef->path, EET_FILE_MODE_READ_WRITE);
if (!eetf)
{
fprintf(stderr, "Error. unable to open \"%s\" for writing output\n",
ERR("Error. unable to open \"%s\" for writing output",
ef->path);
return 0;
}
/* Write Edje_File structure */
printf("** Writing Edje_File* ed->file\n");
INF("** Writing Edje_File* ed->file");
bytes = eet_data_write(eetf, _edje_edd_edje_file, "edje_file", ef, 1);
if (bytes <= 0)
{
fprintf(stderr, "Error. unable to write \"edje_file\" "
"entry to \"%s\" \n", ef->path);
ERR("Error. unable to write \"edje_file\" "
"entry to \"%s\"", ef->path);
eet_close(eetf);
return 0;
}
@ -6142,8 +6140,8 @@ edje_edit_save(Evas_Object *obj)
/* Write all the collections */
if (ed->collection)
{
printf("** Writing Edje_Part_Collection* ed->collection "
"[id: %d]\n", ed->collection->id);
INF("** Writing Edje_Part_Collection* ed->collection "
"[id: %d]", ed->collection->id);
snprintf(buf, sizeof(buf), "collections/%i", ed->collection->id);
@ -6151,7 +6149,7 @@ edje_edit_save(Evas_Object *obj)
buf, ed->collection, 1);
if (bytes <= 0)
{
fprintf(stderr, "Error. unable to write \"%s\" part entry to %s \n",
ERR("Error. unable to write \"%s\" part entry to %s",
buf, ef->path);
eet_close(eetf);
return 0;
@ -6168,11 +6166,11 @@ edje_edit_save(Evas_Object *obj)
source_file = _edje_generate_source(obj);
if (!source_file)
{
fprintf(stderr, "Error: can't create edc source\n");
ERR("Error: can't create edc source");
eet_close(eetf);
return 0;
}
printf("** Writing EDC Source [from: %s]\n", source_file);
INF("** Writing EDC Source [from: %s]", source_file);
//open the temp file and put the contents in SrcFile
sf = _alloc(sizeof(SrcFile));
@ -6182,7 +6180,7 @@ edje_edit_save(Evas_Object *obj)
f = fopen(source_file, "rb");
if (!f)
{
fprintf(stderr, "Error. unable to read the created edc source [%s]\n",
ERR("Error. unable to read the created edc source [%s]",
source_file);
eet_close(eetf);
return 0;
@ -6211,7 +6209,7 @@ edje_edit_save(Evas_Object *obj)
bytes = eet_data_write(eetf, _srcfile_list_edd, "edje_sources", sfl, 1);
if (bytes <= 0)
{
fprintf(stderr, "Error. unable to write edc source\n");
ERR("Error. unable to write edc source");
eet_close(eetf);
return 0;
}
@ -6220,7 +6218,7 @@ edje_edit_save(Evas_Object *obj)
unlink(source_file);
eina_stringshare_del(source_file);
eet_close(eetf);
printf("*********** Saving DONE ******************\n");
INF("*********** Saving DONE ******************");
return 1;
}
@ -6236,14 +6234,14 @@ edje_edit_print_internal_status(Evas_Object *obj)
_edje_generate_source(obj);
return;
printf("\n****** CHECKIN' INTERNAL STRUCTS STATUS *********\n");
INF("\n****** CHECKIN' INTERNAL STRUCTS STATUS *********");
printf("*** Edje\n");
printf(" path: '%s'\n", ed->path);
printf(" group: '%s'\n", ed->group);
printf(" parent: '%s'\n", ed->parent);
INF("*** Edje\n");
INF(" path: '%s'", ed->path);
INF(" group: '%s'", ed->group);
INF(" parent: '%s'", ed->parent);
printf("\n*** Parts [table:%d list:%d]\n", ed->table_parts_size,
INF("*** Parts [table:%d list:%d]", ed->table_parts_size,
eina_list_count(ed->collection->parts));
EINA_LIST_FOREACH(ed->collection->parts, l, p)
{
@ -6254,10 +6252,10 @@ edje_edit_print_internal_status(Evas_Object *obj)
if (p == rp->part)
printf(" OK!\n");
else
printf(" WRONG (table[%id]->name = '%s')\n", p->id, rp->part->name);
WRN(" WRONG (table[%id]->name = '%s')", p->id, rp->part->name);
}
printf("\n*** Programs [table:%d list:%d]\n", ed->table_programs_size,
INF("*** Programs [table:%d list:%d]", ed->table_programs_size,
eina_list_count(ed->collection->programs));
EINA_LIST_FOREACH(ed->collection->programs, l, epr)
{
@ -6268,10 +6266,10 @@ edje_edit_print_internal_status(Evas_Object *obj)
if (epr == epr2)
printf(" OK!\n");
else
printf(" WRONG (table[%id]->name = '%s')\n", epr->id, epr2->name);
WRN(" WRONG (table[%id]->name = '%s')", epr->id, epr2->name);
}
printf("\n");
printf("****************** END ************************\n\n");
INF("****************** END ************************\n");
}

View File

@ -2363,17 +2363,17 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
ret = embryo_program_run(ed->collection->script, fn);
if (ret == EMBRYO_PROGRAM_FAIL)
{
printf("EDJE: ERROR with embryo script.\n"
ERR("ERROR with embryo script.\n"
"ENTRY POINT: %s\n"
"ERROR: %s\n",
"ERROR: %s",
fname,
embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
}
else if (ret == EMBRYO_PROGRAM_TOOLONG)
{
printf("EDJE: ERROR with embryo script.\n"
ERR("ERROR with embryo script.\n"
"ENTRY POINT: %s\n"
"ERROR: Script exceeded maximum allowed cycle count of %i\n",
"ERROR: Script exceeded maximum allowed cycle count of %i",
fname,
embryo_program_max_cycle_run_get(ed->collection->script));
}

View File

@ -38,7 +38,7 @@ edje_external_type_register(const char *type_name, const Edje_External_Type *typ
if (eina_hash_find(type_registry, type_name))
{
printf("EDJE ERROR: external type '%s' already registered\n", type_name);
ERR("External type '%s' already registered", type_name);
return EINA_FALSE;
}
return eina_hash_add(type_registry, type_name, type_info);
@ -284,13 +284,13 @@ _edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent,
obj = type->add(type->data, evas, parent, params);
if (!obj)
{
printf("EDJE ERROR: external type '%s' returned NULL from constructor\n", type_name);
ERR("External type '%s' returned NULL from constructor", type_name);
return NULL;
}
evas_object_data_set(obj, "Edje_External_Type", type);
printf("evas object: %p, external type: %p, data_get: %p\n", obj, type, evas_object_data_get(obj, "Edje_External_Type"));
ERR("Evas object: %p, external type: %p, data_get: %p", obj, type, evas_object_data_get(obj, "Edje_External_Type"));
return obj;
}
@ -302,7 +302,7 @@ _edje_external_signal_emit(Evas_Object *obj, const char *emission, const char *s
type = evas_object_data_get(obj, "Edje_External_Type");
if (!type)
{
printf("EDJE ERROR: external type data not found.\n");
ERR("External type data not found.");
return;
}

View File

@ -393,7 +393,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
rp->param1.description = ep->default_desc;
rp->chosen_description = rp->param1.description;
if (!rp->param1.description)
printf("EDJE ERROR: no default part description!\n");
ERR("no default part description!");
switch (ep->type)
{
@ -1058,7 +1058,7 @@ _edje_file_free(Edje_File *edf)
/* FIXME: free collection_hash and collection_cache */
if (edf->collection_hash)
{
printf("EDJE ERROR:\n"
ERR("EDJE ERROR:\n"
"\n"
"Naughty Programmer - spank spank!\n"
"\n"
@ -1067,7 +1067,7 @@ _edje_file_free(Edje_File *edf)
"references to the objects. you should shut down all canvases and objects\n"
"before calling edje_shutdown().\n"
"The following errors are the edje object files and parts that are still\n"
"hanging around, with their reference counts\n");
"hanging around, with their reference counts");
eina_hash_foreach(edf->collection_hash,
_edje_file_collection_hash_foreach, edf);
eina_hash_free(edf->collection_hash);
@ -1184,7 +1184,7 @@ _edje_file_collection_hash_foreach(const Eina_Hash *hash __UNUSED__, const void
edf = fdata;
coll = data;
printf("EEK: EDJE FILE: \"%s\" ref(%i) PART: \"%s\" ref(%i) \n",
ERR("EEK: EDJE FILE: \"%s\" ref(%i) PART: \"%s\" ref(%i) ",
edf->path, edf->references,
coll->part, coll->references);
_edje_collection_free(edf, coll);

View File

@ -163,7 +163,7 @@ _edje_lua_error(lua_State *L, int err_code)
err_type = "unknown";
break;
}
fprintf(stderr, "Lua %s error: %s\n", err_type, lua_tostring(L, -1));
ERR("Lua %s error: %s", err_type, lua_tostring(L, -1));
// don't exit. this is BAD. lua script bugs will cause thngs like e to
// exit mysteriously endig your x session. bad!
// exit(-1);
@ -5029,8 +5029,7 @@ _edje_lua_alloc(void *ud, void *ptr, size_t osize, size_t nsize)
ela->cur += nsize - osize;
if (ela->cur > ela->max)
{
fprintf(stderr,
"Edje Lua memory limit of %i bytes reached (%i allocated)\n",
ERR("Edje Lua memory limit of %i bytes reached (%i allocated)",
ela->max, ela->cur);
return NULL;
}
@ -5055,7 +5054,7 @@ _edje_lua_init()
Ledje = lua_newstate(_edje_lua_alloc, &ela);
if (!Ledje)
{
fprintf(stderr, "Lua error: Lua state could not be initialized\n");
ERR("Lua error: Lua state could not be initialized");
exit(-1);
}

View File

@ -7,18 +7,10 @@
#include "edje_private.h"
static int _edje_init_count = 0;
static int _edje_log_dom_global = -1;
int _edje_default_log_dom = -1;
Eina_Mempool *_edje_real_part_mp = NULL;
Eina_Mempool *_edje_real_part_state_mp = NULL;
#ifdef EDJE_DEFAULT_LOG_COLOR
# undef EDJE_DEFAULT_LOG_COLOR
#endif
#define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_edje_log_dom_global, __VA_ARGS__)
/*============================================================================*
@ -68,8 +60,8 @@ edje_init(void)
return --_edje_init_count;
}
_edje_log_dom_global = eina_log_domain_register("Edje", EDJE_DEFAULT_LOG_COLOR);
if (_edje_log_dom_global < 0)
_edje_default_log_dom = eina_log_domain_register("Edje", EDJE_DEFAULT_LOG_COLOR);
if (_edje_default_log_dom < 0)
{
EINA_LOG_ERR("Edje Can not create a general log domain.");
goto shutdown_eina;
@ -142,8 +134,8 @@ edje_init(void)
shutdown_ecore_job:
ecore_job_shutdown();
unregister_log_domain:
eina_log_domain_unregister(_edje_log_dom_global);
_edje_log_dom_global = -1;
eina_log_domain_unregister(_edje_default_log_dom);
_edje_default_log_dom = -1;
shutdown_eina:
eina_shutdown();
return --_edje_init_count;
@ -199,8 +191,8 @@ edje_shutdown(void)
eet_shutdown();
embryo_shutdown();
ecore_job_shutdown();
eina_log_domain_unregister(_edje_log_dom_global);
_edje_log_dom_global = -1;
eina_log_domain_unregister(_edje_default_log_dom);
_edje_default_log_dom = -1;
eina_shutdown();
return _edje_init_count;

View File

@ -288,7 +288,7 @@ _edje_match_patterns_exec_init_states(Edje_States *states,
r->patterns[i] = str; \
\
if (Show) \
fprintf(stderr, "%i [%s]\n", i, str); \
INF("%i [%s]", i, str); \
\
r->finals[i] = 0; \
for (j = 0; str[j]; ++j) \

View File

@ -25,7 +25,28 @@
#include <lua.h>
#include <lauxlib.h>
EAPI extern int _edje_default_log_dom ;
#ifdef EDJE_DEFAULT_LOG_COLOR
# undef EDJE_DEFAULT_LOG_COLOR
#endif
#define EDJE_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_edje_default_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_edje_default_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_default_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_default_log_dom, __VA_ARGS__)
#ifdef __GNUC__
# if __GNUC__ >= 4
// BROKEN in gcc 4 on amd64

View File

@ -615,7 +615,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, int force, const char *ssig, const
}
if ((recursions >= 64) || (recursion_limit))
{
printf("EDJE ERROR: programs recursing up to recursion limit of %i. Disabled.\n",
ERR("Programs recursing up to recursion limit of %i. Disabled.",
64);
recursion_limit = 1;
return;

View File

@ -643,18 +643,18 @@ _call_fn(Edje * ed, const char *fname, Embryo_Function fn)
ret = embryo_program_run(ed->collection->script, fn);
if (ret == EMBRYO_PROGRAM_FAIL)
{
printf("EDJE: ERROR with embryo script.\n"
ERR("ERROR with embryo script.\n"
"ENTRY POINT: %s\n"
"ERROR: %s\n",
"ERROR: %s",
fname,
embryo_error_string_get(embryo_program_error_get
(ed->collection->script)));
}
else if (ret == EMBRYO_PROGRAM_TOOLONG)
{
printf("EDJE: ERROR with embryo script.\n"
ERR("ERROR with embryo script.\n"
"ENTRY POINT: %s\n"
"ERROR: Script exceeded maximum allowed cycle count of %i\n",
"ERROR: Script exceeded maximum allowed cycle count of %i",
fname, embryo_program_max_cycle_run_get(ed->collection->script));
}
}

View File

@ -61,7 +61,7 @@ edje_freeze(void)
{
#ifdef FASTFREEZE
_edje_freeze_val++;
printf("fr ++ ->%i\n", _edje_freeze_val);
INF("fr ++ ->%i", _edje_freeze_val);
#else
// FIXME: could just have a global freeze instead of per object
// above i tried.. but this broke some things. notable e17's menus. why?
@ -111,7 +111,7 @@ edje_thaw(void)
#ifdef FASTFREEZE
_edje_freeze_val--;
printf("fr -- ->%i\n", _edje_freeze_val);
INF("fr -- ->%i", _edje_freeze_val);
if ((_edje_freeze_val <= 0) && (_edje_freeze_calc_count > 0))
{
Eina_List *l;
@ -2348,8 +2348,7 @@ edje_box_layout_register(const char *name, Evas_Object_Box_Layout func, void *(*
if (_edje_box_layout_builtin_find(name))
{
fprintf(stderr,
"ERROR: cannot register layout '%s': would override builtin!\n",
ERR("Cannot register layout '%s': would override builtin!",
name);
if (data && free_data) free_data(data);
@ -2703,11 +2702,11 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
}
if ((ed->w > 4000) || (ed->h > 4000))
{
printf("EDJE ERROR: file %s, group %s has a non-fixed part. add fixed: 1 1; ???\n",
ERR("file %s, group %s has a non-fixed part. add fixed: 1 1; ???",
ed->path, ed->group);
if (pep)
printf(" Problem part is: %s\n", pep->part->name);
printf(" Will recalc min size not allowing broken parts to affect the result.\n");
ERR(" Problem part is: %s", pep->part->name);
ERR(" Will recalc min size not allowing broken parts to affect the result.");
if (reset_maxwh)
{
reset_maxwh = 0;
@ -2763,7 +2762,7 @@ edje_object_part_state_get(const Evas_Object *obj, const char *part, double *val
if (!rp)
{
if (val_ret) *val_ret = 0;
printf("part not found\n");
INF("part not found");
return "";
}
if (rp->chosen_description)