Enlightenment CVS committal

Author  : rephorm
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        edje_cc_handlers.c edje_cc_out.c edje_cc_sources.c 


Log Message:

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.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_handlers.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- edje_cc_handlers.c  30 Aug 2004 08:06:59 -0000      1.34
+++ edje_cc_handlers.c  31 Aug 2004 04:00:13 -0000      1.35
@@ -5,6 +5,9 @@
 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 @@
 {
      {"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 @@
 {
    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;
 }
@@ -308,24 +311,42 @@
 }
 
 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 @@
 {
    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 @@
    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);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_out.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- edje_cc_out.c       29 Aug 2004 11:03:19 -0000      1.21
+++ edje_cc_out.c       31 Aug 2004 04:00:14 -0000      1.22
@@ -761,7 +761,7 @@
               {
                  Code_Lookup *cl;
                  
-                 cl = calloc(1, sizeof(Code_Lookup));
+                 cl = mem_alloc(SZ(Code_Lookup));
                  if (cl)
                    {
                       int inesc = 0;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/bin/edje_cc_sources.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- edje_cc_sources.c   29 Aug 2004 12:28:53 -0000      1.3
+++ edje_cc_sources.c   31 Aug 2004 04:00:14 -0000      1.4
@@ -70,7 +70,7 @@
        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);




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to