aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-11-29 00:27:09 +0100
committerJelmer Vernooij <jelmer@samba.org>2005-11-29 00:27:09 +0100
commit65e2ce1ffdead577ed90148d33e36794136b3232 (patch)
tree3a99252aa62b2c87c05d6646cbd0376f1dfc7e29 /protocols/nogaim.c
parentb20b32f0785f9a1eff448382a98e64812469e112 (diff)
Disable plugin support by default, support compilation with non-C99 compilers.
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c62
1 files changed, 36 insertions, 26 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 474b91b2..7eb0446e 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -54,6 +54,7 @@ static int remove_chat_buddy_silent( struct conversation *b, char *handle );
GSList *connections;
+#ifdef WITH_PLUGINS
gboolean load_plugin(char *path)
{
void (*init_function) (void);
@@ -75,6 +76,34 @@ gboolean load_plugin(char *path)
return TRUE;
}
+void load_plugins(void)
+{
+ GDir *dir;
+ GError *error = NULL;
+
+ dir = g_dir_open(PLUGINDIR, 0, &error);
+
+ if (dir) {
+ const gchar *entry;
+ char *path;
+
+ while ((entry = g_dir_read_name(dir))) {
+ path = g_build_filename(PLUGINDIR, entry, NULL);
+ if(!path) {
+ log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry);
+ continue;
+ }
+
+ load_plugin(path);
+
+ g_free(path);
+ }
+
+ g_dir_close(dir);
+ }
+}
+#endif
+
/* nogaim.c */
GList *protocols = NULL;
@@ -100,49 +129,30 @@ struct prpl *find_protocol(const char *name)
/* nogaim.c */
void nogaim_init()
{
- GDir *dir;
- GError *error = NULL;
+ extern void msn_init();
+ extern void oscar_init();
+ extern void byahoo_init();
+ extern void jabber_init();
#ifdef WITH_MSN
- extern void msn_init();
msn_init();
#endif
#ifdef WITH_OSCAR
- extern void oscar_init();
oscar_init();
#endif
#ifdef WITH_YAHOO
- extern void byahoo_init();
byahoo_init();
#endif
#ifdef WITH_JABBER
- extern void jabber_init();
jabber_init();
#endif
- dir = g_dir_open(PLUGINDIR, 0, &error);
-
- if (dir) {
- const gchar *entry;
- char *path;
-
- while ((entry = g_dir_read_name(dir))) {
- path = g_build_filename(PLUGINDIR, entry, NULL);
- if(!path) {
- log_message(LOGLVL_WARNING, "Can't build path for %s\n", entry);
- continue;
- }
-
- load_plugin(path);
-
- g_free(path);
- }
-
- g_dir_close(dir);
- }
+#ifdef WITH_PLUGINS
+ load_plugins();
+#endif
}
GSList *get_connections() { return connections; }