Mercurial > pidgin
annotate src/plugin.h @ 8081:c76d7f5ab335
[gaim-migrate @ 8780]
Well this fixes perl plugins for the time being. If someone
wants to fix it for real feel frizee.
I couldn't find where STATIC is defined.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Mon, 12 Jan 2004 05:42:09 +0000 |
| parents | fa6395637e2c |
| children | 6b1ecf40f3ba |
| rev | line source |
|---|---|
| 5205 | 1 /** |
| 2 * @file plugin.h Plugin API | |
| 3 * @ingroup core | |
| 4 * | |
| 5 * gaim | |
| 6 * | |
| 8046 | 7 * Gaim is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 * source distribution. | |
|
6485
70d5122bc3ff
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
5949
diff
changeset
|
10 * |
| 5205 | 11 * This program is free software; you can redistribute it and/or modify |
| 12 * it under the terms of the GNU General Public License as published by | |
| 13 * the Free Software Foundation; either version 2 of the License, or | |
| 14 * (at your option) any later version. | |
| 15 * | |
| 16 * This program is distributed in the hope that it will be useful, | |
| 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 * GNU General Public License for more details. | |
| 20 * | |
| 21 * You should have received a copy of the GNU General Public License | |
| 22 * along with this program; if not, write to the Free Software | |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 */ | |
| 25 #ifndef _GAIM_PLUGIN_H_ | |
| 26 #define _GAIM_PLUGIN_H_ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
27 |
|
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5205
diff
changeset
|
28 #include <gmodule.h> |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
29 #include "signals.h" |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
30 #include "value.h" |
| 5205 | 31 |
| 32 typedef struct _GaimPlugin GaimPlugin; /**< GaimPlugin */ | |
| 33 typedef struct _GaimPluginInfo GaimPluginInfo; /**< GaimPluginInfo */ | |
| 34 typedef struct _GaimPluginLoaderInfo GaimPluginLoaderInfo; | |
| 35 | |
| 36 typedef int GaimPluginPriority; /**< Plugin priority. */ | |
| 37 | |
| 38 /** | |
| 39 * Plugin types. | |
| 40 */ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
41 typedef enum |
| 5205 | 42 { |
| 43 GAIM_PLUGIN_UNKNOWN = -1, /**< Unknown type. */ | |
| 44 GAIM_PLUGIN_STANDARD = 0, /**< Standard plugin. */ | |
| 45 GAIM_PLUGIN_LOADER, /**< Loader plugin. */ | |
| 46 GAIM_PLUGIN_PROTOCOL /**< Protocol plugin. */ | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
47 |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
48 } GaimPluginType; |
| 5205 | 49 |
| 50 #define GAIM_PRIORITY_DEFAULT 0 | |
| 51 #define GAIM_PRIORITY_HIGHEST 9999 | |
| 52 #define GAIM_PRIORITY_LOWEST -9999 | |
| 53 | |
|
6928
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
54 #define GAIM_PLUGIN_FLAG_INVISIBLE 0x01 |
|
6ed0a1c045b4
[gaim-migrate @ 7475]
Christian Hammond <chipx86@chipx86.com>
parents:
6822
diff
changeset
|
55 |
| 5205 | 56 /** |
| 57 * Detailed information about a plugin. | |
| 58 * | |
| 59 * This is used in the version 2.0 API and up. | |
| 60 */ | |
| 61 struct _GaimPluginInfo | |
| 62 { | |
| 63 unsigned int api_version; | |
| 64 GaimPluginType type; | |
| 65 char *ui_requirement; | |
| 66 unsigned long flags; | |
| 67 GList *dependencies; | |
| 68 GaimPluginPriority priority; | |
| 69 | |
| 70 char *id; | |
| 71 char *name; | |
| 72 char *version; | |
| 73 char *summary; | |
| 74 char *description; | |
| 75 char *author; | |
| 76 char *homepage; | |
| 77 | |
| 78 gboolean (*load)(GaimPlugin *plugin); | |
| 79 gboolean (*unload)(GaimPlugin *plugin); | |
| 80 void (*destroy)(GaimPlugin *plugin); | |
| 81 | |
| 82 void *ui_info; | |
| 83 void *extra_info; | |
| 84 }; | |
| 85 | |
| 86 /** | |
| 87 * Extra information for loader plugins. | |
| 88 */ | |
| 89 struct _GaimPluginLoaderInfo | |
| 90 { | |
| 91 GList *exts; | |
| 92 | |
| 93 gboolean (*probe)(GaimPlugin *plugin); | |
| 94 gboolean (*load)(GaimPlugin *plugin); | |
| 95 gboolean (*unload)(GaimPlugin *plugin); | |
| 96 void (*destroy)(GaimPlugin *plugin); | |
| 97 }; | |
| 98 | |
| 99 /** | |
| 100 * A plugin handle. | |
| 101 */ | |
| 102 struct _GaimPlugin | |
| 103 { | |
| 104 gboolean native_plugin; /**< Native C plugin. */ | |
| 105 gboolean loaded; /**< The loaded state. */ | |
| 106 void *handle; /**< The module handle. */ | |
| 107 char *path; /**< The path to the plugin. */ | |
| 108 GaimPluginInfo *info; /**< The plugin information. */ | |
| 109 char *error; | |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
110 void *ipc_data; /**< IPC data. */ |
| 5205 | 111 void *extra; /**< Plugin-specific data. */ |
| 112 }; | |
| 113 | |
| 114 #define GAIM_PLUGIN_LOADER_INFO(plugin) \ | |
| 115 ((GaimPluginLoaderInfo *)(plugin)->info->extra_info) | |
| 116 | |
| 117 /** | |
| 118 * Handles the initialization of modules. | |
| 119 */ | |
| 8081 | 120 //if !defined(GAIM_PLUGINS) || defined(STATIC) |
| 121 #if !defined(GAIM_PLUGINS) | |
| 5205 | 122 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
| 123 gboolean gaim_init_##pluginname##_plugin(void) { \ | |
| 124 GaimPlugin *plugin = gaim_plugin_new(TRUE, NULL); \ | |
| 125 plugin->info = &(plugininfo); \ | |
| 126 initfunc((plugin)); \ | |
| 127 return gaim_plugin_register(plugin); \ | |
| 128 } | |
| 8081 | 129 //else /* GAIM_PLUGINS && !STATIC */ |
| 130 #else /* GAIM_PLUGINS */ | |
| 5205 | 131 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \ |
|
5224
5160333a80df
[gaim-migrate @ 5594]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
5205
diff
changeset
|
132 G_MODULE_EXPORT gboolean gaim_init_plugin(GaimPlugin *plugin) { \ |
| 5205 | 133 plugin->info = &(plugininfo); \ |
| 134 initfunc((plugin)); \ | |
| 135 return gaim_plugin_register(plugin); \ | |
| 136 } | |
| 137 #endif | |
| 138 | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
139 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
140 extern "C" { |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
141 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
142 |
| 5205 | 143 /**************************************************************************/ |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
144 /** @name Plugin API */ |
| 5205 | 145 /**************************************************************************/ |
| 146 /*@{*/ | |
| 147 | |
| 148 /** | |
| 149 * Creates a new plugin structure. | |
| 150 * | |
| 151 * @param native Whether or not the plugin is native. | |
| 152 * @param path The path to the plugin, or @c NULL if statically compiled. | |
| 153 * | |
| 154 * @return A new GaimPlugin structure. | |
| 155 */ | |
| 156 GaimPlugin *gaim_plugin_new(gboolean native, const char *path); | |
| 157 | |
| 158 /** | |
| 159 * Probes a plugin, retrieving the information on it and adding it to the | |
| 160 * list of available plugins. | |
| 161 * | |
| 162 * @param filename The plugin's filename. | |
| 163 * | |
| 164 * @return The plugin handle. | |
| 165 * | |
| 166 * @see gaim_plugin_load() | |
| 167 * @see gaim_plugin_destroy() | |
| 168 */ | |
| 169 GaimPlugin *gaim_plugin_probe(const char *filename); | |
| 170 | |
| 171 /** | |
| 172 * Registers a plugin and prepares it for loading. | |
| 173 * | |
| 174 * This shouldn't be called by anything but the internal module code. | |
| 175 * | |
| 176 * @param plugin The plugin to register. | |
| 177 */ | |
| 178 gboolean gaim_plugin_register(GaimPlugin *plugin); | |
| 179 | |
| 180 /** | |
| 181 * Attempts to load a previously probed plugin. | |
| 182 * | |
|
6720
41120df7ed94
[gaim-migrate @ 7247]
Christian Hammond <chipx86@chipx86.com>
parents:
6486
diff
changeset
|
183 * @param plugin The plugin to load. |
| 5205 | 184 * |
| 185 * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 186 * | |
| 187 * @see gaim_plugin_reload() | |
| 188 * @see gaim_plugin_unload() | |
| 189 */ | |
| 190 gboolean gaim_plugin_load(GaimPlugin *plugin); | |
| 191 | |
| 192 /** | |
| 193 * Unloads the specified plugin. | |
| 194 * | |
| 195 * @param plugin The plugin handle. | |
| 196 * | |
| 197 * @return @c TRUE if successful, or @c FALSE otherwise. | |
| 198 * | |
| 199 * @see gaim_plugin_load() | |
| 200 * @see gaim_plugin_reload() | |
| 201 */ | |
| 202 gboolean gaim_plugin_unload(GaimPlugin *plugin); | |
| 203 | |
| 204 /** | |
| 205 * Reloads a plugin. | |
| 206 * | |
| 207 * @param plugin The old plugin handle. | |
|
6486
fab81e4b885c
[gaim-migrate @ 7000]
Christian Hammond <chipx86@chipx86.com>
parents:
6485
diff
changeset
|
208 * |
| 5205 | 209 * @return @c TRUE if successful, or @c FALSE otherwise. |
| 210 * | |
| 211 * @see gaim_plugin_load() | |
| 212 * @see gaim_plugin_unload() | |
| 213 */ | |
| 214 gboolean gaim_plugin_reload(GaimPlugin *plugin); | |
| 215 | |
| 216 /** | |
| 217 * Unloads a plugin and destroys the structure from memory. | |
| 218 * | |
| 219 * @param plugin The plugin handle. | |
| 220 */ | |
| 221 void gaim_plugin_destroy(GaimPlugin *plugin); | |
| 222 | |
| 223 /** | |
| 224 * Returns whether or not a plugin is currently loaded. | |
| 225 * | |
| 226 * @param plugin The plugin. | |
| 227 * | |
| 228 * @return TRUE if loaded, or FALSE otherwise. | |
| 229 */ | |
| 230 gboolean gaim_plugin_is_loaded(const GaimPlugin *plugin); | |
| 231 | |
| 232 /*@}*/ | |
| 233 | |
| 234 /**************************************************************************/ | |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
235 /** @name Plugin IPC API */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
236 /**************************************************************************/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
237 /*@{*/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
238 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
239 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
240 * Registers an IPC command in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
241 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
242 * @param plugin The plugin to register the command with. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
243 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
244 * @param func The function to execute. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
245 * @param marshal The marshalling function. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
246 * @param ret_value The return value type. |
|
7114
c47633e9e2a4
[gaim-migrate @ 7681]
Christian Hammond <chipx86@chipx86.com>
parents:
7034
diff
changeset
|
247 * @param num_params The number of parameters. |
|
6822
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
248 * @param ... The parameter types. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
249 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
250 * @return TRUE if the function was registered successfully, or |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
251 * FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
252 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
253 gboolean gaim_plugin_ipc_register(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
254 GaimCallback func, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
255 GaimSignalMarshalFunc marshal, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
256 GaimValue *ret_value, int num_params, ...); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
257 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
258 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
259 * Unregisters an IPC command in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
260 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
261 * @param plugin The plugin to unregister the command from. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
262 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
263 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
264 void gaim_plugin_ipc_unregister(GaimPlugin *plugin, const char *command); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
265 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
266 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
267 * Unregisters all IPC commands in a plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
268 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
269 * @param plugin The plugin to unregister the commands from. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
270 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
271 void gaim_plugin_ipc_unregister_all(GaimPlugin *plugin); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
272 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
273 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
274 * Returns a list of value types used for an IPC command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
275 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
276 * @param plugin The plugin. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
277 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
278 * @param ret_value The returned return value. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
279 * @param num_params The returned number of parameters. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
280 * @param params The returned list of parameters. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
281 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
282 * @return TRUE if the command was found, or FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
283 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
284 gboolean gaim_plugin_ipc_get_params(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
285 GaimValue **ret_value, int *num_params, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
286 GaimValue ***params); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
287 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
288 /** |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
289 * Executes an IPC command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
290 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
291 * @param plugin The plugin to execute the command on. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
292 * @param command The name of the command. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
293 * @param ok TRUE if the call was successful, or FALSE otherwise. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
294 * @param ... The parameters to pass. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
295 * |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
296 * @return The return value, which will be NULL if the command doesn't |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
297 * return a value. |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
298 */ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
299 void *gaim_plugin_ipc_call(GaimPlugin *plugin, const char *command, |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
300 gboolean *ok, ...); |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
301 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
302 /*@}*/ |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
303 |
|
7dba3e17cb21
[gaim-migrate @ 7366]
Christian Hammond <chipx86@chipx86.com>
parents:
6720
diff
changeset
|
304 /**************************************************************************/ |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
305 /** @name Plugins API */ |
| 5205 | 306 /**************************************************************************/ |
| 307 /*@{*/ | |
| 308 | |
| 309 /** | |
| 310 * Sets the search paths for plugins. | |
| 311 * | |
| 312 * @param count The number of search paths. | |
| 313 * @param paths The search paths. | |
| 314 */ | |
| 315 void gaim_plugins_set_search_paths(size_t count, char **paths); | |
| 316 | |
| 317 /** | |
|
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
318 * Unloads all loaded plugins. |
| 5205 | 319 */ |
| 320 void gaim_plugins_unload_all(void); | |
| 321 | |
|
5242
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
322 /** |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
323 * Destroys all registered plugins. |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
324 */ |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
325 void gaim_plugins_destroy_all(void); |
|
fd81a00480ac
[gaim-migrate @ 5613]
Christian Hammond <chipx86@chipx86.com>
parents:
5224
diff
changeset
|
326 |
| 5205 | 327 /** |
|
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
328 * Attempts to load all the plugins in the specified preference key |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
329 * that were loaded when gaim last quit. |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
330 * |
|
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
331 * @param key The preference key containing the list of plugins. |
| 5838 | 332 */ |
|
5949
90d0849abd3c
[gaim-migrate @ 6393]
Christian Hammond <chipx86@chipx86.com>
parents:
5944
diff
changeset
|
333 void gaim_plugins_load_saved(const char *key); |
| 5838 | 334 |
| 335 /** | |
| 5205 | 336 * Probes for plugins in the registered module paths. |
| 337 * | |
| 338 * @param ext The extension type to probe for, or @c NULL for all. | |
| 339 * | |
| 340 * @see gaim_plugin_set_probe_path() | |
| 341 */ | |
| 342 void gaim_plugins_probe(const char *ext); | |
| 343 | |
| 344 /** | |
| 345 * Returns whether or not plugin support is enabled. | |
| 346 * | |
| 347 * @return TRUE if plugin support is enabled, or FALSE otherwise. | |
| 348 */ | |
| 349 gboolean gaim_plugins_enabled(void); | |
| 350 | |
| 351 /** | |
| 352 * Registers a function that will be called when probing is finished. | |
| 353 * | |
| 354 * @param func The callback function. | |
| 355 * @param data Data to pass to the callback. | |
| 356 */ | |
| 357 void gaim_plugins_register_probe_notify_cb(void (*func)(void *), void *data); | |
| 358 | |
| 359 /** | |
| 360 * Unregisters a function that would be called when probing is finished. | |
| 361 * | |
| 362 * @param func The callback function. | |
| 363 */ | |
| 364 void gaim_plugins_unregister_probe_notify_cb(void (*func)(void *)); | |
| 365 | |
| 366 /** | |
| 367 * Registers a function that will be called when a plugin is loaded. | |
| 368 * | |
| 369 * @param func The callback functino. | |
| 370 * @param data Data to pass to the callback. | |
| 371 */ | |
| 372 void gaim_plugins_register_load_notify_cb(void (*func)(GaimPlugin *, void *), | |
| 373 void *data); | |
| 374 | |
| 375 /** | |
| 376 * Unregisters a function that would be called when a plugin is loaded. | |
| 377 * | |
| 378 * @param func The callback functino. | |
| 379 */ | |
| 380 void gaim_plugins_unregister_load_notify_cb(void (*func)(GaimPlugin *, void *)); | |
| 381 | |
| 382 /** | |
| 383 * Registers a function that will be called when a plugin is unloaded. | |
| 384 * | |
| 385 * @param func The callback functino. | |
| 386 * @param data Data to pass to the callback. | |
| 387 */ | |
| 388 void gaim_plugins_register_unload_notify_cb(void (*func)(GaimPlugin *, void *), | |
| 389 void *data); | |
| 390 | |
| 391 /** | |
| 392 * Unregisters a function that would be called when a plugin is unloaded. | |
| 393 * | |
| 394 * @param func The callback functino. | |
| 395 */ | |
| 396 void gaim_plugins_unregister_unload_notify_cb(void (*func)(GaimPlugin *, | |
| 397 void *)); | |
| 398 | |
| 399 /** | |
| 400 * Finds a plugin with the specified name. | |
| 401 * | |
| 402 * @param name The plugin name. | |
| 403 * | |
| 404 * @return The plugin if found, or @c NULL if not found. | |
| 405 */ | |
| 406 GaimPlugin *gaim_plugins_find_with_name(const char *name); | |
| 407 | |
| 408 /** | |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
409 * Finds a plugin with the specified filename (filename with a path). |
| 5205 | 410 * |
| 411 * @param filename The plugin filename. | |
| 412 * | |
| 413 * @return The plugin if found, or @c NULL if not found. | |
| 414 */ | |
| 415 GaimPlugin *gaim_plugins_find_with_filename(const char *filename); | |
| 416 | |
| 417 /** | |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
418 * Finds a plugin with the specified basename (filename without a path). |
|
7033
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
419 * |
|
7034
f7ff0dfa6b9f
[gaim-migrate @ 7597]
Christian Hammond <chipx86@chipx86.com>
parents:
7033
diff
changeset
|
420 * @param basename The plugin basename. |
|
7033
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
421 * |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
422 * @return The plugin if found, or @c NULL if not found. |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
423 */ |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
424 GaimPlugin *gaim_plugins_find_with_basename(const char *basename); |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
425 |
|
cf1126ba1834
[gaim-migrate @ 7596]
Christian Hammond <chipx86@chipx86.com>
parents:
6928
diff
changeset
|
426 /** |
| 5205 | 427 * Finds a plugin with the specified plugin ID. |
| 428 * | |
| 429 * @param id The plugin ID. | |
| 430 * | |
| 431 * @return The plugin if found, or @c NULL if not found. | |
| 432 */ | |
| 433 GaimPlugin *gaim_plugins_find_with_id(const char *id); | |
| 434 | |
| 435 /** | |
| 436 * Returns a list of all loaded plugins. | |
| 437 * | |
|
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
438 * @return A list of all loaded plugins. |
| 5205 | 439 */ |
| 440 GList *gaim_plugins_get_loaded(void); | |
| 441 | |
| 442 /** | |
|
5573
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
443 * Returns a list of all protocol plugins. |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
444 * |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
445 * @return A list of all protocol plugins. |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
446 */ |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
447 GList *gaim_plugins_get_protocols(void); |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
448 |
|
5e7de337a053
[gaim-migrate @ 5976]
Christian Hammond <chipx86@chipx86.com>
parents:
5449
diff
changeset
|
449 /** |
| 5205 | 450 * Returns a list of all plugins, whether loaded or not. |
| 451 * | |
| 452 * @return A list of all plugins. | |
| 453 */ | |
| 454 GList *gaim_plugins_get_all(void); | |
| 455 | |
| 456 /*@}*/ | |
| 457 | |
|
5944
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
458 #ifdef __cplusplus |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
459 } |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
460 #endif |
|
158196b2db19
[gaim-migrate @ 6385]
Christian Hammond <chipx86@chipx86.com>
parents:
5840
diff
changeset
|
461 |
| 5205 | 462 #endif /* _GAIM_PLUGIN_H_ */ |
