Function to check whether a path resides inside a default directory.
authorSebastian Dransfeld <sd@tango.flipp.net>
Wed, 7 Feb 2007 01:12:25 +0000 (01:12 +0000)
committerSebastian Dransfeld <sd@tango.flipp.net>
Wed, 7 Feb 2007 01:12:25 +0000 (01:12 +0000)
SVN revision: 28279

legacy/efreet/src/lib/Efreet.h
legacy/efreet/src/lib/Makefile.am
legacy/efreet/src/lib/efreet_menu.c
legacy/efreet/src/lib/efreet_private.h

index e668406..619fd82 100644 (file)
@@ -32,6 +32,7 @@ extern "C" {
 #include "efreet_icon.h"
 #include "efreet_desktop.h"
 #include "efreet_menu.h"
+#include "efreet_utils.h"
 
 int efreet_init(void);
 int efreet_shutdown(void);
index 483710e..f43479b 100644 (file)
@@ -14,7 +14,8 @@ Efreet.h \
 efreet_base.h \
 efreet_desktop.h \
 efreet_icon.h \
-efreet_menu.h
+efreet_menu.h \
+efreet_utils.h
 
 EFREETSOURCES = \
 efreet.c \
@@ -24,6 +25,7 @@ efreet_xml.c \
 efreet_ini.c \
 efreet_desktop.c \
 efreet_menu.c \
+efreet_utils.c \
 $(EFREETHEADERS)
 
 libefreet_la_SOURCES = \
index 0aecb09..73783b2 100644 (file)
@@ -220,9 +220,6 @@ static Ecore_Hash *efreet_menu_move_cbs = NULL;
 static Ecore_Hash *efreet_menu_layout_cbs = NULL;
 
 static const char *efreet_menu_prefix_get(void);
-static Ecore_List *efreet_default_dirs_get(const char *user_dir, 
-                                                    Ecore_List *system_dirs, 
-                                                    const char *suffix);
 
 static Efreet_Menu_Internal *efreet_menu_by_name_find(Efreet_Menu_Internal *internal,
                                                     const char *name, 
@@ -837,6 +834,38 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
 }
 
 /**
+ * @param user_dir: The user directory to work with
+ * @param system_dirs: The system directories to work with
+ * @param suffix: The path suffix to add
+ * @return Returns the list of directories
+ * @brief Creates the list of directories based on the user
+ * dir, system dirs and given suffix.
+ */
+Ecore_List *
+efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs, 
+                                                    const char *suffix)
+{
+    const char *xdg_dir;
+    char dir[PATH_MAX];
+    Ecore_List *list;
+
+    list = ecore_list_new();
+    ecore_list_set_free_cb(list, ECORE_FREE_CB(free));
+
+    snprintf(dir, sizeof(dir), "%s/%s", user_dir, suffix);
+    ecore_list_append(list, strdup(dir));
+
+    ecore_list_goto_first(system_dirs);
+    while ((xdg_dir = ecore_list_next(system_dirs)))
+    {
+        snprintf(dir, sizeof(dir), "%s/%s", xdg_dir, suffix);
+        ecore_list_append(list, strdup(dir));
+    }
+
+    return list;
+}
+
+/**
  * @internal
  * @return Returns a new Efreet_Menu_Internal struct
  * @brief Allocates and initializes a new Efreet_Menu_Internal structure 
@@ -912,39 +941,6 @@ efreet_menu_prefix_get(void)
 
 /**
  * @internal
- * @param user_dir: The user directory to work with
- * @param system_dirs: The system directories to work with
- * @param suffix: The path suffix to add
- * @return Returns the list of directories
- * @brief Creates the list of directories based on the user
- * dir, system dirs and given suffix.
- */
-static Ecore_List *
-efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs, 
-                                                    const char *suffix)
-{
-    const char *xdg_dir;
-    char dir[PATH_MAX];
-    Ecore_List *list;
-
-    list = ecore_list_new();
-    ecore_list_set_free_cb(list, ECORE_FREE_CB(free));
-
-    snprintf(dir, sizeof(dir), "%s/%s", user_dir, suffix);
-    ecore_list_append(list, strdup(dir));
-
-    ecore_list_goto_first(system_dirs);
-    while ((xdg_dir = ecore_list_next(system_dirs)))
-    {
-        snprintf(dir, sizeof(dir), "%s/%s", xdg_dir, suffix);
-        ecore_list_append(list, strdup(dir));
-    }
-
-    return list;
-}
-
-/**
- * @internal
  * @param menu: The menu to populate
  * @param xml: The xml dom tree to populate from
  * @return Returns 1 if this XML tree is valid, 0 otherwise
index 4c9ac9d..5f246e6 100644 (file)
@@ -160,6 +160,9 @@ void efreet_icon_shutdown(void);
 
 int efreet_menu_init(void);
 void efreet_menu_shutdown(void);
+Ecore_List *efreet_default_dirs_get(const char *user_dir, 
+                                    Ecore_List *system_dirs, 
+                                    const char *suffix);
 
 int efreet_ini_init(void);
 int efreet_ini_shutdown(void);