Ok. Completing the commit from last night. Sorry about that (and thanks for cleaning up after me raster). Nothing functional changed between raster's last commit and this, just making things more consistent.
Also, moved a few calloc's to mem_alloc and strdups to mem_strdup. SVN revision: 11455
This commit is contained in:
parent
170da7eb5d
commit
e135951db6
|
@ -5,6 +5,9 @@ static void ob_images(void);
|
|||
static void ob_images_image(void);
|
||||
static void st_images_image(void);
|
||||
|
||||
static void ob_fonts(void);
|
||||
|
||||
static void ob_fonts_font(void);
|
||||
static void st_fonts_font(void);
|
||||
|
||||
static void st_data_item(void);
|
||||
|
@ -154,8 +157,8 @@ New_Object_Handler object_handlers[] =
|
|||
{
|
||||
{"images", ob_images},
|
||||
{"images.image", ob_images_image},
|
||||
{"fonts", NULL},
|
||||
{"fonts.font", NULL},
|
||||
{"fonts", ob_fonts},
|
||||
{"fonts.font", ob_fonts_font},
|
||||
{"data", NULL},
|
||||
{"data.item", NULL},
|
||||
{"collections", ob_collections},
|
||||
|
@ -264,7 +267,7 @@ ob_images_image(void)
|
|||
{
|
||||
Edje_Image_Directory_Entry *img;
|
||||
|
||||
img = calloc(1, sizeof(Edje_Image_Directory_Entry));
|
||||
img = mem_alloc(SZ(Edje_Image_Directory_Entry));
|
||||
edje_file->image_dir->entries = evas_list_append(edje_file->image_dir->entries, img);
|
||||
img->id = evas_list_count(edje_file->image_dir->entries) - 1;
|
||||
}
|
||||
|
@ -307,25 +310,43 @@ st_images_image(void)
|
|||
img->source_param = parse_int_range(2, 0, 100);
|
||||
}
|
||||
|
||||
static void
|
||||
ob_fonts(void)
|
||||
{
|
||||
if (!edje_file->font_dir)
|
||||
edje_file->font_dir = mem_alloc(SZ(Edje_Font_Directory));
|
||||
}
|
||||
|
||||
static void
|
||||
ob_fonts_font(void)
|
||||
{
|
||||
Edje_Font_Directory_Entry *fnt;
|
||||
|
||||
fnt = mem_alloc(SZ(Edje_Font_Directory_Entry));
|
||||
if (edje_file->font_dir)
|
||||
edje_file->font_dir->entries = evas_list_append(edje_file->font_dir->entries, fnt);
|
||||
else
|
||||
printf("hmm, no font dir?\n");
|
||||
}
|
||||
|
||||
static void
|
||||
st_fonts_font(void)
|
||||
{
|
||||
Font *fn;
|
||||
Edje_Font_Directory_Entry *fnt;
|
||||
|
||||
fn = calloc(1, sizeof(Font));
|
||||
fn = mem_alloc(SZ(Font));
|
||||
fn->file = parse_str(0);
|
||||
fn->name = parse_str(1);
|
||||
fonts = evas_list_append(fonts, fn);
|
||||
|
||||
if (!edje_file->font_dir)
|
||||
edje_file->font_dir = calloc(1, sizeof(Edje_Font_Directory));
|
||||
|
||||
fnt = calloc(1, sizeof(Edje_Font_Directory_Entry));
|
||||
fnt->entry = strdup(fn->name);
|
||||
|
||||
edje_file->font_dir->entries =
|
||||
evas_list_append(edje_file->font_dir->entries, fnt);
|
||||
if (edje_file->font_dir)
|
||||
{
|
||||
fnt = evas_list_data(evas_list_last(edje_file->font_dir->entries));
|
||||
if(fnt) fnt->entry = mem_strdup(fn->name);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "%s: Error. parse error %s:%i. Trying to a font outside of a fonts block?\n", progname, file_in, line);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -333,7 +354,7 @@ st_data_item(void)
|
|||
{
|
||||
Edje_Data *di;
|
||||
|
||||
di = calloc(1, sizeof(Edje_Data));
|
||||
di = mem_alloc(SZ(Edje_Data));
|
||||
di->key = parse_str(0);
|
||||
di->value = parse_str(1);
|
||||
edje_file->data = evas_list_append(edje_file->data, di);
|
||||
|
@ -432,7 +453,7 @@ st_collections_group_data_item(void)
|
|||
Edje_Data *di;
|
||||
|
||||
pc = evas_list_data(evas_list_last(edje_collections));
|
||||
di = calloc(1, sizeof(Edje_Data));
|
||||
di = mem_alloc(SZ(Edje_Data));
|
||||
di->key = parse_str(0);
|
||||
di->value = parse_str(1);
|
||||
pc->data = evas_list_append(pc->data, di);
|
||||
|
|
|
@ -761,7 +761,7 @@ data_process_string(Edje_Part_Collection *pc, char *prefix, char *s, void (*func
|
|||
{
|
||||
Code_Lookup *cl;
|
||||
|
||||
cl = calloc(1, sizeof(Code_Lookup));
|
||||
cl = mem_alloc(SZ(Code_Lookup));
|
||||
if (cl)
|
||||
{
|
||||
int inesc = 0;
|
||||
|
|
|
@ -70,7 +70,7 @@ source_fetch_file(char *fil, char *filname)
|
|||
sz = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
sf = mem_alloc(SZ(SrcFile));
|
||||
sf->name = strdup(filname);
|
||||
sf->name = mem_strdup(filname);
|
||||
sf->file = mem_alloc(sz);
|
||||
fread(sf->file, sz, 1, f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
|
Loading…
Reference in New Issue