lib/efreet_private.h
Go to the documentation of this file.00001 /* vim: set sw=4 ts=4 sts=4 et: */ 00002 #ifndef EFREET_PRIVATE_H 00003 #define EFREET_PRIVATE_H 00004 00014 #include "config.h" 00015 #include <stdlib.h> 00016 #include <stdio.h> 00017 #include <string.h> 00018 #include <unistd.h> 00019 #include <ctype.h> 00020 #include <fcntl.h> 00021 #include <sys/mman.h> 00022 #include <sys/types.h> 00023 #include <sys/stat.h> 00024 #include <dirent.h> 00025 #include <fnmatch.h> 00026 #include <limits.h> 00027 00028 #ifdef HAVE_ALLOCA_H 00029 #include <alloca.h> 00030 #endif 00031 00032 #include <Ecore.h> 00033 #include <Ecore_File.h> 00034 #include <Ecore_Str.h> 00035 00036 #include "efreet_xml.h" 00037 #include "efreet_ini.h" 00038 00043 #define NEW(x, c) calloc(c, sizeof(x)) 00044 00049 #define FREE(x) do { free(x); x = NULL; } while (0) 00050 00055 #define IF_FREE(x) do { if (x) FREE(x); } while (0) 00056 00061 #define IF_RELEASE(x) do { \ 00062 if (x) { \ 00063 const char *__tmp; __tmp = (x); (x) = NULL; ecore_string_release(__tmp); \ 00064 } \ 00065 (x) = NULL; \ 00066 } while (0) 00067 00072 #define IF_FREE_LIST(x) do { \ 00073 if (x) { \ 00074 Ecore_List *__tmp; __tmp = (x); (x) = NULL; ecore_list_destroy(__tmp); \ 00075 } \ 00076 (x) = NULL; \ 00077 } while (0) 00078 00083 #define IF_FREE_DLIST(x) do { \ 00084 if (x) { \ 00085 Ecore_DList *__tmp; __tmp = (x); (x) = NULL; ecore_dlist_destroy(__tmp); \ 00086 } \ 00087 (x) = NULL; \ 00088 } while (0) 00089 00094 #define IF_FREE_HASH(x) do { \ 00095 if (x) { \ 00096 Ecore_Hash *__tmp; __tmp = (x); (x) = NULL; ecore_hash_destroy(__tmp); \ 00097 } \ 00098 (x) = NULL; \ 00099 } while (0) 00100 00105 #if HAVE___ATTRIBUTE__ 00106 #define __UNUSED__ __attribute__((unused)) 00107 #else 00108 #define __UNUSED__ 00109 #endif 00110 00111 #ifndef PATH_MAX 00112 00116 #define PATH_MAX 4096 00117 #endif 00118 00123 enum Efreet_Desktop_Command_Flag 00124 { 00125 EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001, 00126 EFREET_DESKTOP_EXEC_FLAG_URI = 0x0002, 00127 EFREET_DESKTOP_EXEC_FLAG_DIR = 0x0004, 00128 EFREET_DESKTOP_EXEC_FLAG_FILE = 0x0008 00129 }; 00130 00135 typedef enum Efreet_Desktop_Command_Flag Efreet_Desktop_Command_Flag; 00136 00141 typedef struct Efreet_Desktop_Command Efreet_Desktop_Command; 00142 00147 struct Efreet_Desktop_Command 00148 { 00149 Efreet_Desktop *desktop; 00150 int num_pending; 00151 00152 Efreet_Desktop_Command_Flag flags; 00153 00154 Efreet_Desktop_Command_Cb cb_command; 00155 Efreet_Desktop_Progress_Cb cb_progress; 00156 void *data; 00157 00158 Ecore_List *files; 00159 }; 00160 00165 typedef struct Efreet_Desktop_Command_File Efreet_Desktop_Command_File; 00166 00171 struct Efreet_Desktop_Command_File 00172 { 00173 Efreet_Desktop_Command *command; 00174 char *dir; 00175 char *file; 00176 char *fullpath; 00177 char *uri; 00178 00179 int pending; 00180 }; 00181 00182 int efreet_base_init(void); 00183 void efreet_base_shutdown(void); 00184 00185 int efreet_icon_init(void); 00186 void efreet_icon_shutdown(void); 00187 00188 int efreet_menu_init(void); 00189 void efreet_menu_shutdown(void); 00190 Ecore_List *efreet_default_dirs_get(const char *user_dir, 00191 Ecore_List *system_dirs, 00192 const char *suffix); 00193 00194 int efreet_ini_init(void); 00195 int efreet_ini_shutdown(void); 00196 00197 int efreet_desktop_init(void); 00198 int efreet_desktop_shutdown(void); 00199 00200 const char *efreet_home_dir_get(void); 00201 00202 const char *efreet_lang_get(void); 00203 const char *efreet_lang_country_get(void); 00204 const char *efreet_lang_modifier_get(void); 00205 00206 size_t efreet_array_cat(char *buffer, size_t size, const char *strs[]); 00207 00208 const char *efreet_desktop_environment_get(void); 00209 00214 #endif