# HG changeset patch # User Daniel Atallah # Date 1218079641 0 # Node ID ae3263bfd3f564a4398e368c9f3ae909b2956f2a # Parent 907f5f41e32a56d70deeac3c0764ebd142fc4224 Another Perl loader patch from Zsombor Welker, this one adds some missing pref related functions. Fixes #4844 diff -r 907f5f41e32a -r ae3263bfd3f5 libpurple/plugins/perl/common/Prefs.xs --- 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