annotate plugins/perl/common/Prefs.xs @ 12780:c886fc7e3f24

[gaim-migrate @ 15127] Some more whitespace. I promise I'll get to real commits sooner or later. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Mon, 09 Jan 2006 06:45:16 +0000
parents b284c703d398
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
1 #include "module.h"
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
2
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
3 MODULE = Gaim::Prefs PACKAGE = Gaim::Prefs PREFIX = gaim_prefs_
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
4 PROTOTYPES: ENABLE
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
5
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
6 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
7 gaim_prefs_add_bool(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
8 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
9 gboolean value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
10
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
11 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
12 gaim_prefs_add_int(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
13 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
14 int value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
15
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
16 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
17 gaim_prefs_add_none(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
18 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
19
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
20 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
21 gaim_prefs_add_string(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
22 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
23 const char *value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
24
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
25 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
26 gaim_prefs_add_string_list(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
27 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
28 SV *value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
29 PREINIT:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
30 GList *t_GL;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
31 int i, t_len;
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
32 PPCODE:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
33 t_GL = NULL;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
34 t_len = av_len((AV *)SvRV(value));
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
35
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
36 for (i = 0; i < t_len; i++) {
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
37 STRLEN t_sl;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
38 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl));
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
39 }
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
40 gaim_prefs_add_string_list(name, t_GL);
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
41
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
42 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
43 gaim_prefs_destroy()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
44
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
45 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
46 gaim_prefs_disconnect_by_handle(handle)
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
47 void * handle
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
48
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
49 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
50 gaim_prefs_disconnect_callback(callback_id)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
51 guint callback_id
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
52
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
53 gboolean
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
54 gaim_prefs_exists(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
55 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
56
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
57 gboolean
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
58 gaim_prefs_get_bool(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
59 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
60
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
61 void *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
62 gaim_prefs_get_handle()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
63
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
64 int
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
65 gaim_prefs_get_int(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
66 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
67
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
68 const char *
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
69 gaim_prefs_get_string(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
70 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
71
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
72 void
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
73 gaim_prefs_get_string_list(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
74 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
75 PREINIT:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
76 GList *l;
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
77 PPCODE:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
78 for (l = gaim_prefs_get_string_list(name); l != NULL; l = l->next) {
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
79 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::PrefValue")));
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
80 }
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
81
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
82 Gaim::PrefType
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
83 gaim_prefs_get_type(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
84 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
85
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
86 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
87 gaim_prefs_init()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
88
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
89 gboolean
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
90 gaim_prefs_load()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
91
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
92 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
93 gaim_prefs_remove(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
94 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
95
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
96 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
97 gaim_prefs_rename(oldname, newname)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
98 const char *oldname
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
99 const char *newname
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
100
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
101 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
102 gaim_prefs_rename_boolean_toggle(oldname, newname)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
103 const char *oldname
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
104 const char *newname
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
105
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
106 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
107 gaim_prefs_set_bool(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
108 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
109 gboolean value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
110
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
111 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
112 gaim_prefs_set_generic(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
113 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
114 gpointer value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
115
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
116 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
117 gaim_prefs_set_int(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
118 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
119 int value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
120
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
121 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
122 gaim_prefs_set_string(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
123 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
124 const char *value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
125
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
126 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
127 gaim_prefs_set_string_list(name, value)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
128 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
129 SV *value
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
130 PREINIT:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
131 GList *t_GL;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
132 int i, t_len;
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
133 PPCODE:
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
134 t_GL = NULL;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
135 t_len = av_len((AV *)SvRV(value));
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
136
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
137 for (i = 0; i < t_len; i++) {
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
138 STRLEN t_sl;
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
139 t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl));
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
140 }
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
141 gaim_prefs_set_string_list(name, t_GL);
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
142
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
143 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
144 gaim_prefs_trigger_callback(name)
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
145 const char *name
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
146
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
147 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
148 gaim_prefs_uninit()
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
149
12780
c886fc7e3f24 [gaim-migrate @ 15127]
Etan Reisner <pidgin@unreliablesource.net>
parents: 11290
diff changeset
150 void
11118
134d0001983d [gaim-migrate @ 13174]
John H. Kelm <johnkelm@gmail.com>
parents:
diff changeset
151 gaim_prefs_update_old()