Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_ipc_handlers.h 


Log Message:
- move duplicate code in e_ipc_handlers into a macro
- stop warnings in e_main.c. Is there a better way to fix this?

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- e_ipc_handlers.h    5 Jun 2005 14:07:45 -0000       1.29
+++ e_ipc_handlers.h    5 Jun 2005 18:59:53 -0000       1.30
@@ -220,6 +220,26 @@
 #define DECODE(__dec) \
    if (__dec(e->data, e->size, &dat))
 
+# define E_PATH_GET(__path, __str) \
+   E_Path *__path = NULL; \
+   if (!strcmp(__str, "data")) \
+     __path = path_data; \
+   else if (!strcmp(__str, "images")) \
+     __path = path_images; \
+   else if (!strcmp(__str, "fonts")) \
+     __path = path_fonts; \
+   else if (!strcmp(__str, "themes")) \
+     __path = path_themes; \
+   else if (!strcmp(__str, "init")) \
+     __path = path_init; \
+   else if (!strcmp(__str, "icons")) \
+     __path = path_icons; \
+   else if (!strcmp(__str, "modules")) \
+     __path = path_modules; \
+   else if (!strcmp(__str, "backgrounds")) \
+     __path = path_backgrounds; 
+
+
 #endif
 
 
@@ -665,23 +685,7 @@
    REQ_2STRING(params[0], params[1], HDL);
 #elif (TYPE == E_WM_IN)
    STRING2(s1, s2, e_2str, HDL);
-   E_Path *path = NULL;
-   if (!strcmp(s1, "data"))
-     path = path_data;
-   else if (!strcmp(s1, "images"))
-     path = path_images;
-   else if (!strcmp(s1, "fonts"))
-     path = path_fonts;
-   else if (!strcmp(s1, "themes"))
-     path = path_themes;
-   else if (!strcmp(s1, "init"))
-     path = path_init;
-   else if (!strcmp(s1, "icons"))
-     path = path_icons;
-   else if (!strcmp(s1, "modules"))
-     path = path_modules;
-   else if (!strcmp(s1, "backgrounds"))
-     path = path_backgrounds;
+   E_PATH_GET(path, s1)
    e_path_user_path_append(path, s2);
    SAVE;
    END_STRING2(e_2str)
@@ -698,23 +702,7 @@
    REQ_2STRING(params[0], params[1], HDL);
 #elif (TYPE == E_WM_IN)
    STRING2(s1, s2, e_2str, HDL);
-   E_Path *path = NULL;
-   if (!strcmp(s1, "data"))
-     path = path_data;
-   else if (!strcmp(s1, "images"))
-     path = path_images;
-   else if (!strcmp(s1, "fonts"))
-     path = path_fonts;
-   else if (!strcmp(s1, "themes"))
-     path = path_themes;
-   else if (!strcmp(s1, "init"))
-     path = path_init;
-   else if (!strcmp(s1, "icons"))
-     path = path_icons;
-   else if (!strcmp(s1, "modules"))
-     path = path_modules;
-   else if (!strcmp(s1, "backgrounds"))
-     path = path_backgrounds;
+   E_PATH_GET(path, s1)
    e_path_user_path_prepend(path, s2);
    SAVE;
    END_STRING2(e_2str)
@@ -731,23 +719,7 @@
    REQ_2STRING(params[0], params[1], HDL);
 #elif (TYPE == E_WM_IN)
    STRING2(s1, s2, e_2str, HDL);
-   E_Path *path = NULL;
-   if (!strcmp(s1, "data"))
-     path = path_data;
-   else if (!strcmp(s1, "images"))
-     path = path_images;
-   else if (!strcmp(s1, "fonts"))
-     path = path_fonts;
-   else if (!strcmp(s1, "themes"))
-     path = path_themes;
-   else if (!strcmp(s1, "init"))
-     path = path_init;
-   else if (!strcmp(s1, "icons"))
-     path = path_icons;
-   else if (!strcmp(s1, "modules"))
-     path = path_modules;
-   else if (!strcmp(s1, "backgrounds"))
-     path = path_backgrounds;
+   E_PATH_GET(path, s1)
    e_path_user_path_remove(path, s2);
    SAVE;
    END_STRING2(e_2str)




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to