[Pkg-e-commits] [SCM] Enlightenment DR17 graphical layout and animation library branch, upstream-vcs, updated. d4487712ad491141346ca0ba4b291df16faac2cf

doursse doursse at alioth.debian.org
Sun May 4 16:49:00 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit d91d8d1db3cf45a71d97784a28ff5c5faea334dc
Author: doursse <doursse>
Date:   Mon Mar 24 08:09:06 2008 +0000

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

diff --git a/configure.in b/configure.in
index 0d94dc1..2a972ba 100644
--- a/configure.in
+++ b/configure.in
@@ -66,6 +66,7 @@ PKG_CHECK_MODULES(EDJE, [
   evas >= 0.9.9
   ecore-evas >= 0.9.9
   ecore-job >= 0.9.9
+  ecore-file >= 0.9.9
   eet >= 0.9.10
   embryo >= 0.9.1
 ])
diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c
index 9d22cf0..309aa65 100644
--- a/src/bin/edje_decc.c
+++ b/src/bin/edje_decc.c
@@ -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 line = 0;
 
 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 @@ output(void)
    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 @@ output(void)
 		       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 @@ output(void)
 	     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 @@ output(void)
 		       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, "../"))
 		    {
@@ -362,55 +360,6 @@ output(void)
    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
 compiler_cmd_is_sane()
 {
diff --git a/src/bin/edje_decc.h b/src/bin/edje_decc.h
index faf5393..8fc6e94 100644
--- a/src/bin/edje_decc.h
+++ b/src/bin/edje_decc.h
@@ -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;
diff --git a/src/bin/edje_main.h b/src/bin/edje_main.h
index b45b00c..6df75a2 100644
--- a/src/bin/edje_main.h
+++ b/src/bin/edje_main.h
@@ -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"

-- 
Enlightenment DR17 graphical layout and animation library



More information about the Pkg-e-commits mailing list