Enlightenment CVS committal

Author  : doursse
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/bin


Modified Files:
        edje_decc.c edje_decc.h edje_main.h 


Log Message:
include correctly alloca.h and use ecore_file_mkpath instead of the local 
implementation

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_decc.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- edje_decc.c 2 Mar 2008 05:39:51 -0000       1.24
+++ edje_decc.c 24 Mar 2008 08:09:06 -0000      1.25
@@ -8,6 +8,7 @@
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <Ecore_File.h>
 #ifdef _WIN32
 # include <windows.h>
 # include <shlobj.h>
@@ -26,9 +27,6 @@
 
 int        decomp(void);
 void       output(void);
-int        e_file_is_dir(char *file);
-int        e_file_mkdir(char *dir);
-int        e_file_mkpath(char *path);
 static int compiler_cmd_is_sane();
 static int root_filename_is_sane();
 
@@ -184,7 +182,7 @@
    p = strrchr(outdir, '.');
    if (p) *p = 0;
 
-   e_file_mkpath(outdir);
+   ecore_file_mkpath(outdir);
 
    ef = eet_open(file_in, EET_FILE_MODE_READ);
 
@@ -234,7 +232,7 @@
                       printf("ERROR: potential security violation. attempt to 
write in parent dir.\n");
                       exit(-1);
                    }
-                 e_file_mkpath(pp);
+                 ecore_file_mkpath(pp);
                  free(pp);
                  if (!evas_object_image_save(im, out, NULL, "quality=100 
compress=9"))
                    {
@@ -267,7 +265,7 @@
             printf("ERROR: potential security violation. attempt to write in 
parent dir.\n");
             exit (-1);
          }
-       e_file_mkpath(pp);
+       ecore_file_mkpath(pp);
        free(pp);
        if (strstr(out, "../"))
          {
@@ -314,7 +312,7 @@
                       printf("ERROR: potential security violation. attempt to 
write in parent dir.\n");
                       exit (-1);
                    }
-                 e_file_mkpath(pp);
+                 ecore_file_mkpath(pp);
                  free(pp);
                  if (strstr(out, "../"))
                    {
@@ -360,55 +358,6 @@
              "before running it!\n\n");
      }
    eet_close(ef);
-}
-
-int
-e_file_is_dir(char *file)
-{
-   struct stat st;
-
-   if (stat(file, &st) < 0) return 0;
-   if (S_ISDIR(st.st_mode)) return 1;
-   return 0;
-}
-
-int
-e_file_mkdir(char *dir)
-{
-#ifndef _WIN32
-   static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | 
S_IXGRP | S_IROTH | S_IXOTH;
-
-   if (mkdir(dir, default_mode) < 0) return 0;
-#else
-   if (mkdir(dir) < 0) return 0;
-#endif /* _WIN32 */
-   return 1;
-}
-
-int
-e_file_mkpath(char *path)
-{
-   char ss[PATH_MAX];
-   int  i, ii;
-
-   ss[0] = 0;
-   i = 0;
-   ii = 0;
-   while (path[i])
-     {
-       if (ii == sizeof(ss) - 1) return 0;
-       ss[ii++] = path[i];
-       ss[ii] = 0;
-       if (path[i] == '/')
-         {
-            if (!e_file_is_dir(ss)) e_file_mkdir(ss);
-            else if (!e_file_is_dir(ss)) return 0;
-         }
-       i++;
-     }
-   if (!e_file_is_dir(ss)) e_file_mkdir(ss);
-   else if (!e_file_is_dir(ss)) return 0;
-   return 1;
 }
 
 static int
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_decc.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- edje_decc.h 11 Nov 2005 06:49:57 -0000      1.3
+++ edje_decc.h 24 Mar 2008 08:09:06 -0000      1.4
@@ -13,9 +13,6 @@
 #include <stdarg.h>
 #include <locale.h>
 #include <ctype.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
 
 /* types */
 typedef struct _Font                  Font;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/bin/edje_main.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- edje_main.h 21 Jan 2008 01:03:04 -0000      1.9
+++ edje_main.h 24 Mar 2008 08:09:06 -0000      1.10
@@ -5,7 +5,6 @@
 #include <config.h>
 #endif
 
-#include <sys/mman.h>
 #include <Evas.h>
 #include <Ecore.h>
 #include <Ecore_Evas.h>
@@ -18,11 +17,26 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/mman.h>
 #include <stdarg.h>
 #include <locale.h>
 #include <ctype.h>
+
 #ifdef HAVE_ALLOCA_H
-#include <alloca.h>
+# include <alloca.h>
+#elif defined __GNUC__
+# define alloca __builtin_alloca
+#elif defined _AIX
+# define alloca __alloca
+#elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+#else
+# include <stddef.h>
+# ifdef  __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
 #endif
 
 #include "edje_private.h"



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to