summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-05-16 10:28:33 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-05-16 10:28:33 +0000
commit09de5efbaa85d79e04f1c2375f5870c9aeba65f5 (patch)
tree0b16bd5e420f86ce7f2fd9004451fc4c221f2072
parent7c67f70b684870920af46c1561eedc475c4ad31f (diff)
Implement g_strfreev and add stub for g_key_file_get_string_list
-rw-r--r--eglib/gmain.c22
-rw-r--r--eglib/gmain.h5
2 files changed, 26 insertions, 1 deletions
diff --git a/eglib/gmain.c b/eglib/gmain.c
index a3fa95a9..27f168d5 100644
--- a/eglib/gmain.c
+++ b/eglib/gmain.c
@@ -1539,6 +1539,19 @@ gboolean g_str_has_suffix(const gchar *str, const gchar *suffix)
return strcmp(str + str_len - suffix_len, suffix) == 0;
}
+void g_strfreev(gchar **str_array)
+{
+ int i;
+
+ if (str_array == NULL)
+ return;
+
+ for(i = 0; str_array[i] != NULL; i++)
+ g_free(str_array[i]);
+
+ g_free(str_array);
+}
+
/* GKeyFile */
struct _GKeyFile {
@@ -1718,10 +1731,17 @@ gint g_key_file_get_integer(GKeyFile *key_file,
ret = atoi(str);
g_free(str);
-
+
return ret;
}
+gchar **g_key_file_get_string_list(GKeyFile *key_file, const gchar *group_name,
+ const gchar *key, gsize *length,
+ GError **error)
+{
+ return g_new0(gchar *, 1);
+}
+
/* GString */
#define MY_MAXSIZE ((gsize)-1)
diff --git a/eglib/gmain.h b/eglib/gmain.h
index cad321bb..1d7cdb72 100644
--- a/eglib/gmain.h
+++ b/eglib/gmain.h
@@ -252,6 +252,7 @@ gchar *g_ascii_strup(const gchar *str, gssize len);
gboolean g_str_equal(gconstpointer v1, gconstpointer v2);
gboolean g_str_has_prefix(const gchar *str, const gchar *prefix);
gboolean g_str_has_suffix(const gchar *str, const gchar *suffix);
+void g_strfreev(gchar **str_array);
#define g_new(struct_type, n_structs) \
((struct_type *) g_malloc (((gsize) sizeof (struct_type)) * ((gsize) (n_structs))))
@@ -296,6 +297,10 @@ gint g_key_file_get_integer(GKeyFile *key_file,
const gchar *key,
GError **error);
+gchar **g_key_file_get_string_list(GKeyFile *key_file,
+ const gchar *group_name,
+ const gchar *key, gsize *length,
+ GError **error);
/* GString */
typedef struct {