annotate src/audacious/pluginenum.c @ 3741:a1b31fe5a249

export ip_data and cfg
author William Pitcock <nenolod@atheme.org>
date Sat, 13 Oct 2007 23:43:45 -0500
parents 48a596a86459
children e2f8feddbb19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
1 /* Audacious - Cross-platform multimedia player
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
2 * Copyright (C) 2005-2007 Audacious development team
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
3 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
4 * Based on BMP:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
5 * Copyright (C) 2003-2004 BMP development team
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
6 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
7 * Based on XMMS:
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
8 * Copyright (C) 1998-2003 XMMS development team
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
9 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2825
diff changeset
12 * the Free Software Foundation; under version 3 of the License.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
13 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
18 *
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
3121
3b6d316f8b09 GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents: 2825
diff changeset
20 * along with this program. If not, see <http://www.gnu.org/licenses>.
3123
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
21 *
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
22 * The Audacious team does not consider modular code linking to
f1c756f39e6c Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents: 3121
diff changeset
23 * Audacious or using our public API to be a derived work.
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
24 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
25
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
26 #ifdef HAVE_CONFIG_H
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
27 # include "config.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
28 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
29
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
30 #ifndef SHARED_SUFFIX
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
31 # define SHARED_SUFFIX G_MODULE_SUFFIX
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
32 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
33
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
34 #include <glib.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
35 #include <gmodule.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
36 #include <glib/gprintf.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
37 #include <string.h>
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
38
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
39 #include "main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
40 #include "ui_main.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
41 #include "playback.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
42 #include "playlist.h"
2373
ad1d7687814c [svn] made strings.h for existing strings.c, cleanups
mf0102
parents: 2313
diff changeset
43 #include "strings.h"
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
44 #include "util.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
45
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
46 #include "effect.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
47 #include "general.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
48 #include "input.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
49 #include "output.h"
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
50 #include "visualization.h"
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
51 #include "discovery.h"
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
52
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
53 #include "pluginenum.h"
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
54
3684
2f9d8b987e40 Export VfsBuffer functions.
William Pitcock <nenolod@atheme.org>
parents: 3683
diff changeset
55 #include "vfs_buffer.h"
3685
0ba593887cae Export VfsBufferedFile functions.
William Pitcock <nenolod@atheme.org>
parents: 3684
diff changeset
56 #include "vfs_buffered_file.h"
3684
2f9d8b987e40 Export VfsBuffer functions.
William Pitcock <nenolod@atheme.org>
parents: 3683
diff changeset
57
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
58 const gchar *plugin_dir_list[] = {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
59 PLUGINSUBS,
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
60 NULL
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
61 };
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
62
3682
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
63 /*****************************************************************/
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
64
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
65 static struct _AudaciousFuncTableV1 _aud_papi_v1 = {
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
66 .vfs_fopen = vfs_fopen,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
67 .vfs_fclose = vfs_fclose,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
68 .vfs_dup = vfs_dup,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
69 .vfs_fread = vfs_fread,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
70 .vfs_fwrite = vfs_fwrite,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
71 .vfs_getc = vfs_getc,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
72 .vfs_ungetc = vfs_ungetc,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
73 .vfs_fgets = vfs_fgets,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
74 .vfs_fseek = vfs_fseek,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
75 .vfs_rewind = vfs_rewind,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
76 .vfs_ftell = vfs_ftell,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
77 .vfs_feof = vfs_feof,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
78 .vfs_file_test = vfs_file_test,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
79 .vfs_is_writeable = vfs_is_writeable,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
80 .vfs_truncate = vfs_truncate,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
81 .vfs_fsize = vfs_fsize,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
82 .vfs_get_metadata = vfs_get_metadata,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
83 .vfs_fprintf = vfs_fprintf,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
84 .vfs_register_transport = vfs_register_transport,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
85 .vfs_file_get_contents = vfs_file_get_contents,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
86 .vfs_is_remote = vfs_is_remote,
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
87 .vfs_is_streaming = vfs_is_streaming,
3684
2f9d8b987e40 Export VfsBuffer functions.
William Pitcock <nenolod@atheme.org>
parents: 3683
diff changeset
88
2f9d8b987e40 Export VfsBuffer functions.
William Pitcock <nenolod@atheme.org>
parents: 3683
diff changeset
89 .vfs_buffer_new = vfs_buffer_new,
2f9d8b987e40 Export VfsBuffer functions.
William Pitcock <nenolod@atheme.org>
parents: 3683
diff changeset
90 .vfs_buffer_new_from_string = vfs_buffer_new_from_string,
3685
0ba593887cae Export VfsBufferedFile functions.
William Pitcock <nenolod@atheme.org>
parents: 3684
diff changeset
91
0ba593887cae Export VfsBufferedFile functions.
William Pitcock <nenolod@atheme.org>
parents: 3684
diff changeset
92 .vfs_buffered_file_new_from_uri = vfs_buffered_file_new_from_uri,
0ba593887cae Export VfsBufferedFile functions.
William Pitcock <nenolod@atheme.org>
parents: 3684
diff changeset
93 .vfs_buffered_file_release_live_fd = vfs_buffered_file_release_live_fd,
3687
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
94
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
95 .cfg_db_open = cfg_db_open,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
96 .cfg_db_close = cfg_db_close,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
97
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
98 .cfg_db_get_string = cfg_db_get_string,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
99 .cfg_db_get_int = cfg_db_get_int,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
100 .cfg_db_get_bool = cfg_db_get_bool,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
101 .cfg_db_get_float = cfg_db_get_float,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
102 .cfg_db_get_double = cfg_db_get_double,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
103
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
104 .cfg_db_set_string = cfg_db_set_string,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
105 .cfg_db_set_int = cfg_db_set_int,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
106 .cfg_db_set_bool = cfg_db_set_bool,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
107 .cfg_db_set_float = cfg_db_set_float,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
108 .cfg_db_set_double = cfg_db_set_double,
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
109
12e11b15b549 Export ConfigDB API via vtable, adding public aliases: bmp_cfg_db_*, aud_cfg_db_*.
William Pitcock <nenolod@atheme.org>
parents: 3685
diff changeset
110 .cfg_db_unset_key = cfg_db_unset_key,
3698
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
111
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
112 .tuple_new = tuple_new,
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
113 .tuple_new_from_filename = tuple_new_from_filename,
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
114 .tuple_associate_string = tuple_associate_string,
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
115 .tuple_associate_int = tuple_associate_int,
3701
e766d3aec087 Remove non-existant function.
William Pitcock <nenolod@atheme.org>
parents: 3699
diff changeset
116 .tuple_disassociate = tuple_disassociate,
3698
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
117 .tuple_get_value_type = tuple_get_value_type,
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
118 .tuple_get_string = tuple_get_string,
0ef1a18a5583 Export Tuple API.
William Pitcock <nenolod@atheme.org>
parents: 3687
diff changeset
119 .tuple_get_int = tuple_get_int,
3699
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
120
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
121 .tuple_formatter_process_string = tuple_formatter_process_string,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
122 .tuple_formatter_process_function = tuple_formatter_process_function,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
123 .tuple_formatter_process_construct = tuple_formatter_process_construct,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
124 .tuple_formatter_process_expr = tuple_formatter_process_expr,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
125 .tuple_formatter_register_function = tuple_formatter_register_function,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
126 .tuple_formatter_register_expression = tuple_formatter_register_expression,
ddde4794b4e2 Export tuple formatter API.
William Pitcock <nenolod@atheme.org>
parents: 3698
diff changeset
127 .tuple_formatter_make_title_string = tuple_formatter_make_title_string,
3706
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
128
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
129 .mime_get_plugin = mime_get_plugin,
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
130 .mime_set_plugin = mime_set_plugin,
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
131
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
132 .uri_get_plugin = uri_get_plugin,
fc17623eb561 Export MIME/Custom URI APIs
William Pitcock <nenolod@atheme.org>
parents: 3701
diff changeset
133 .uri_set_plugin = uri_set_plugin,
3731
0e5da33a32b7 fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3706
diff changeset
134
0e5da33a32b7 fun util dialog shit -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3706
diff changeset
135 .util_info_dialog = util_info_dialog,
3736
269449ad845e vtable get_gentitle_format().
William Pitcock <nenolod@atheme.org>
parents: 3735
diff changeset
136 .get_gentitle_format = get_gentitle_format,
3734
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
137
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
138 .escape_shell_chars = escape_shell_chars,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
139 .str_append = str_append,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
140 .str_replace = str_replace,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
141 .str_replace_in = str_replace_in,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
142 .str_has_prefix_nocase = str_has_prefix_nocase,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
143 .str_has_suffix_nocase = str_has_suffix_nocase,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
144 .str_has_suffixes_nocase = str_has_suffixes_nocase,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
145 .str_to_utf8_fallback = str_to_utf8_fallback,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
146 .str_to_utf8 = str_to_utf8,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
147 .filename_to_utf8 = filename_to_utf8,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
148 .str_skip_chars = str_skip_chars,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
149 .convert_title_text = convert_title_text,
e82ec5cb017c strings API -> vtable
William Pitcock <nenolod@atheme.org>
parents: 3731
diff changeset
150 .chardet_to_utf8 = chardet_to_utf8,
3735
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
151
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
152 .playlist_container_register = playlist_container_register,
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
153 .playlist_container_unregister = playlist_container_unregister,
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
154 .playlist_container_read = playlist_container_read,
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
155 .playlist_container_write = playlist_container_write,
d41d03630f27 export PlaylistContainer API in vtable.
William Pitcock <nenolod@atheme.org>
parents: 3734
diff changeset
156 .playlist_container_find = playlist_container_find,
3738
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
157
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
158 .playlist_entry_new = playlist_entry_new,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
159 .playlist_entry_free = playlist_entry_free,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
160
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
161 .playlist_add_playlist = playlist_add_playlist,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
162 .playlist_remove_playlist = playlist_remove_playlist,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
163 .playlist_select_playlist = playlist_select_playlist,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
164 .playlist_select_next = playlist_select_next,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
165 .playlist_select_prev = playlist_select_prev,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
166 .playlist_get_playlists = playlist_get_playlists,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
167
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
168 .playlist_clear_only = playlist_clear_only,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
169 .playlist_clear = playlist_clear,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
170 .playlist_delete = playlist_delete,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
171
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
172 .playlist_add = playlist_add,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
173 .playlist_ins = playlist_ins,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
174 .playlist_add_dir = playlist_add_dir,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
175 .playlist_ins_dir = playlist_ins_dir,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
176 .playlist_add_url = playlist_add_url,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
177 .playlist_ins_url = playlist_ins_url,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
178
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
179 .playlist_check_pos_current = playlist_check_pos_current,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
180 .playlist_next = playlist_next,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
181 .playlist_prev = playlist_prev,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
182
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
183 .playlist_queue = playlist_queue,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
184 .playlist_queue_position = playlist_queue_position,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
185 .playlist_queue_remove = playlist_queue_remove,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
186 .playlist_queue_get_length = playlist_queue_get_length,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
187 .playlist_is_position_queued = playlist_is_position_queued,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
188 .playlist_clear_queue = playlist_clear_queue,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
189 .playlist_get_queue_position = playlist_get_queue_position,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
190 .playlist_get_queue_position_number = playlist_get_queue_position_number,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
191 .playlist_get_queue_qposition_number = playlist_get_queue_qposition_number,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
192
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
193 .playlist_eof_reached = playlist_eof_reached,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
194 .playlist_set_position = playlist_set_position,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
195
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
196 .playlist_get_length = playlist_get_length,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
197 .playlist_get_position = playlist_get_position,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
198 .playlist_get_position_nolock = playlist_get_position_nolock,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
199 .playlist_get_info_text = playlist_get_info_text,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
200 .playlist_get_current_length = playlist_get_current_length,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
201
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
202 .playlist_save = playlist_save,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
203 .playlist_load = playlist_load,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
204
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
205 .playlist_sort = playlist_sort,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
206 .playlist_sort_selected = playlist_sort_selected,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
207
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
208 .playlist_reverse = playlist_reverse,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
209 .playlist_random = playlist_random,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
210 .playlist_remove_duplicates = playlist_remove_duplicates,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
211 .playlist_remove_dead_files = playlist_remove_dead_files,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
212
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
213 .playlist_fileinfo_current = playlist_fileinfo_current,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
214 .playlist_fileinfo = playlist_fileinfo,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
215
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
216 .playlist_delete_index = playlist_delete_index,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
217 .playlist_delete_filenames = playlist_delete_filenames,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
218
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
219 .playlist_get_entry_to_play = playlist_get_entry_to_play,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
220
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
221 .playlist_get_filename = playlist_get_filename,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
222 .playlist_get_songtitle = playlist_get_songtitle,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
223 .playlist_get_tuple = playlist_get_tuple,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
224 .playlist_get_songtime = playlist_get_songtime,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
225
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
226 .playlist_get_selected = playlist_get_selected,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
227 .playlist_get_num_selected = playlist_get_num_selected,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
228
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
229 .playlist_get_total_time = playlist_get_total_time,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
230 .playlist_select_search = playlist_select_search,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
231 .playlist_select_all = playlist_select_all,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
232 .playlist_select_range = playlist_select_range,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
233 .playlist_select_invert_all = playlist_select_invert_all,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
234 .playlist_select_invert = playlist_select_invert,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
235
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
236 .playlist_read_info_selection = playlist_read_info_selection,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
237 .playlist_read_info = playlist_read_info,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
238
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
239 .playlist_set_shuffle = playlist_set_shuffle,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
240
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
241 .playlist_clear_selected = playlist_clear_selected,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
242
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
243 .get_playlist_nth = get_playlist_nth,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
244
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
245 .playlist_set_current_name = playlist_set_current_name,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
246 .playlist_get_current_name = playlist_get_current_name,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
247
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
248 .playlist_filename_set = playlist_filename_set,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
249 .playlist_filename_get = playlist_filename_get,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
250
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
251 .playlist_new = playlist_new,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
252 .playlist_free = playlist_free,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
253 .playlist_new_from_selected = playlist_new_from_selected,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
254
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
255 .is_playlist_name = is_playlist_name,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
256
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
257 .playlist_load_ins_file = playlist_load_ins_file,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
258 .playlist_load_ins_file_tuple = playlist_load_ins_file_tuple,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
259
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
260 .playlist_get_active = playlist_get_active,
48a596a86459 export Playlist API, remove old crap that isn't there anymore
William Pitcock <nenolod@atheme.org>
parents: 3736
diff changeset
261 .playlist_playlists_equal = playlist_playlists_equal,
3741
a1b31fe5a249 export ip_data and cfg
William Pitcock <nenolod@atheme.org>
parents: 3738
diff changeset
262
a1b31fe5a249 export ip_data and cfg
William Pitcock <nenolod@atheme.org>
parents: 3738
diff changeset
263 .ip_state = &ip_data,
a1b31fe5a249 export ip_data and cfg
William Pitcock <nenolod@atheme.org>
parents: 3738
diff changeset
264 ._cfg = &cfg,
3683
4284187479d7 Unbreak compile.
William Pitcock <nenolod@atheme.org>
parents: 3682
diff changeset
265 };
3682
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
266
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
267 /*****************************************************************/
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
268
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
269 GList *lowlevel_list = NULL;
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
270 extern GList *vfs_transports;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
271
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
272 mowgli_dictionary_t *plugin_dict = NULL;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
273
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
274 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
275 inputlist_compare_func(gconstpointer a, gconstpointer b)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
276 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
277 const InputPlugin *ap = a, *bp = b;
2804
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
278 if(ap->description && bp->description)
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
279 return strcasecmp(ap->description, bp->description);
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
280 else
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
281 return 0;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
282 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
283
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
284 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
285 outputlist_compare_func(gconstpointer a, gconstpointer b)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
286 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
287 const OutputPlugin *ap = a, *bp = b;
2804
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
288 if(ap->description && bp->description)
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
289 return strcasecmp(ap->description, bp->description);
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
290 else
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
291 return 0;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
292 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
293
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
294 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
295 effectlist_compare_func(gconstpointer a, gconstpointer b)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
296 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
297 const EffectPlugin *ap = a, *bp = b;
2804
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
298 if(ap->description && bp->description)
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
299 return strcasecmp(ap->description, bp->description);
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
300 else
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
301 return 0;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
302 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
303
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
304 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
305 generallist_compare_func(gconstpointer a, gconstpointer b)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
306 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
307 const GeneralPlugin *ap = a, *bp = b;
2804
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
308 if(ap->description && bp->description)
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
309 return strcasecmp(ap->description, bp->description);
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
310 else
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
311 return 0;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
312 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
314 static gint
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
315 vislist_compare_func(gconstpointer a, gconstpointer b)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
316 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
317 const VisPlugin *ap = a, *bp = b;
2804
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
318 if(ap->description && bp->description)
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
319 return strcasecmp(ap->description, bp->description);
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
320 else
d5c77e670be0 [svn] - temporal fix for crash in compare_func().
yaz
parents: 2801
diff changeset
321 return 0;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
322 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
323
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
324 static gint
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
325 discoverylist_compare_func(gconstpointer a, gconstpointer b)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
326 {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
327 const DiscoveryPlugin *ap = a, *bp = b;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
328 if(ap->description && bp->description)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
329 return strcasecmp(ap->description, bp->description);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
330 else
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
331 return 0;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
332 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
333
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
334 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
335 plugin_is_duplicate(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
336 {
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
337 gchar *base_filename = g_path_get_basename(filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
338
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
339 if (mowgli_dictionary_retrieve(plugin_dict, base_filename) != NULL)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
340 {
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
341 g_free(base_filename);
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
342 return TRUE;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
343 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
344
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
345 g_free(base_filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
346
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
347 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
348 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
349
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
350 gboolean
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
351 plugin_is_enabled(const gchar *filename)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
352 {
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
353 Plugin *plugin = mowgli_dictionary_retrieve(plugin_dict, filename);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
354
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
355 if (!plugin)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
356 return FALSE;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
357
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
358 return plugin->enabled;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
359 }
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
360
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
361 void
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
362 plugin_set_enabled(const gchar *filename, gboolean enabled)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
363 {
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
364 Plugin *plugin = mowgli_dictionary_retrieve(plugin_dict, filename);
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
365
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
366 if (!plugin)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
367 return;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
368
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
369 plugin->enabled = enabled;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
370 }
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
371
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
372 Plugin *
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
373 plugin_get_plugin(const gchar *filename)
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
374 {
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
375 return mowgli_dictionary_retrieve(plugin_dict, filename);
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
376 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
377
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
378 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
379 input_plugin_init(Plugin * plugin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
380 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
381 InputPlugin *p = INPUT_PLUGIN(plugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
382
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
383 p->get_vis_type = input_get_vis_type;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
384 p->add_vis_pcm = input_add_vis_pcm;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
385
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
386 /* Pretty const casts courtesy of XMMS's plugin.h legacy. Anyone
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
387 else thinks we could use a CONST macro to solve the warnings?
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
388 - descender */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
389 p->set_info = (void (*)(gchar *, gint, gint, gint, gint)) playlist_set_info_old_abi;
3165
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
390 p->set_info_text = input_set_info_text;
8775dfc57ead Remove mainwin_set_info_text() craq. Still some work to do.
William Pitcock <nenolod@atheme-project.org>
parents: 3123
diff changeset
391 p->set_status_buffering = input_set_status_buffering;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
392
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
393 ip_data.input_list = g_list_append(ip_data.input_list, p);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
394
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
395 p->enabled = TRUE;
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
396
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
397 /* XXX: we need something better than p->filename if plugins
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
398 will eventually provide multiple plugins --nenolod */
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
399 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
400 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
401
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
402 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
403 output_plugin_init(Plugin * plugin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
404 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
405 OutputPlugin *p = OUTPUT_PLUGIN(plugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
406 op_data.output_list = g_list_append(op_data.output_list, p);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
407
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
408 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
409 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
410
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
411 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
412 effect_plugin_init(Plugin * plugin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
413 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
414 EffectPlugin *p = EFFECT_PLUGIN(plugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
415 ep_data.effect_list = g_list_append(ep_data.effect_list, p);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
416
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
417 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
418 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
419
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
420 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
421 general_plugin_init(Plugin * plugin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
422 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
423 GeneralPlugin *p = GENERAL_PLUGIN(plugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
424 gp_data.general_list = g_list_append(gp_data.general_list, p);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
425
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
426 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
427 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
428
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
429 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
430 vis_plugin_init(Plugin * plugin)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
431 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
432 VisPlugin *p = VIS_PLUGIN(plugin);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
433 p->disable_plugin = vis_disable_plugin;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
434 vp_data.vis_list = g_list_append(vp_data.vis_list, p);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
435
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
436 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
437 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
438
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
439 static void
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
440 discovery_plugin_init(Plugin * plugin)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
441 {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
442 DiscoveryPlugin *p = DISCOVERY_PLUGIN(plugin);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
443 dp_data.discovery_list = g_list_append(dp_data.discovery_list, p);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
444
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
445 mowgli_dictionary_add(plugin_dict, g_basename(p->filename), p);
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
446 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
447
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
448 /*******************************************************************/
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
449
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
450 static void
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
451 plugin2_dispose(GModule *module, const gchar *str, ...)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
452 {
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
453 gchar buf[4096];
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
454 va_list va;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
455
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
456 va_start(va, str);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
457 vsnprintf(buf, 4096, str, va);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
458 va_end(va);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
459
3247
e21930ccd5a8 remove old debugging notices that aren't very relevant anymore.
William Pitcock <nenolod@atheme-project.org>
parents: 3232
diff changeset
460 g_message("*** %s\n", buf);
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
461 g_module_close(module);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
462 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
463
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
464 void
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
465 plugin2_process(PluginHeader *header, GModule *module, const gchar *filename)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
466 {
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
467 InputPlugin **ip_iter;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
468 OutputPlugin **op_iter;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
469 EffectPlugin **ep_iter;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
470 GeneralPlugin **gp_iter;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
471 VisPlugin **vp_iter;
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
472 DiscoveryPlugin **dp_iter;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
473
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
474 if (header->magic != PLUGIN_MAGIC)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
475 return plugin2_dispose(module, "plugin <%s> discarded, invalid module magic", filename);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
476
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
477 if (header->api_version != __AUDACIOUS_PLUGIN_API__)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
478 return plugin2_dispose(module, "plugin <%s> discarded, wanting API version %d, we implement API version %d",
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
479 filename, header->api_version, __AUDACIOUS_PLUGIN_API__);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
480
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
481 if (header->init)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
482 header->init();
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
483
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
484 header->priv_assoc = g_new0(Plugin, 1);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
485 header->priv_assoc->handle = module;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
486 header->priv_assoc->filename = g_strdup(filename);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
487
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
488 if (header->ip_list)
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
489 {
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
490 for (ip_iter = header->ip_list; *ip_iter != NULL; ip_iter++)
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
491 {
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
492 PLUGIN(*ip_iter)->filename = g_strdup(filename);
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
493 input_plugin_init(PLUGIN(*ip_iter));
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
494 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
495 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
496
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
497 if (header->op_list)
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
498 {
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
499 for (op_iter = header->op_list; *op_iter != NULL; op_iter++)
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
500 {
2801
8ab12f092722 [svn] - extended compatibility with v1 API
nenolod
parents: 2799
diff changeset
501 PLUGIN(*op_iter)->filename = g_strdup(filename);
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
502 output_plugin_init(PLUGIN(*op_iter));
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
503 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
504 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
505
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
506 if (header->ep_list)
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
507 {
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
508 for (ep_iter = header->ep_list; *ep_iter != NULL; ep_iter++)
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
509 {
2801
8ab12f092722 [svn] - extended compatibility with v1 API
nenolod
parents: 2799
diff changeset
510 PLUGIN(*ep_iter)->filename = g_strdup(filename);
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
511 effect_plugin_init(PLUGIN(*ep_iter));
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
512 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
513 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
514
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
515 if (header->gp_list)
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
516 {
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
517 for (gp_iter = header->gp_list; *gp_iter != NULL; gp_iter++)
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
518 {
2801
8ab12f092722 [svn] - extended compatibility with v1 API
nenolod
parents: 2799
diff changeset
519 PLUGIN(*gp_iter)->filename = g_strdup(filename);
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
520 general_plugin_init(PLUGIN(*gp_iter));
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
521 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
522 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
523
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
524 if (header->vp_list)
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
525 {
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
526 for (vp_iter = header->vp_list; *vp_iter != NULL; vp_iter++)
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
527 {
2801
8ab12f092722 [svn] - extended compatibility with v1 API
nenolod
parents: 2799
diff changeset
528 PLUGIN(*vp_iter)->filename = g_strdup(filename);
2799
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
529 vis_plugin_init(PLUGIN(*vp_iter));
febdfe7a482b [svn] - improve plugin2 loader's robustness (e.g. make it not crash)
nenolod
parents: 2798
diff changeset
530 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
531 }
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
532
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
533 if (header->dp_list)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
534 {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
535 for (dp_iter = header->dp_list; *dp_iter != NULL; dp_iter++)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
536 {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
537 PLUGIN(*dp_iter)->filename = g_strdup(filename);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
538 discovery_plugin_init(PLUGIN(*dp_iter));
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
539 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
540 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
541 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
542
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
543 void
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
544 plugin2_unload(PluginHeader *header)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
545 {
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
546 GModule *module;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
547
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
548 g_return_if_fail(header->priv_assoc != NULL);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
549
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
550 module = header->priv_assoc->handle;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
551
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
552 g_free(header->priv_assoc->filename);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
553 g_free(header->priv_assoc);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
554
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
555 if (header->fini)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
556 header->fini();
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
557
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
558 g_module_close(module);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
559 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
560
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
561 /******************************************************************/
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
562
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
563 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
564 add_plugin(const gchar * filename)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
565 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
566 GModule *module;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
567 gpointer func;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
568
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
569 if (plugin_is_duplicate(filename))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
570 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
571
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
572 g_message("Loaded plugin (%s)", filename);
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
573
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
574 if (!(module = g_module_open(filename, G_MODULE_BIND_LOCAL))) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
575 printf("Failed to load plugin (%s): %s\n",
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
576 filename, g_module_error());
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
577 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
578 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
579
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
580 /* v2 plugin loading */
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
581 if (g_module_symbol(module, "get_plugin_info", &func))
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
582 {
3682
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
583 PluginHeader *(*header_func_p)(struct _AudaciousFuncTableV1 *) = func;
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
584 PluginHeader *header;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
585
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
586 /* this should never happen. */
3682
84bc78954db5 Start working on exporting all public functions via a vtable. The API version will be bumped to 7 once I am done and -Wl,-export-dynamic is removed.
William Pitcock <nenolod@atheme.org>
parents: 3631
diff changeset
587 g_return_if_fail((header = header_func_p(&_aud_papi_v1)) != NULL);
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
588
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
589 plugin2_process(header, module, filename);
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
590 return;
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
591 }
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
592
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
593 printf("Invalid plugin (%s)\n", filename);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
594 g_module_close(module);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
595 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
596
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
597 static gboolean
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
598 scan_plugin_func(const gchar * path, const gchar * basename, gpointer data)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
599 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
600 if (!str_has_suffix_nocase(basename, SHARED_SUFFIX))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
601 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
602
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
603 if (!g_file_test(path, G_FILE_TEST_IS_REGULAR))
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
604 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
605
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
606 add_plugin(path);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
607
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
608 return FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
609 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
610
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
611 static void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
612 scan_plugins(const gchar * path)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
613 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
614 dir_foreach(path, scan_plugin_func, NULL, NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
615 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
616
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
617 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
618 plugin_system_init(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
619 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
620 gchar *dir, **disabled;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
621 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
622 OutputPlugin *op;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
623 InputPlugin *ip;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
624 LowlevelPlugin *lp;
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
625 DiscoveryPlugin *dp;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
626 gint dirsel = 0, i = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
627
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
628 if (!g_module_supported()) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
629 report_error("Module loading not supported! Plugins will not be loaded.\n");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
630 return;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
631 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
632
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
633 plugin_dict = mowgli_dictionary_create(g_ascii_strcasecmp);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
634
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
635 #ifndef DISABLE_USER_PLUGIN_DIR
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
636 scan_plugins(bmp_paths[BMP_PATH_USER_PLUGIN_DIR]);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
637 /*
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
638 * This is in a separate lo
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
639 * DiscoveryPlugin *dpop so if the user puts them in the
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
640 * wrong dir we'll still get them in the right order (home dir
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
641 * first) - Zinx
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
642 */
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
643 while (plugin_dir_list[dirsel]) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
644 dir = g_build_filename(bmp_paths[BMP_PATH_USER_PLUGIN_DIR],
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
645 plugin_dir_list[dirsel++], NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
646 scan_plugins(dir);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
647 g_free(dir);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
648 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
649 dirsel = 0;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
650 #endif
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
651
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
652 while (plugin_dir_list[dirsel]) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
653 dir = g_build_filename(PLUGIN_DIR, plugin_dir_list[dirsel++], NULL);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
654 scan_plugins(dir);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
655 g_free(dir);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
656 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
657
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
658 op_data.output_list = g_list_sort(op_data.output_list, outputlist_compare_func);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
659 if (!op_data.current_output_plugin
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
660 && g_list_length(op_data.output_list)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
661 op_data.current_output_plugin = op_data.output_list->data;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
662 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
663
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
664 ip_data.input_list = g_list_sort(ip_data.input_list, inputlist_compare_func);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
665
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
666 ep_data.effect_list = g_list_sort(ep_data.effect_list, effectlist_compare_func);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
667 ep_data.enabled_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
668
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
669 gp_data.general_list = g_list_sort(gp_data.general_list, generallist_compare_func);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
670 gp_data.enabled_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
671
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
672 vp_data.vis_list = g_list_sort(vp_data.vis_list, vislist_compare_func);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
673 vp_data.enabled_list = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
674
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
675 dp_data.discovery_list = g_list_sort(dp_data.discovery_list, discoverylist_compare_func);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
676 dp_data.enabled_list = NULL;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
677
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
678
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
679 general_enable_from_stringified_list(cfg.enabled_gplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
680 vis_enable_from_stringified_list(cfg.enabled_vplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
681 effect_enable_from_stringified_list(cfg.enabled_eplugins);
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
682 discovery_enable_from_stringified_list(cfg.enabled_dplugins);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
683
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
684 g_free(cfg.enabled_gplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
685 cfg.enabled_gplugins = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
686
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
687 g_free(cfg.enabled_vplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
688 cfg.enabled_vplugins = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
689
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
690 g_free(cfg.enabled_eplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
691 cfg.enabled_eplugins = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
692
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
693 g_free(cfg.enabled_dplugins);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
694 cfg.enabled_dplugins = NULL;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
695
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
696
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
697 for (node = op_data.output_list; node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
698 op = OUTPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
699 /*
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
700 * Only test basename to avoid problems when changing
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
701 * prefix. We will only see one plugin with the same
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
702 * basename, so this is usually what the user want.
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
703 */
3631
6aea4fb32ef4 Missing NULL-pointer checks are bad, mkay?
Jonathan Schleifer <js@h3c.de>
parents: 3454
diff changeset
704 if (cfg.outputplugin && !strcmp(g_basename(cfg.outputplugin), g_basename(op->filename)))
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
705 op_data.current_output_plugin = op;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
706 if (op->init)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
707 op->init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
708 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
709
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
710 for (node = ip_data.input_list; node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
711 ip = INPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
712 if (ip->init)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
713 ip->init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
714 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
715
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
716 for (node = dp_data.discovery_list; node; node = g_list_next(node)) {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
717 dp = DISCOVERY_PLUGIN(node->data);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
718 if (dp->init)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
719 dp->init();
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
720 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
721
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
722
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
723 for (node = lowlevel_list; node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
724 lp = LOWLEVEL_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
725 if (lp->init)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
726 lp->init();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
727 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
728
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
729 if (cfg.disabled_iplugins) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
730 disabled = g_strsplit(cfg.disabled_iplugins, ":", 0);
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
731
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
732 while (disabled[i]) {
3454
c0eb377bb4e5 Check pointer to prevent NULL dereference.
Matti Hamalainen <ccr@tnsp.org>
parents: 3438
diff changeset
733 Plugin *plugintmp = plugin_get_plugin(disabled[i]);
c0eb377bb4e5 Check pointer to prevent NULL dereference.
Matti Hamalainen <ccr@tnsp.org>
parents: 3438
diff changeset
734 if (plugintmp)
c0eb377bb4e5 Check pointer to prevent NULL dereference.
Matti Hamalainen <ccr@tnsp.org>
parents: 3438
diff changeset
735 INPUT_PLUGIN(plugintmp)->enabled = FALSE;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
736 i++;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
737 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
738
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
739 g_free(disabled);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
740
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
741 g_free(cfg.disabled_iplugins);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
742 cfg.disabled_iplugins = NULL;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
743 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
744 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
745
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
746 void
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
747 plugin_system_cleanup(void)
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
748 {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
749 InputPlugin *ip;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
750 OutputPlugin *op;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
751 EffectPlugin *ep;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
752 GeneralPlugin *gp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
753 VisPlugin *vp;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
754 LowlevelPlugin *lp;
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
755 DiscoveryPlugin *dp;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
756 GList *node;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
757
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
758 g_message("Shutting down plugin system");
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
759
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
760 if (playback_get_playing()) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
761 ip_data.stop = TRUE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
762 playback_stop();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
763 ip_data.stop = FALSE;
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
764 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
765
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
766 /* FIXME: race condition -nenolod */
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
767 op_data.current_output_plugin = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
768
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
769 for (node = get_input_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
770 ip = INPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
771 if (ip && ip->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
772 ip->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
773 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
774 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
775 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
776 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
777
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
778 if (ip->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
779 g_module_close(ip->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
780 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
781
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
782 if (ip_data.input_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
783 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
784 g_list_free(ip_data.input_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
785 ip_data.input_list = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
786 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
787
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
788 for (node = get_output_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
789 op = OUTPUT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
790 if (op && op->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
791 op->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
792 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
793 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
794 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
795 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
796
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
797 if (op->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
798 g_module_close(op->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
799 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
800
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
801 if (op_data.output_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
802 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
803 g_list_free(op_data.output_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
804 op_data.output_list = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
805 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
806
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
807 for (node = get_effect_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
808 ep = EFFECT_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
809 if (ep && ep->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
810 ep->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
811 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
812 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
813 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
814 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
815
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
816 if (ep->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
817 g_module_close(ep->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
818 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
819
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
820 if (ep_data.effect_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
821 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
822 g_list_free(ep_data.effect_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
823 ep_data.effect_list = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
824 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
825
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
826 for (node = get_general_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
827 gp = GENERAL_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
828 if (gp && gp->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
829 gp->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
830 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
831 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
832 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
833 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
834
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
835 if (gp->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
836 g_module_close(gp->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
837 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
838
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
839 if (gp_data.general_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
840 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
841 g_list_free(gp_data.general_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
842 gp_data.general_list = NULL;
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
843 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
844
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
845 for (node = get_vis_list(); node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
846 vp = VIS_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
847 if (vp && vp->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
848 vp->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
849 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
850 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
851 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
852 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
853
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
854 if (vp->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
855 g_module_close(vp->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
856 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
857
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
858 if (vp_data.vis_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
859 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
860 g_list_free(vp_data.vis_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
861 vp_data.vis_list = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
862 }
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
863
3227
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
864
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
865 for (node = get_discovery_list(); node; node = g_list_next(node)) {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
866 dp = DISCOVERY_PLUGIN(node->data);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
867 if (dp && dp->cleanup) {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
868 dp->cleanup();
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
869 GDK_THREADS_LEAVE();
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
870 while (g_main_context_iteration(NULL, FALSE));
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
871 GDK_THREADS_ENTER();
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
872 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
873
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
874 if (dp->handle)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
875 g_module_close(dp->handle);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
876 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
877
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
878 if (dp_data.discovery_list != NULL)
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
879 {
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
880 g_list_free(dp_data.discovery_list);
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
881 dp_data.discovery_list = NULL;
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
882 }
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
883
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
884
2619f4c62abe added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 3165
diff changeset
885
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
886 for (node = lowlevel_list; node; node = g_list_next(node)) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
887 lp = LOWLEVEL_PLUGIN(node->data);
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
888 if (lp && lp->cleanup) {
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
889 lp->cleanup();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
890 GDK_THREADS_LEAVE();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
891 while (g_main_context_iteration(NULL, FALSE));
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
892 GDK_THREADS_ENTER();
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
893 }
2797
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
894
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
895 if (lp->handle)
f0c1c8b22c88 [svn] - first attempt at an plugin API2 loader. this is entirely implemented inside the plugin2 namespace, so please respect that if you go editing this ;p
nenolod
parents: 2795
diff changeset
896 g_module_close(lp->handle);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
897 }
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
898
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
899 if (lowlevel_list != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
900 {
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
901 g_list_free(lowlevel_list);
2623
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
902 lowlevel_list = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
903 }
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
904
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
905 /* XXX: vfs will crash otherwise. -nenolod */
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
906 if (vfs_transports != NULL)
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
907 {
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
908 g_list_free(vfs_transports);
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
909 vfs_transports = NULL;
0ad10a95ed10 [svn] - plugin reloading.
nenolod
parents: 2400
diff changeset
910 }
2682
c3cd6e47faf6 [svn] - make the evil 'reload plugins' button behave a bit better
giacomo
parents: 2624
diff changeset
911
3437
3092a8b3fe34 Big plugin system changes (part 1 of who knows, it's still a big mess):
William Pitcock <nenolod@atheme.org>
parents: 3247
diff changeset
912 mowgli_dictionary_destroy(plugin_dict, NULL, NULL);
2313
3149d4b1a9a9 [svn] - objective-make autodepend fixes
nenolod
parents:
diff changeset
913 }