1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Bind bookmark functions in main.c

This commit is contained in:
James Booth 2013-12-22 23:13:34 +00:00
parent 581f58e47f
commit c001f0e7cb
3 changed files with 12 additions and 5 deletions

View File

@ -40,6 +40,7 @@ static void
_init_modules(void)
{
jabber_init_module();
bookmark_init_module();
}
int

View File

@ -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;
}

View File

@ -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);