Tue, 22 May 2007 10:09:50 +0000
Fix _prefs_get_string_list for perl.
| 11118 | 1 | #include "module.h" |
| 2 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
3 | MODULE = Purple::Prefs PACKAGE = Purple::Prefs PREFIX = purple_prefs_ |
| 11118 | 4 | PROTOTYPES: ENABLE |
| 5 | ||
|
16773
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
6 | BOOT: |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
7 | { |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
8 | HV *stash = gv_stashpv("Purple::Pref::Type", 1); |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
9 | |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
10 | static const constiv *civ, const_iv[] = { |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
11 | #define const_iv(name) {#name, (IV)PURPLE_PREF_##name} |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
12 | const_iv(NONE), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
13 | const_iv(BOOLEAN), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
14 | const_iv(INT), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
15 | const_iv(STRING), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
16 | const_iv(STRING_LIST), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
17 | const_iv(PATH), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
18 | const_iv(PATH_LIST), |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
19 | }; |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
20 | |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
21 | for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; ) |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
22 | newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv)); |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
23 | } |
|
e1171eb45f07
Remove the const-c and const-xs stuff and replace it with real constants
Etan Reisner <deryni@pidgin.im>
parents:
15894
diff
changeset
|
24 | |
| 12780 | 25 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
26 | purple_prefs_add_bool(name, value) |
| 11118 | 27 | const char *name |
| 28 | gboolean value | |
| 29 | ||
| 12780 | 30 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
31 | purple_prefs_add_int(name, value) |
| 11118 | 32 | const char *name |
| 33 | int value | |
| 34 | ||
| 12780 | 35 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
36 | purple_prefs_add_none(name) |
| 11118 | 37 | const char *name |
| 38 | ||
| 12780 | 39 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
40 | purple_prefs_add_string(name, value) |
| 11118 | 41 | const char *name |
| 42 | const char *value | |
| 43 | ||
| 12780 | 44 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
45 | purple_prefs_add_string_list(name, value) |
| 11118 | 46 | const char *name |
| 47 | SV *value | |
| 48 | PREINIT: | |
| 12780 | 49 | GList *t_GL; |
| 50 | int i, t_len; | |
| 11118 | 51 | PPCODE: |
| 12780 | 52 | t_GL = NULL; |
| 53 | t_len = av_len((AV *)SvRV(value)); | |
| 11118 | 54 | |
| 12780 | 55 | for (i = 0; i < t_len; i++) { |
| 56 | STRLEN t_sl; | |
| 57 | t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl)); | |
| 58 | } | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
59 | purple_prefs_add_string_list(name, t_GL); |
| 11118 | 60 | |
| 12780 | 61 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
62 | purple_prefs_destroy() |
| 11118 | 63 | |
| 12780 | 64 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
65 | purple_prefs_disconnect_by_handle(handle) |
| 12780 | 66 | void * handle |
| 11118 | 67 | |
| 12780 | 68 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
69 | purple_prefs_disconnect_callback(callback_id) |
| 11118 | 70 | guint callback_id |
| 71 | ||
| 12780 | 72 | gboolean |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
73 | purple_prefs_exists(name) |
| 11118 | 74 | const char *name |
| 75 | ||
| 12780 | 76 | gboolean |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
77 | purple_prefs_get_bool(name) |
| 11118 | 78 | const char *name |
| 79 | ||
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
80 | Purple::Handle |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
81 | purple_prefs_get_handle() |
| 11118 | 82 | |
| 12780 | 83 | int |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
84 | purple_prefs_get_int(name) |
| 11118 | 85 | const char *name |
| 86 | ||
| 87 | const char * | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
88 | purple_prefs_get_string(name) |
| 11118 | 89 | const char *name |
| 90 | ||
| 91 | void | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
92 | purple_prefs_get_string_list(name) |
| 11118 | 93 | const char *name |
| 94 | PREINIT: | |
| 12780 | 95 | GList *l; |
| 11118 | 96 | PPCODE: |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
97 | for (l = purple_prefs_get_string_list(name); l != NULL; l = l->next) { |
|
17282
7d015f747d02
Fix _prefs_get_string_list for perl.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16773
diff
changeset
|
98 | XPUSHs(sv_2mortal(newSVpv(l->data, 0))); |
| 12780 | 99 | } |
| 11118 | 100 | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
101 | Purple::PrefType |
|
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
102 | purple_prefs_get_type(name) |
| 11118 | 103 | const char *name |
| 104 | ||
| 12780 | 105 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
106 | purple_prefs_init() |
| 11118 | 107 | |
| 12780 | 108 | gboolean |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
109 | purple_prefs_load() |
| 11118 | 110 | |
| 12780 | 111 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
112 | purple_prefs_remove(name) |
| 11118 | 113 | const char *name |
| 114 | ||
| 12780 | 115 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
116 | purple_prefs_rename(oldname, newname) |
| 11118 | 117 | const char *oldname |
| 118 | const char *newname | |
| 119 | ||
| 12780 | 120 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
121 | purple_prefs_rename_boolean_toggle(oldname, newname) |
| 11118 | 122 | const char *oldname |
| 123 | const char *newname | |
| 124 | ||
| 12780 | 125 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
126 | purple_prefs_set_bool(name, value) |
| 11118 | 127 | const char *name |
| 128 | gboolean value | |
| 129 | ||
| 12780 | 130 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
131 | purple_prefs_set_generic(name, value) |
| 11118 | 132 | const char *name |
| 133 | gpointer value | |
| 134 | ||
| 12780 | 135 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
136 | purple_prefs_set_int(name, value) |
| 11118 | 137 | const char *name |
| 138 | int value | |
| 139 | ||
| 12780 | 140 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
141 | purple_prefs_set_string(name, value) |
| 11118 | 142 | const char *name |
| 143 | const char *value | |
| 144 | ||
| 12780 | 145 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
146 | purple_prefs_set_string_list(name, value) |
| 11118 | 147 | const char *name |
| 148 | SV *value | |
| 149 | PREINIT: | |
| 12780 | 150 | GList *t_GL; |
| 151 | int i, t_len; | |
| 11118 | 152 | PPCODE: |
| 12780 | 153 | t_GL = NULL; |
| 154 | t_len = av_len((AV *)SvRV(value)); | |
| 11118 | 155 | |
| 12780 | 156 | for (i = 0; i < t_len; i++) { |
| 157 | STRLEN t_sl; | |
| 158 | t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(value), i, 0), t_sl)); | |
| 159 | } | |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
160 | purple_prefs_set_string_list(name, t_GL); |
| 11118 | 161 | |
| 12780 | 162 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
163 | purple_prefs_trigger_callback(name) |
| 11118 | 164 | const char *name |
| 165 | ||
| 12780 | 166 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
167 | purple_prefs_uninit() |
| 11118 | 168 | |
| 12780 | 169 | void |
|
15894
765ec644ac47
Perl fixes for s/gaim/purple/. This hasn't really been tested yet.
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
170 | purple_prefs_update_old() |