diff options
author | James Booth <boothj5@gmail.com> | 2013-12-22 23:13:34 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-12-22 23:13:34 +0000 |
commit | c001f0e7cb844086be6e7d5be1c7aae26f9855b1 (patch) | |
tree | 64b24a266be6684958f4b3323ad881d1515c6bb9 /src | |
parent | 581f58e47f0b52b60b0aa7ec6746c7bd1d24e6ee (diff) | |
download | profani-tty-c001f0e7cb844086be6e7d5be1c7aae26f9855b1.tar.gz |
Bind bookmark functions in main.c
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/xmpp/bookmark.c | 15 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c index 4c733daf..3ee3c428 100644 --- a/src/main.c +++ b/src/main.c @@ -40,6 +40,7 @@ static void _init_modules(void) { jabber_init_module(); + bookmark_init_module(); } int diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index f7ba1c77..4516454f 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -71,7 +71,6 @@ _bookmark_add(const char *jid, const char *nick, gboolean autojoin) autocomplete_remove(bookmark_ac, jid); autocomplete_add(bookmark_ac, jid); } -void (*bookmark_add)(const char *, const char *, gboolean) = _bookmark_add; static void _bookmark_remove(const char *jid, gboolean autojoin) @@ -84,21 +83,18 @@ _bookmark_remove(const char *jid, gboolean autojoin) autocomplete_remove(bookmark_ac, jid); } } -void (*bookmark_remove)(const char *, gboolean) = _bookmark_remove; static const GList * _bookmark_get_list(void) { return bookmark_list; } -const GList * (*bookmark_get_list)(void) = _bookmark_get_list; static char * _bookmark_find(char *search_str) { return autocomplete_complete(bookmark_ac, search_str); } -char * (*bookmark_find)(char *) = _bookmark_find; static void _bookmark_autocomplete_reset(void) @@ -107,7 +103,6 @@ _bookmark_autocomplete_reset(void) autocomplete_reset(bookmark_ac); } } -void (*bookmark_autocomplete_reset)(void) = _bookmark_autocomplete_reset; static int _bookmark_handle_result(xmpp_conn_t * const conn, @@ -248,3 +243,13 @@ _bookmark_item_destroy(gpointer item) free(p->nick); free(p); } + +void +bookmark_init_module(void) +{ + bookmark_add = _bookmark_add; + bookmark_remove = _bookmark_remove; + bookmark_get_list = _bookmark_get_list; + bookmark_find = _bookmark_find; + bookmark_autocomplete_reset = _bookmark_autocomplete_reset; +} diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index c4dd9cf4..124ed7a7 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -75,6 +75,7 @@ typedef struct disco_identity_t { } DiscoIdentity; void jabber_init_module(void); +void bookmark_init_module(void); // connection functions void (*jabber_init)(const int disable_tls); |