Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_config


Modified Files:
        Ecore_Config.h ecore_config.c ecore_config_db.c 
        ecore_config_extra.c ecore_config_ipc.h 
        ecore_config_ipc_ecore.c ecore_config_ipc_main.c 
        ecore_config_private.h ecore_config_storage.c 
        ecore_config_util.c ecore_config_util.h 


Log Message:


kwo's ecore cleanup patch

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/Ecore_Config.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- Ecore_Config.h      1 Dec 2004 23:07:42 -0000       1.41
+++ Ecore_Config.h      2 Mar 2005 07:06:34 -0000       1.42
@@ -150,17 +150,19 @@
    EAPI float               ecore_config_float_get(const char *key);
    EAPI char               *ecore_config_theme_get(const char *key);
    EAPI char               *ecore_config_as_string_get(const char *key);
+   EAPI int                 ecore_config_bound(Ecore_Config_Prop * e);
    EAPI int                 ecore_config_describe(const char *key, char *desc);
    EAPI int                 ecore_config_short_opt_set(const char *key,
                                                  char short_opt);
    EAPI int                 ecore_config_long_opt_set(const char *key,
                                                 char *long_opt);
    EAPI int                 ecore_config_set(const char *key, char *val);
-   EAPI int                 ecore_config_typed_set(const char *key, void *val,
+   EAPI int                 ecore_config_typed_set(const char *key, const void 
*val,
                                              int type);
    EAPI int                 ecore_config_boolean_set(const char *key, int val);
    EAPI int                 ecore_config_string_set(const char *key, char 
*val);
    EAPI int                 ecore_config_int_set(const char *key, int val);
+   EAPI char               *ecore_config_rgb_to_argb(char *rgb);
    EAPI int                 ecore_config_rgb_set(const char *key, char *val);
    EAPI int                 ecore_config_argb_set(const char *key, char *val);
    EAPI int                 ecore_config_float_set(const char *key, float val);
@@ -177,7 +179,7 @@
    EAPI int                 ecore_config_int_default(const char *key, int val);
    EAPI int                 ecore_config_int_default_bound(const char *key, 
int val,
                                                      int lo, int hi, int step);
-   EAPI int                 ecore_config_string_default(const char *key, char 
*val);
+   EAPI int                 ecore_config_string_default(const char *key, const 
char *val);
    EAPI int                 ecore_config_float_default(const char *key, float 
val);
    EAPI int                 ecore_config_float_default_bound(const char *key,
                                                        float val, float lo,
@@ -192,7 +194,7 @@
    EAPI int                 ecore_config_deaf(const char *name, const char 
*key,
                                         Ecore_Config_Listener listener);
    EAPI Ecore_Config_Prop  *ecore_config_dst(Ecore_Config_Prop * e);
-   EAPI int                 ecore_config_type_guess(const char *key, char 
*val);
+   EAPI int                 ecore_config_type_guess(const char *key, const 
char *val);
 
    EAPI Ecore_Config_Bundle *ecore_config_bundle_new(Ecore_Config_Server * srv,
                                                const char *id);
@@ -206,16 +208,16 @@
    EAPI long                ecore_config_bundle_serial_get(Ecore_Config_Bundle 
* ns);
    EAPI char               *ecore_config_bundle_label_get(Ecore_Config_Bundle 
* ns);
 
-   EAPI int                 ecore_config_init(char *name);
+   EAPI int                 ecore_config_init(const char *name);
    EAPI int                 ecore_config_shutdown(void);
 
    EAPI int                 ecore_config_system_init(void);
    EAPI int                 ecore_config_system_shutdown(void);
 
    EAPI int                 ecore_config_load(void);
-   EAPI int                 ecore_config_file_load(char *file);
+   EAPI int                 ecore_config_file_load(const char *file);
    EAPI int                 ecore_config_save(void);
-   EAPI int                 ecore_config_file_save(char *file);
+   EAPI int                 ecore_config_file_save(const char *file);
 
 /* error codes */
 # define ECORE_CONFIG_ERR_NOTSUPP     (-16)
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ecore_config.c      29 Jan 2005 02:13:12 -0000      1.58
+++ ecore_config.c      2 Mar 2005 07:06:34 -0000       1.59
@@ -1,6 +1,7 @@
 #include "Ecore_Config.h"
 #include "config.h"
 #include "ecore_config_private.h"
+#include "ecore_config_ipc.h"
 
 #include <string.h>
 #include <ctype.h>
@@ -22,12 +23,10 @@
 char                *__ecore_config_app_name = NULL;
 int                  __ecore_config_system_init = 0;
 
-Ecore_Config_Server *_ecore_config_ipc_init(char *name);
-int                 _ecore_config_ipc_exit(void);
 static int           _ecore_config_system_init_no_load(void);
 static int           _ecore_config_system_load(void);
 
-static char        *_ecore_config_type[] =
+static const char  *_ecore_config_type[] =
    { "undefined", "integer", "float", "string", "colour", "theme", "boolean" };
 
 /**
@@ -439,7 +438,7 @@
  *         val is @c NULL, @c PT_NIL will be returned.
  */
 int
-ecore_config_type_guess(const char *key, char *val)
+ecore_config_type_guess(const char *key, const char *val)
 {
    Ecore_Config_Prop  *p;
    char               *l;
@@ -467,7 +466,7 @@
 }
 
 static int
-ecore_config_typed_val(Ecore_Config_Prop * e, void *val, int type)
+ecore_config_typed_val(Ecore_Config_Prop * e, const void *val, int type)
 {
    char               *l;
    long                v;
@@ -548,7 +547,7 @@
 }
 
 static int
-ecore_config_typed_add(const char *key, void *val, int type)
+ecore_config_typed_add(const char *key, const void *val, int type)
 {
    Ecore_Config_Prop  *e;
    Ecore_Config_Bundle *t;
@@ -582,7 +581,7 @@
 }
 
 static int
-ecore_config_add(const char *key, char *val)
+ecore_config_add(const char *key, const char *val)
 {
    int                 type;
 
@@ -661,7 +660,7 @@
  * @ingroup Ecore_Config_Property_Group
  */
 int
-ecore_config_typed_set(const char *key, void *val, int type)
+ecore_config_typed_set(const char *key, const void *val, int type)
 {
    Ecore_Config_Prop  *e;
    Ecore_Config_Listener_List *l;
@@ -1030,7 +1029,7 @@
  * @ingroup Ecore_Config_Default_Group
  */
 int
-ecore_config_string_default(const char *key, char *val)
+ecore_config_string_default(const char *key, const char *val)
 {
    return ecore_config_typed_default(key, (void *)val, PT_STR);
 }
@@ -1382,14 +1381,14 @@
    return t;
 }
 
-Ecore_Config_Server *
-do_init(char *name)
+static Ecore_Config_Server *
+do_init(const char *name)
 {
    return _ecore_config_ipc_init(name);
 }
 
-Ecore_Config_Server *
-ecore_config_init_local(char *name)
+static Ecore_Config_Server *
+ecore_config_init_local(const char *name)
 {
    char               *p;
    char               *buf;
@@ -1407,8 +1406,8 @@
    return do_init(name);
 }
 
-Ecore_Config_Server *
-ecore_config_init_global(char *name)
+static Ecore_Config_Server *
+ecore_config_init_global(const char *name)
 {
    char               *p;
    int global;
@@ -1452,7 +1451,7 @@
  * @ingroup Ecore_Config_App_Lib_Group
  */
 int
-ecore_config_init(char *name)
+ecore_config_init(const char *name)
 {
    char                *path;
    Ecore_Config_Prop   *list;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_db.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_config_db.c   19 Oct 2004 07:41:36 -0000      1.3
+++ ecore_config_db.c   2 Mar 2005 07:06:34 -0000       1.4
@@ -19,7 +19,7 @@
 };
 
 Ecore_Config_DB_File *
-_ecore_config_db_open_read(char *file)
+_ecore_config_db_open_read(const char *file)
 {
    Eet_File *ef;
    Ecore_Config_DB_File *db;
@@ -27,7 +27,7 @@
    eet_init();
    db = malloc(sizeof(Ecore_Config_DB_File));
    if (!db) return NULL;
-   ef = eet_open(file, EET_FILE_MODE_READ);
+   ef = eet_open((char*)file, EET_FILE_MODE_READ);
    if (!ef)
      {
        free(db);
@@ -38,7 +38,7 @@
 }
 
 Ecore_Config_DB_File *
-_ecore_config_db_open_write(char *file)
+_ecore_config_db_open_write(const char *file)
 {
    Eet_File *ef;
    Ecore_Config_DB_File *db;
@@ -46,7 +46,7 @@
    eet_init();
    db = malloc(sizeof(Ecore_Config_DB_File));
    if (!db) return NULL;
-   ef = eet_open(file, EET_FILE_MODE_WRITE);
+   ef = eet_open((char*)file, EET_FILE_MODE_WRITE);
    if (!ef)
      {
        free(db);
@@ -71,7 +71,7 @@
    int key_count;
    int i;
    
-   keys = eet_list(db->ef, "*", &key_count);
+   keys = eet_list(db->ef, (char*)"*", &key_count);
    if (!keys)
      {
        *num_ret = 0;
@@ -84,12 +84,12 @@
 }
 
 char *
-_ecore_config_db_key_type_get(Ecore_Config_DB_File *db, char *key)
+_ecore_config_db_key_type_get(Ecore_Config_DB_File *db, const char *key)
 {
    char *data;
    int size;
    
-   data = eet_read(db->ef, key, &size);
+   data = eet_read(db->ef, (char*)key, &size);
    if (data)
      {
        if (size <= 2)
@@ -108,12 +108,12 @@
 }
 
 int
-_ecore_config_db_key_int_get(Ecore_Config_DB_File *db, char *key, int *dest)
+_ecore_config_db_key_int_get(Ecore_Config_DB_File *db, const char *key, int 
*dest)
 {
    char *data;
    int size;
    
-   data = eet_read(db->ef, key, &size);
+   data = eet_read(db->ef, (char*)key, &size);
    if (data)
      {
        int l;
@@ -147,12 +147,12 @@
 }
 
 int
-_ecore_config_db_key_float_get(Ecore_Config_DB_File *db, char *key, double 
*dest)
+_ecore_config_db_key_float_get(Ecore_Config_DB_File *db, const char *key, 
double *dest)
 {
    char *data;
    int size;
    
-   data = eet_read(db->ef, key, &size);
+   data = eet_read(db->ef, (char*)key, &size);
    if (data)
      {
        int l;
@@ -186,12 +186,12 @@
 }
 
 char *
-_ecore_config_db_key_str_get(Ecore_Config_DB_File *db, char *key)
+_ecore_config_db_key_str_get(Ecore_Config_DB_File *db, const char *key)
 {
    char *data;
    int size;
    
-   data = eet_read(db->ef, key, &size);
+   data = eet_read(db->ef, (char*)key, &size);
    if (data)
      {
        int l;
@@ -222,12 +222,12 @@
 }
 
 void *
-_ecore_config_db_key_data_get(Ecore_Config_DB_File *db, char *key, int 
*size_ret)
+_ecore_config_db_key_data_get(Ecore_Config_DB_File *db, const char *key, int 
*size_ret)
 {
    char *data;
    int size;
    
-   data = eet_read(db->ef, key, &size);
+   data = eet_read(db->ef, (char*)key, &size);
    if (data)
      {
        int l;
@@ -260,7 +260,7 @@
 }
 
 void
-_ecore_config_db_key_int_set(Ecore_Config_DB_File *db, char *key, int val)
+_ecore_config_db_key_int_set(Ecore_Config_DB_File *db, const char *key, int 
val)
 {
    char buf[256];
    int num;
@@ -271,11 +271,11 @@
    if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
    buf[3] = 0;
    buf[num - 1] = 0;
-   eet_write(db->ef, key, buf, num, 1);
+   eet_write(db->ef, (char*)key, buf, num, 1);
 }
 
 void
-_ecore_config_db_key_float_set(Ecore_Config_DB_File *db, char *key, double val)
+_ecore_config_db_key_float_set(Ecore_Config_DB_File *db, const char *key, 
double val)
 {
    char buf[256];
    int num;
@@ -286,11 +286,11 @@
    if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
    buf[5] = 0;
    buf[num - 1] = 0;
-   eet_write(db->ef, key, buf, num, 1);
+   eet_write(db->ef, (char*)key, buf, num, 1);
 }
 
 void
-_ecore_config_db_key_str_set(Ecore_Config_DB_File *db, char *key, char *str)
+_ecore_config_db_key_str_set(Ecore_Config_DB_File *db, const char *key, char 
*str)
 {
    char *buf;
    int num;
@@ -300,12 +300,12 @@
    if (!buf) return;
    strcpy(buf, "str");
    strcpy(buf + 4, str);
-   eet_write(db->ef, key, buf, num, 1);
+   eet_write(db->ef, (char*)key, buf, num, 1);
    free(buf);
 }
 
 void
-_ecore_config_db_key_data_set(Ecore_Config_DB_File *db, char *key, void *data, 
int data_size)
+_ecore_config_db_key_data_set(Ecore_Config_DB_File *db, const char *key, void 
*data, int data_size)
 {
    char *buf;
    int num;
@@ -316,6 +316,6 @@
    strcpy(buf, "data");
    memcpy(buf + 5, data, data_size);
    buf[num - 1] = 0;
-   eet_write(db->ef, key, buf, num, 1);
+   eet_write(db->ef, (char*)key, buf, num, 1);
    free(buf);
 }
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_extra.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ecore_config_extra.c        1 Dec 2004 23:07:43 -0000       1.4
+++ ecore_config_extra.c        2 Mar 2005 07:06:34 -0000       1.5
@@ -25,9 +25,6 @@
 char               *__ecore_config_app_description;
 _Ecore_Config_Arg_Callback *_ecore_config_arg_callbacks;
 
-extern int          ecore_config_bound(Ecore_Config_Prop * e);
-extern char        *ecore_config_rgb_to_argb(char *rgb);
-
 /* shorthand prop setup code to make client apps a little smaller ;) */
 
 /**
@@ -451,7 +448,7 @@
    search_len = strlen(search_path);
    
    if (loc == NULL || (loc != search_path && *(loc - 1) != '|') || 
-       (loc != (search_len - len) && *(loc + len - 1) != '|'))
+       (loc != (search_path + search_len - len) && *(loc + len - 1) != '|'))
      {
        new_search_path = malloc(search_len + len + 2); /* 2 = \0 + | */
        strcpy(new_search_path, search_path);
@@ -541,7 +538,7 @@
       ecore_config_theme_with_path_from_name_get(ecore_config_theme_get(key));
 }
 
-static char        *_ecore_config_short_types[] =
+static const char  *_ecore_config_short_types[] =
    { "      ", "<int> ", "<flt> ", "<str> ", "<rgb> ", "<str> ", "<bool>" };
 
 /**
@@ -705,8 +702,8 @@
                            ecore_config_parse_set(prop, argv[++nextarg],
                                                   long_opt,
                                                   '\0')) !=
-                          ECORE_CONFIG_PARSE_CONTINUE);
-                      return ret;
+                          ECORE_CONFIG_PARSE_CONTINUE)
+                         return ret;
                       break;
                    }
                  prop = prop->next;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_ipc.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_config_ipc.h  13 Oct 2004 19:43:16 -0000      1.1
+++ ecore_config_ipc.h  2 Mar 2005 07:06:34 -0000       1.2
@@ -20,6 +20,9 @@
    IPC_LAST
 } Ecore_Config_Ipc_Call;
 
+Ecore_Config_Server *_ecore_config_ipc_init(const char *pipe_name);
+int                  _ecore_config_ipc_exit(void);
+
 Ecore_Config_Server *_ecore_config_server_convert(void *srv);
 
 char               *_ecore_config_ipc_prop_list(Ecore_Config_Server * srv,
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_ipc_ecore.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ecore_config_ipc_ecore.c    19 Oct 2004 06:34:20 -0000      1.2
+++ ecore_config_ipc_ecore.c    2 Mar 2005 07:06:34 -0000       1.3
@@ -19,6 +19,7 @@
 #include "Ecore_Config.h"
 #include "config.h"
 
+#if 0 /* FIXME - No prototypes? */
 /*****************************************************************************/
 
 static int
@@ -44,7 +45,7 @@
    return ECORE_CONFIG_ERR_SUCC;
 }
 
-char               *
+static char               *
 _ecore_config_ipc_global_prop_list(Ecore_Config_Server * srv, const long 
serial)
 {
    Ecore_Config_DB_File  *db;
@@ -75,7 +76,7 @@
        for (x = 0; x < key_count; x++)
          {
             type = _ecore_config_db_key_type_get(db, keys[x]);
-            if (!type) type = "?";
+            if (!type) type = strdup("?");
             if (!strcmp(type, "int"))
               estring_appendf(s, "%s%s: integer", f ? "\n" : "", keys[x]);
             else if (!strcmp(type, "float"))
@@ -375,3 +376,4 @@
 }
 
 /*****************************************************************************/
+#endif
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_ipc_main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_config_ipc_main.c     13 Oct 2004 19:43:16 -0000      1.1
+++ ecore_config_ipc_main.c     2 Mar 2005 07:06:34 -0000       1.2
@@ -26,7 +26,7 @@
 {
    void               *lib;
    void               *data;
-   int                 (*ipc_init) (char *pipe_name, void **data);
+   int                 (*ipc_init) (const char *pipe_name, void **data);
    int                 (*ipc_exit) (void **data);
    int                 (*ipc_poll) (void **data);
    struct _ecore_config_ipc *next;
@@ -273,7 +273,7 @@
 }
 
 Ecore_Config_Server *
-_ecore_config_ipc_init(char *pipe_name)
+_ecore_config_ipc_init(const char *pipe_name)
 {
    char                buf[PATH_MAX];
    glob_t              globbuf;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_private.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_config_private.h      19 Oct 2004 06:34:20 -0000      1.3
+++ ecore_config_private.h      2 Mar 2005 07:06:34 -0000       1.4
@@ -8,18 +8,18 @@
 
 typedef struct _Ecore_Config_DB_File Ecore_Config_DB_File;
 
-Ecore_Config_DB_File *_ecore_config_db_open_read(char *file);
-Ecore_Config_DB_File *_ecore_config_db_open_write(char *file);
+Ecore_Config_DB_File *_ecore_config_db_open_read(const char *file);
+Ecore_Config_DB_File *_ecore_config_db_open_write(const char *file);
 void                  _ecore_config_db_close(Ecore_Config_DB_File *db);
 char                **_ecore_config_db_keys_get(Ecore_Config_DB_File *db, int 
*num_ret);
-char                 *_ecore_config_db_key_type_get(Ecore_Config_DB_File *db, 
char *key);
-int                   _ecore_config_db_key_int_get(Ecore_Config_DB_File *db, 
char *key, int *dest);
-int                   _ecore_config_db_key_float_get(Ecore_Config_DB_File *db, 
char *key, double *dest);
-char                 *_ecore_config_db_key_str_get(Ecore_Config_DB_File *db, 
char *key);
-void                 *_ecore_config_db_key_data_get(Ecore_Config_DB_File *db, 
char *key, int *size_ret);
-void                  _ecore_config_db_key_int_set(Ecore_Config_DB_File *db, 
char *key, int val);
-void                  _ecore_config_db_key_float_set(Ecore_Config_DB_File *db, 
char *key, double val);
-void                  _ecore_config_db_key_str_set(Ecore_Config_DB_File *db, 
char *key, char *str);
-void                  _ecore_config_db_key_data_set(Ecore_Config_DB_File *db, 
char *key, void *data, int data_size);
+char                 *_ecore_config_db_key_type_get(Ecore_Config_DB_File *db, 
const char *key);
+int                   _ecore_config_db_key_int_get(Ecore_Config_DB_File *db, 
const char *key, int *dest);
+int                   _ecore_config_db_key_float_get(Ecore_Config_DB_File *db, 
const char *key, double *dest);
+char                 *_ecore_config_db_key_str_get(Ecore_Config_DB_File *db, 
const char *key);
+void                 *_ecore_config_db_key_data_get(Ecore_Config_DB_File *db, 
const char *key, int *size_ret);
+void                  _ecore_config_db_key_int_set(Ecore_Config_DB_File *db, 
const char *key, int val);
+void                  _ecore_config_db_key_float_set(Ecore_Config_DB_File *db, 
const char *key, double val);
+void                  _ecore_config_db_key_str_set(Ecore_Config_DB_File *db, 
const char *key, char *str);
+void                  _ecore_config_db_key_data_set(Ecore_Config_DB_File *db, 
const char *key, void *data, int data_size);
 
 #endif
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_storage.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- ecore_config_storage.c      27 Nov 2004 23:14:30 -0000      1.5
+++ ecore_config_storage.c      2 Mar 2005 07:06:34 -0000       1.6
@@ -52,7 +52,7 @@
  * @ingroup Ecore_Config_File_Group
  */
 int
-ecore_config_file_load(char *file)
+ecore_config_file_load(const char *file)
 {
    Ecore_Config_DB_File  *db;
    char                 **keys;
@@ -80,7 +80,7 @@
        for (x = 0; x < key_count; x++)
          {
             type = _ecore_config_db_key_type_get(db, keys[x]);
-            if (!type) type = "?";
+            if (!type) type = strdup("?");
             if (!strcmp(type, "int"))
               {
                  if (_ecore_config_db_key_int_get(db, keys[x], &itmp))
@@ -160,7 +160,7 @@
 }
 
 static void
-_ecore_config_recurse_mkdir(char *file)
+_ecore_config_recurse_mkdir(const char *file)
 {
    char               *file_ptr;
    char               *file_tmp;
@@ -189,7 +189,7 @@
  * @ingroup Ecore_Config_File_Group
  */
 int
-ecore_config_file_save(char *file)
+ecore_config_file_save(const char *file)
 {
    Ecore_Config_Prop    *next;
    Ecore_Config_DB_File *db;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_util.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_config_util.c 13 Oct 2004 19:43:16 -0000      1.1
+++ ecore_config_util.c 2 Mar 2005 07:06:34 -0000       1.2
@@ -16,6 +16,8 @@
 /* #  include <glib/gmain.h> */
 /* #endif */
 
+#include "ecore_private.h"
+
 #include "Ecore_Config.h"
 #include "ecore_config_util.h"
 
@@ -28,7 +30,7 @@
 /********/
 
 int
-dlmulti(char *name, char *file, int flag, void **libr, const char *fmt, ...)
+dlmulti(const char *name, const char *file, int flag, void **libr, const char 
*fmt, ...)
 {
 #define MAX_SYM_LEN 256
    va_list             ap;
@@ -124,6 +126,7 @@
    return ret;
 }
 
+#if 0 /* Unused */
 /*****************************************************************************/
 
 unsigned long
@@ -136,6 +139,7 @@
    r = tv.tv_sec * 1000 + (((float)tv.tv_usec) / 1000.0) + delay;
    return r;
 }
+#endif
 
 /*****************************************************************************/
 
@@ -269,25 +273,37 @@
 /* TIMERS */
 /**********/
 
+#ifdef HAVE_GLIB2
+
 unsigned long
 timeout_add(uint f, int (*fun) (void *), void *data)
 {
-#ifdef HAVE_GLIB2
    return g_timeout_add((guint) f, (GSourceFunc) fun, (gpointer) data);
-#endif
-   return 0;
 }
 
 int
 timeout_remove(unsigned long handle)
 {
-#ifdef HAVE_GLIB2
    return g_source_remove(handle) ? ECORE_CONFIG_ERR_SUCC :
       ECORE_CONFIG_ERR_FAIL;
-#endif
+}
+
+#else
+
+unsigned long
+timeout_add(uint f __UNUSED__, int (*fun) (void *) __UNUSED__, void *data 
__UNUSED__)
+{
+   return 0;
+}
+
+int
+timeout_remove(unsigned long handle __UNUSED__)
+{
    return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
+#endif /* HAVE_GLIB2 */
+
 /*****************************************************************************/
 /* HASHES */
 /**********/
@@ -374,74 +390,101 @@
 /* HASHES */
 /**********/
 
+#ifdef HAVE_GLIB2
+
 void               *
 hash_table_new(void (*freekey), void (*freeval))
 {
-#ifdef HAVE_GLIB2
    return g_hash_table_new_full(g_str_hash, g_str_equal, freekey, freeval);
-#endif
-   return NULL;
 }
 
 void               *
 hash_table_fetch(void *hashtable, char *key)
 {
-#ifdef HAVE_GLIB2
    return g_hash_table_lookup(hashtable, key);
-#endif
-   return NULL;
 }
 
 int
 hash_table_insert(void *hashtable, char *key, void *value)
 {
-#ifdef HAVE_GLIB2
    g_hash_table_insert(hashtable, key, value);
    return ECORE_CONFIG_ERR_SUCC;
-#endif
-   return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
 int
 hash_table_replace(void *hashtable, char *key, void *value)
 {
-#ifdef HAVE_GLIB2
    g_hash_table_replace(hashtable, key, value);
    return ECORE_CONFIG_ERR_SUCC;
-#endif
-   return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
 int
 hash_table_remove(void *hashtable, char *key)
 {
-#ifdef HAVE_GLIB2
    g_hash_table_remove(hashtable, key);
    return ECORE_CONFIG_ERR_SUCC;
-#endif
-   return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
 int
 hash_table_dst(void *hashtable)
 {
-#ifdef HAVE_GLIB2
    g_hash_table_destroy(hashtable);
    return ECORE_CONFIG_ERR_SUCC;
-#endif
-   return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
 int
 hash_table_walk(void *hashtable, hash_walker fun, void *data)
 {
-#ifdef HAVE_GLIB2
    g_hash_table_foreach(hashtable, (GHFunc) fun, data);
    return ECORE_CONFIG_ERR_SUCC;
-#endif
+}
+
+#else
+
+void               *
+hash_table_new(void (*freekey) __UNUSED__, void (*freeval) __UNUSED__)
+{
+   return NULL;
+}
+
+void               *
+hash_table_fetch(void *hashtable __UNUSED__, char *key __UNUSED__)
+{
+   return NULL;
+}
+
+int
+hash_table_insert(void *hashtable __UNUSED__, char *key __UNUSED__, void 
*value __UNUSED__)
+{
    return ECORE_CONFIG_ERR_NOTSUPP;
 }
 
+int
+hash_table_replace(void *hashtable __UNUSED__, char *key __UNUSED__, void 
*value __UNUSED__)
+{
+   return ECORE_CONFIG_ERR_NOTSUPP;
+}
+
+int
+hash_table_remove(void *hashtable __UNUSED__, char *key __UNUSED__)
+{
+   return ECORE_CONFIG_ERR_NOTSUPP;
+}
+
+int
+hash_table_dst(void *hashtable __UNUSED__)
+{
+   return ECORE_CONFIG_ERR_NOTSUPP;
+}
+
+int
+hash_table_walk(void *hashtable __UNUSED__, hash_walker fun __UNUSED__, void 
*data __UNUSED__)
+{
+   return ECORE_CONFIG_ERR_NOTSUPP;
+}
+
+#endif /* HAVE_GLIB2 */
+
 /*****************************************************************************/
 /* STRINGS */
 /***********/
@@ -509,7 +552,7 @@
 }
 
 int
-estring_printf(estring * e, char *fmt, ...)
+estring_printf(estring * e, const char *fmt, ...)
 {
    int                 need;
    va_list             ap;
@@ -550,7 +593,7 @@
 }
 
 int
-estring_appendf(estring * e, char *fmt, ...)
+estring_appendf(estring * e, const char *fmt, ...)
 {
    int                 need;
    va_list             ap;
@@ -595,7 +638,7 @@
 }
 
 int
-esprintf(char **result, char *fmt, ...)
+esprintf(char **result, const char *fmt, ...)
 {
    int                 need, have;
    va_list             ap;
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config_util.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ecore_config_util.h 13 Oct 2004 19:43:16 -0000      1.1
+++ ecore_config_util.h 2 Mar 2005 07:06:34 -0000       1.2
@@ -20,7 +20,7 @@
 void                qsrt(void *a[], void *data, int lo, int hi,
                         int (*compare) (const void *, const void *,
                                         const void *));
-int                 dlmulti(char *name, char *file, int flag, void **libr,
+int                 dlmulti(const char *name, const char *file, int flag, void 
**libr,
                            const char *fmt, ...);
 
 typedef void        (*hash_walker) (char *key, void *value, void *data);
@@ -48,14 +48,14 @@
 estring            *estring_dst(estring * e);
 char               *estring_disown(estring * e);
 char               *estring_free(estring * e, int release_payload);    /* glib 
compat */
-int                 estring_printf(estring * e, char *fmt, ...);
-int                 estring_appendf(estring * e, char *fmt, ...);
+int                 estring_printf(estring * e, const char *fmt, ...);
+int                 estring_appendf(estring * e, const char *fmt, ...);
 int                 estring_truncate(estring * e, int size);
 
 #define  ESTRING_GET_CSTRING(a) ((a)->str)
 
-int                 esprintf(char **result, char *fmt, ...);
-int                 ejoin(char **result, char *delim, ...);
+int                 esprintf(char **result, const char *fmt, ...);
+int                 ejoin(char **result, const char *delim, ...);
 int                 ecat(char **result, ...);
 
 unsigned long       timeout_add(unsigned int f, int (*fun) (void *),




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to