changeset 23714:ae3263bfd3f5

Another Perl loader patch from Zsombor Welker, this one adds some missing pref related functions. Fixes #4844
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 07 Aug 2008 03:27:21 +0000
parents 907f5f41e32a
children 9d7ebd28d339
files libpurple/plugins/perl/common/Prefs.xs
diffstat 1 files changed, 60 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/common/Prefs.xs	Thu Aug 07 03:10:44 2008 +0000
+++ b/libpurple/plugins/perl/common/Prefs.xs	Thu Aug 07 03:27:21 2008 +0000
@@ -60,6 +60,28 @@
 	g_list_free(t_GL);
 
 void
+purple_prefs_add_path(name, value)
+	const char *name
+	const char *value
+
+void
+purple_prefs_add_path_list(name, value)
+	const char *name
+	SV *value
+PREINIT:
+	GList *t_GL;
+	int i, t_len;
+PPCODE:
+	t_GL = NULL;
+	t_len = av_len((AV *)SvRV(value));
+
+	for (i = 0; i < t_len; i++)
+		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
+
+	purple_prefs_add_path_list(name, t_GL);
+	g_list_free(t_GL);
+
+void
 purple_prefs_destroy()
 
 guint
@@ -89,6 +111,21 @@
 purple_prefs_exists(name)
 	const char *name
 
+const char *
+purple_prefs_get_path(name)
+	const char *name
+
+void
+purple_prefs_get_path_list(name)
+	const char *name
+PREINIT:
+	GList *l;
+PPCODE:
+	for (l = purple_prefs_get_path_list(name); l != NULL; l = g_list_delete_link(l, l)) {
+		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
+		g_free(l->data);
+	}
+
 gboolean
 purple_prefs_get_bool(name)
 	const char *name
@@ -174,6 +211,29 @@
 	g_list_free(t_GL);
 
 void
+purple_prefs_set_path(name, value)
+	const char *name
+	const char *value
+
+void
+purple_prefs_set_path_list(name, value)
+	const char *name
+	SV *value
+PREINIT:
+	GList *t_GL;
+	int i, t_len;
+PPCODE:
+	t_GL = NULL;
+	t_len = av_len((AV *)SvRV(value));
+
+	for (i = 0; i < t_len; i++)
+		t_GL = g_list_append(t_GL, SvPVutf8_nolen(*av_fetch((AV *)SvRV(value), i, 0)));
+
+	purple_prefs_set_path_list(name, t_GL);
+	g_list_free(t_GL);
+
+
+void
 purple_prefs_trigger_callback(name)
 	const char *name