1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Removed function pointers

This commit is contained in:
James Booth 2014-12-22 22:13:42 +00:00
parent 3cbeb7b483
commit 9d94ac5c63
22 changed files with 1108 additions and 1596 deletions

View File

@ -395,7 +395,7 @@ static struct cmd_t command_defs[] =
NULL } } },
{ "/occupants",
cmd_occupants, parse_args, 1, 2, &cons_occupants_setting,
cmd_occupants, parse_args, 1, 2, cons_occupants_setting,
{ "/occupants show|hide|default|size [show|hide] [percent]", "Show or hide room occupants.",
{ "/occupants show|hide|default|size [show|hide] [percent]",
"-------------------------------------------------------",

View File

@ -58,7 +58,7 @@ typedef struct cmd_t {
gchar** (*parser)(const char * const inp, int min, int max, gboolean *result);
int min_args;
int max_args;
void (**setting_func)(void);
void (*setting_func)(void);
CommandHelp help;
} Command;

View File

@ -73,8 +73,8 @@ static gchar * _get_accounts_file(void);
static void _remove_from_list(GKeyFile *accounts, const char * const account_name, const char * const key, const char * const contact_jid);
static void
_accounts_load(void)
void
accounts_load(void)
{
log_info("Loading accounts");
all_ac = autocomplete_new();
@ -107,40 +107,40 @@ _accounts_load(void)
g_strfreev(account_names);
}
static void
_accounts_close(void)
void
accounts_close(void)
{
autocomplete_free(all_ac);
autocomplete_free(enabled_ac);
g_key_file_free(accounts);
}
static char *
_accounts_find_enabled(char *prefix)
char *
accounts_find_enabled(char *prefix)
{
return autocomplete_complete(enabled_ac, prefix, TRUE);
}
static char *
_accounts_find_all(char *prefix)
char *
accounts_find_all(char *prefix)
{
return autocomplete_complete(all_ac, prefix, TRUE);
}
static void
_accounts_reset_all_search(void)
void
accounts_reset_all_search(void)
{
autocomplete_reset(all_ac);
}
static void
_accounts_reset_enabled_search(void)
void
accounts_reset_enabled_search(void)
{
autocomplete_reset(enabled_ac);
}
static void
_accounts_add(const char *account_name, const char *altdomain, const int port)
void
accounts_add(const char *account_name, const char *altdomain, const int port)
{
// set account name and resource
const char *barejid = account_name;
@ -193,8 +193,8 @@ _accounts_add(const char *account_name, const char *altdomain, const int port)
jid_destroy(jid);
}
static int
_accounts_remove(const char *account_name)
int
accounts_remove(const char *account_name)
{
int r = g_key_file_remove_group(accounts, account_name, NULL);
_save_accounts();
@ -203,14 +203,14 @@ _accounts_remove(const char *account_name)
return r;
}
static gchar**
_accounts_get_list(void)
gchar**
accounts_get_list(void)
{
return g_key_file_get_groups(accounts, NULL);
}
static ProfAccount*
_accounts_get_account(const char * const name)
ProfAccount*
accounts_get_account(const char * const name)
{
if (!g_key_file_has_group(accounts, name)) {
return NULL;
@ -298,8 +298,8 @@ _accounts_get_account(const char * const name)
}
}
static gboolean
_accounts_enable(const char * const name)
gboolean
accounts_enable(const char * const name)
{
if (g_key_file_has_group(accounts, name)) {
g_key_file_set_boolean(accounts, name, "enabled", TRUE);
@ -311,8 +311,8 @@ _accounts_enable(const char * const name)
}
}
static gboolean
_accounts_disable(const char * const name)
gboolean
accounts_disable(const char * const name)
{
if (g_key_file_has_group(accounts, name)) {
g_key_file_set_boolean(accounts, name, "enabled", FALSE);
@ -324,8 +324,8 @@ _accounts_disable(const char * const name)
}
}
static gboolean
_accounts_rename(const char * const account_name, const char * const new_name)
gboolean
accounts_rename(const char * const account_name, const char * const new_name)
{
if (g_key_file_has_group(accounts, new_name)) {
return FALSE;
@ -372,15 +372,15 @@ _accounts_rename(const char * const account_name, const char * const new_name)
return TRUE;
}
static gboolean
_accounts_account_exists(const char * const account_name)
gboolean
accounts_account_exists(const char * const account_name)
{
return g_key_file_has_group(accounts, account_name);
}
static void
_accounts_set_jid(const char * const account_name, const char * const value)
void
accounts_set_jid(const char * const account_name, const char * const value)
{
Jid *jid = jid_create(value);
if (jid != NULL) {
@ -405,8 +405,8 @@ _accounts_set_jid(const char * const account_name, const char * const value)
}
}
static void
_accounts_set_server(const char * const account_name, const char * const value)
void
accounts_set_server(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "server", value);
@ -414,8 +414,8 @@ _accounts_set_server(const char * const account_name, const char * const value)
}
}
static void
_accounts_set_port(const char * const account_name, const int value)
void
accounts_set_port(const char * const account_name, const int value)
{
if (value != 0) {
g_key_file_set_integer(accounts, account_name, "port", value);
@ -423,8 +423,8 @@ _accounts_set_port(const char * const account_name, const int value)
}
}
static void
_accounts_set_resource(const char * const account_name, const char * const value)
void
accounts_set_resource(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "resource", value);
@ -432,8 +432,8 @@ _accounts_set_resource(const char * const account_name, const char * const value
}
}
static void
_accounts_set_password(const char * const account_name, const char * const value)
void
accounts_set_password(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "password", value);
@ -441,8 +441,8 @@ _accounts_set_password(const char * const account_name, const char * const value
}
}
static void
_accounts_clear_password(const char * const account_name)
void
accounts_clear_password(const char * const account_name)
{
if (accounts_account_exists(account_name)) {
g_key_file_remove_key(accounts, account_name, "password", NULL);
@ -450,8 +450,8 @@ _accounts_clear_password(const char * const account_name)
}
}
static void
_accounts_clear_server(const char * const account_name)
void
accounts_clear_server(const char * const account_name)
{
if (accounts_account_exists(account_name)) {
g_key_file_remove_key(accounts, account_name, "server", NULL);
@ -459,8 +459,8 @@ _accounts_clear_server(const char * const account_name)
}
}
static void
_accounts_clear_port(const char * const account_name)
void
accounts_clear_port(const char * const account_name)
{
if (accounts_account_exists(account_name)) {
g_key_file_remove_key(accounts, account_name, "port", NULL);
@ -468,8 +468,8 @@ _accounts_clear_port(const char * const account_name)
}
}
static void
_accounts_clear_otr(const char * const account_name)
void
accounts_clear_otr(const char * const account_name)
{
if (accounts_account_exists(account_name)) {
g_key_file_remove_key(accounts, account_name, "otr.policy", NULL);
@ -477,8 +477,8 @@ _accounts_clear_otr(const char * const account_name)
}
}
static void
_accounts_add_otr_policy(const char * const account_name, const char * const contact_jid, const char * const policy)
void
accounts_add_otr_policy(const char * const account_name, const char * const contact_jid, const char * const policy)
{
if (accounts_account_exists(account_name)) {
GString *key = g_string_new("otr.");
@ -589,8 +589,8 @@ _remove_from_list(GKeyFile *accounts, const char * const account_name, const cha
g_strfreev(list);
}
static void
_accounts_set_muc_service(const char * const account_name, const char * const value)
void
accounts_set_muc_service(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "muc.service", value);
@ -598,8 +598,8 @@ _accounts_set_muc_service(const char * const account_name, const char * const va
}
}
static void
_accounts_set_muc_nick(const char * const account_name, const char * const value)
void
accounts_set_muc_nick(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "muc.nick", value);
@ -607,8 +607,8 @@ _accounts_set_muc_nick(const char * const account_name, const char * const value
}
}
static void
_accounts_set_otr_policy(const char * const account_name, const char * const value)
void
accounts_set_otr_policy(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "otr.policy", value);
@ -616,8 +616,8 @@ _accounts_set_otr_policy(const char * const account_name, const char * const val
}
}
static void
_accounts_set_priority_online(const char * const account_name, const gint value)
void
accounts_set_priority_online(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_integer(accounts, account_name, "priority.online", value);
@ -625,8 +625,8 @@ _accounts_set_priority_online(const char * const account_name, const gint value)
}
}
static void
_accounts_set_priority_chat(const char * const account_name, const gint value)
void
accounts_set_priority_chat(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_integer(accounts, account_name, "priority.chat", value);
@ -634,8 +634,8 @@ _accounts_set_priority_chat(const char * const account_name, const gint value)
}
}
static void
_accounts_set_priority_away(const char * const account_name, const gint value)
void
accounts_set_priority_away(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_integer(accounts, account_name, "priority.away", value);
@ -643,8 +643,8 @@ _accounts_set_priority_away(const char * const account_name, const gint value)
}
}
static void
_accounts_set_priority_xa(const char * const account_name, const gint value)
void
accounts_set_priority_xa(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_integer(accounts, account_name, "priority.xa", value);
@ -652,8 +652,8 @@ _accounts_set_priority_xa(const char * const account_name, const gint value)
}
}
static void
_accounts_set_priority_dnd(const char * const account_name, const gint value)
void
accounts_set_priority_dnd(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_integer(accounts, account_name, "priority.dnd", value);
@ -661,8 +661,8 @@ _accounts_set_priority_dnd(const char * const account_name, const gint value)
}
}
static void
_accounts_set_priority_all(const char * const account_name, const gint value)
void
accounts_set_priority_all(const char * const account_name, const gint value)
{
if (accounts_account_exists(account_name)) {
accounts_set_priority_online(account_name, value);
@ -674,8 +674,8 @@ _accounts_set_priority_all(const char * const account_name, const gint value)
}
}
static gint
_accounts_get_priority_for_presence_type(const char * const account_name,
gint
accounts_get_priority_for_presence_type(const char * const account_name,
resource_presence_t presence_type)
{
gint result;
@ -705,8 +705,8 @@ _accounts_get_priority_for_presence_type(const char * const account_name,
return result;
}
static void
_accounts_set_last_presence(const char * const account_name, const char * const value)
void
accounts_set_last_presence(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "presence.last", value);
@ -714,8 +714,8 @@ _accounts_set_last_presence(const char * const account_name, const char * const
}
}
static void
_accounts_set_login_presence(const char * const account_name, const char * const value)
void
accounts_set_login_presence(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "presence.login", value);
@ -723,8 +723,8 @@ _accounts_set_login_presence(const char * const account_name, const char * const
}
}
static resource_presence_t
_accounts_get_last_presence(const char * const account_name)
resource_presence_t
accounts_get_last_presence(const char * const account_name)
{
resource_presence_t result;
gchar *setting = g_key_file_get_string(accounts, account_name, "presence.last", NULL);
@ -751,8 +751,8 @@ _accounts_get_last_presence(const char * const account_name)
return result;
}
static resource_presence_t
_accounts_get_login_presence(const char * const account_name)
resource_presence_t
accounts_get_login_presence(const char * const account_name)
{
resource_presence_t result;
gchar *setting = g_key_file_get_string(accounts, account_name, "presence.login", NULL);
@ -859,48 +859,4 @@ _get_accounts_file(void)
g_string_free(logfile, TRUE);
return result;
}
void
accounts_init_module(void)
{
accounts_load = _accounts_load;
accounts_close = _accounts_close;
accounts_find_all = _accounts_find_all;
accounts_find_enabled = _accounts_find_enabled;
accounts_reset_all_search = _accounts_reset_all_search;
accounts_reset_enabled_search = _accounts_reset_enabled_search;
accounts_add = _accounts_add;
accounts_remove = _accounts_remove;
accounts_get_list = _accounts_get_list;
accounts_get_account = _accounts_get_account;
accounts_enable = _accounts_enable;
accounts_disable = _accounts_disable;
accounts_rename = _accounts_rename;
accounts_account_exists = _accounts_account_exists;
accounts_set_jid = _accounts_set_jid;
accounts_set_server = _accounts_set_server;
accounts_set_port = _accounts_set_port;
accounts_set_resource = _accounts_set_resource;
accounts_set_password = _accounts_set_password;
accounts_set_muc_service = _accounts_set_muc_service;
accounts_set_muc_nick = _accounts_set_muc_nick;
accounts_set_otr_policy = _accounts_set_otr_policy;
accounts_set_last_presence = _accounts_set_last_presence;
accounts_set_login_presence = _accounts_set_login_presence;
accounts_get_last_presence = _accounts_get_last_presence;
accounts_get_login_presence = _accounts_get_login_presence;
accounts_set_priority_online = _accounts_set_priority_online;
accounts_set_priority_chat = _accounts_set_priority_chat;
accounts_set_priority_away = _accounts_set_priority_away;
accounts_set_priority_xa = _accounts_set_priority_xa;
accounts_set_priority_dnd = _accounts_set_priority_dnd;
accounts_set_priority_all = _accounts_set_priority_all;
accounts_get_priority_for_presence_type = _accounts_get_priority_for_presence_type;
accounts_clear_password = _accounts_clear_password;
accounts_clear_server = _accounts_clear_server;
accounts_clear_port = _accounts_clear_port;
accounts_clear_otr = _accounts_clear_otr;
accounts_add_otr_policy = _accounts_add_otr_policy;
}
}

View File

@ -40,48 +40,46 @@
#include "common.h"
#include "config/account.h"
void accounts_init_module(void);
void accounts_load(void);
void accounts_close(void);
void (*accounts_load)(void);
void (*accounts_close)(void);
char * (*accounts_find_all)(char *prefix);
char * (*accounts_find_enabled)(char *prefix);
void (*accounts_reset_all_search)(void);
void (*accounts_reset_enabled_search)(void);
void (*accounts_add)(const char *jid, const char *altdomain, const int port);
int (*accounts_remove)(const char *jid);
gchar** (*accounts_get_list)(void);
ProfAccount* (*accounts_get_account)(const char * const name);
gboolean (*accounts_enable)(const char * const name);
gboolean (*accounts_disable)(const char * const name);
gboolean (*accounts_rename)(const char * const account_name,
char * accounts_find_all(char *prefix);
char * accounts_find_enabled(char *prefix);
void accounts_reset_all_search(void);
void accounts_reset_enabled_search(void);
void accounts_add(const char *jid, const char *altdomain, const int port);
int accounts_remove(const char *jid);
gchar** accounts_get_list(void);
ProfAccount* accounts_get_account(const char * const name);
gboolean accounts_enable(const char * const name);
gboolean accounts_disable(const char * const name);
gboolean accounts_rename(const char * const account_name,
const char * const new_name);
gboolean (*accounts_account_exists)(const char * const account_name);
void (*accounts_set_jid)(const char * const account_name, const char * const value);
void (*accounts_set_server)(const char * const account_name, const char * const value);
void (*accounts_set_port)(const char * const account_name, const int value);
void (*accounts_set_resource)(const char * const account_name, const char * const value);
void (*accounts_set_password)(const char * const account_name, const char * const value);
void (*accounts_set_muc_service)(const char * const account_name, const char * const value);
void (*accounts_set_muc_nick)(const char * const account_name, const char * const value);
void (*accounts_set_otr_policy)(const char * const account_name, const char * const value);
void (*accounts_set_last_presence)(const char * const account_name, const char * const value);
void (*accounts_set_login_presence)(const char * const account_name, const char * const value);
resource_presence_t (*accounts_get_login_presence)(const char * const account_name);
resource_presence_t (*accounts_get_last_presence)(const char * const account_name);
void (*accounts_set_priority_online)(const char * const account_name, const gint value);
void (*accounts_set_priority_chat)(const char * const account_name, const gint value);
void (*accounts_set_priority_away)(const char * const account_name, const gint value);
void (*accounts_set_priority_xa)(const char * const account_name, const gint value);
void (*accounts_set_priority_dnd)(const char * const account_name, const gint value);
void (*accounts_set_priority_all)(const char * const account_name, const gint value);
gint (*accounts_get_priority_for_presence_type)(const char * const account_name,
gboolean accounts_account_exists(const char * const account_name);
void accounts_set_jid(const char * const account_name, const char * const value);
void accounts_set_server(const char * const account_name, const char * const value);
void accounts_set_port(const char * const account_name, const int value);
void accounts_set_resource(const char * const account_name, const char * const value);
void accounts_set_password(const char * const account_name, const char * const value);
void accounts_set_muc_service(const char * const account_name, const char * const value);
void accounts_set_muc_nick(const char * const account_name, const char * const value);
void accounts_set_otr_policy(const char * const account_name, const char * const value);
void accounts_set_last_presence(const char * const account_name, const char * const value);
void accounts_set_login_presence(const char * const account_name, const char * const value);
resource_presence_t accounts_get_login_presence(const char * const account_name);
resource_presence_t accounts_get_last_presence(const char * const account_name);
void accounts_set_priority_online(const char * const account_name, const gint value);
void accounts_set_priority_chat(const char * const account_name, const gint value);
void accounts_set_priority_away(const char * const account_name, const gint value);
void accounts_set_priority_xa(const char * const account_name, const gint value);
void accounts_set_priority_dnd(const char * const account_name, const gint value);
void accounts_set_priority_all(const char * const account_name, const gint value);
gint accounts_get_priority_for_presence_type(const char * const account_name,
resource_presence_t presence_type);
void (*accounts_clear_password)(const char * const account_name);
void (*accounts_clear_server)(const char * const account_name);
void (*accounts_clear_port)(const char * const account_name);
void (*accounts_clear_otr)(const char * const account_name);
void (*accounts_add_otr_policy)(const char * const account_name, const char * const contact_jid, const char * const policy);
void accounts_clear_password(const char * const account_name);
void accounts_clear_server(const char * const account_name);
void accounts_clear_port(const char * const account_name);
void accounts_clear_otr(const char * const account_name);
void accounts_add_otr_policy(const char * const account_name, const char * const contact_jid, const char * const policy);
#endif

View File

@ -53,30 +53,6 @@ static gboolean version = FALSE;
static char *log = "INFO";
static char *account_name = NULL;
static void
_init_modules(void)
{
jabber_init_module();
bookmark_init_module();
capabilities_init_module();
iq_init_module();
message_init_module();
presence_init_module();
roster_init_module();
form_init_module();
ui_init_module();
console_init_module();
notifier_init_module();
rosterwin_init_module();
occupantswin_init_module();
accounts_init_module();
#ifdef HAVE_LIBOTR
otr_init_module();
#endif
}
int
main(int argc, char **argv)
{
@ -149,7 +125,6 @@ main(int argc, char **argv)
return 0;
}
_init_modules();
prof_run(disable_tls, log, account_name);
return 0;

View File

@ -144,20 +144,20 @@ cb_gone_secure(void *opdata, ConnContext *context)
ui_gone_secure(context->username, otr_is_trusted(context->username));
}
static char *
_otr_libotr_version(void)
char *
otr_libotr_version(void)
{
return OTRL_VERSION;
}
static char *
_otr_start_query(void)
char *
otr_start_query(void)
{
return otrlib_start_query();
}
static void
_otr_init(void)
void
otr_init(void)
{
log_info("Initialising OTR");
OTRL_INIT;
@ -175,8 +175,8 @@ _otr_init(void)
data_loaded = FALSE;
}
static void
_otr_shutdown(void)
void
otr_shutdown(void)
{
if (jid != NULL) {
free(jid);
@ -184,13 +184,13 @@ _otr_shutdown(void)
}
void
_otr_poll(void)
otr_poll(void)
{
otrlib_poll();
}
static void
_otr_on_connect(ProfAccount *account)
void
otr_on_connect(ProfAccount *account)
{
if (jid != NULL) {
free(jid);
@ -268,8 +268,8 @@ _otr_on_connect(ProfAccount *account)
return;
}
static void
_otr_keygen(ProfAccount *account)
void
otr_keygen(ProfAccount *account)
{
if (data_loaded) {
cons_show("OTR key already generated.");
@ -358,14 +358,14 @@ _otr_keygen(ProfAccount *account)
return;
}
static gboolean
_otr_key_loaded(void)
gboolean
otr_key_loaded(void)
{
return data_loaded;
}
static gboolean
_otr_is_secure(const char * const recipient)
gboolean
otr_is_secure(const char * const recipient)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -380,8 +380,8 @@ _otr_is_secure(const char * const recipient)
}
}
static gboolean
_otr_is_trusted(const char * const recipient)
gboolean
otr_is_trusted(const char * const recipient)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -406,8 +406,8 @@ _otr_is_trusted(const char * const recipient)
return FALSE;
}
static void
_otr_trust(const char * const recipient)
void
otr_trust(const char * const recipient)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -430,8 +430,8 @@ _otr_trust(const char * const recipient)
return;
}
static void
_otr_untrust(const char * const recipient)
void
otr_untrust(const char * const recipient)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -454,8 +454,8 @@ _otr_untrust(const char * const recipient)
return;
}
static void
_otr_smp_secret(const char * const recipient, const char *secret)
void
otr_smp_secret(const char * const recipient, const char *secret)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -478,8 +478,8 @@ _otr_smp_secret(const char * const recipient, const char *secret)
}
}
static void
_otr_smp_question(const char * const recipient, const char *question, const char *answer)
void
otr_smp_question(const char * const recipient, const char *question, const char *answer)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -495,8 +495,8 @@ _otr_smp_question(const char * const recipient, const char *question, const char
ui_otr_authetication_waiting(recipient);
}
static void
_otr_smp_answer(const char * const recipient, const char *answer)
void
otr_smp_answer(const char * const recipient, const char *answer)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -512,14 +512,14 @@ _otr_smp_answer(const char * const recipient, const char *answer)
otrl_message_respond_smp(user_state, &ops, NULL, context, (const unsigned char*)answer, strlen(answer));
}
static void
_otr_end_session(const char * const recipient)
void
otr_end_session(const char * const recipient)
{
otrlib_end_session(user_state, recipient, jid, &ops);
}
static char *
_otr_get_my_fingerprint(void)
char *
otr_get_my_fingerprint(void)
{
char fingerprint[45];
otrl_privkey_fingerprint(user_state, fingerprint, jid, "xmpp");
@ -528,8 +528,8 @@ _otr_get_my_fingerprint(void)
return result;
}
static char *
_otr_get_their_fingerprint(const char * const recipient)
char *
otr_get_their_fingerprint(const char * const recipient)
{
ConnContext *context = otrlib_context_find(user_state, recipient, jid);
@ -543,8 +543,8 @@ _otr_get_their_fingerprint(const char * const recipient)
}
}
static prof_otrpolicy_t
_otr_get_policy(const char * const recipient)
prof_otrpolicy_t
otr_get_policy(const char * const recipient)
{
ProfAccount *account = accounts_get_account(jabber_get_account_name());
// check contact specific setting
@ -595,8 +595,8 @@ _otr_get_policy(const char * const recipient)
return result;
}
static char *
_otr_encrypt_message(const char * const to, const char * const message)
char *
otr_encrypt_message(const char * const to, const char * const message)
{
char *newmessage = NULL;
gcry_error_t err = otrlib_encrypt_message(user_state, &ops, jid, to, message, &newmessage);
@ -608,8 +608,8 @@ _otr_encrypt_message(const char * const to, const char * const message)
}
}
static char *
_otr_decrypt_message(const char * const from, const char * const message, gboolean *was_decrypted)
char *
otr_decrypt_message(const char * const from, const char * const message, gboolean *was_decrypted)
{
char *decrypted = NULL;
OtrlTLV *tlvs = NULL;
@ -647,35 +647,8 @@ _otr_decrypt_message(const char * const from, const char * const message, gboole
}
}
static void
_otr_free_message(char *message)
void
otr_free_message(char *message)
{
otrl_message_free(message);
}
void
otr_init_module(void)
{
otr_init = _otr_init;
otr_shutdown = _otr_shutdown;
otr_libotr_version = _otr_libotr_version;
otr_start_query = _otr_start_query;
otr_poll = _otr_poll;
otr_on_connect = _otr_on_connect;
otr_keygen = _otr_keygen;
otr_key_loaded = _otr_key_loaded;
otr_is_secure = _otr_is_secure;
otr_is_trusted = _otr_is_trusted;
otr_trust = _otr_trust;
otr_untrust = _otr_untrust;
otr_end_session = _otr_end_session;
otr_get_my_fingerprint = _otr_get_my_fingerprint;
otr_get_their_fingerprint = _otr_get_their_fingerprint;
otr_encrypt_message = _otr_encrypt_message;
otr_decrypt_message = _otr_decrypt_message;
otr_free_message = _otr_free_message;
otr_smp_secret = _otr_smp_secret;
otr_smp_question = _otr_smp_question;
otr_smp_answer = _otr_smp_answer;
otr_get_policy = _otr_get_policy;
}
}

View File

@ -46,42 +46,40 @@ typedef enum {
PROF_OTRPOLICY_ALWAYS
} prof_otrpolicy_t;
void otr_init_module(void);
OtrlUserState otr_userstate(void);
OtrlMessageAppOps* otr_messageops(void);
GHashTable* otr_smpinitators(void);
void (*otr_init)(void);
void (*otr_shutdown)(void);
char* (*otr_libotr_version)(void);
char* (*otr_start_query)(void);
void (*otr_poll)(void);
void (*otr_on_connect)(ProfAccount *account);
void (*otr_keygen)(ProfAccount *account);
void otr_init(void);
void otr_shutdown(void);
char* otr_libotr_version(void);
char* otr_start_query(void);
void otr_poll(void);
void otr_on_connect(ProfAccount *account);
void otr_keygen(ProfAccount *account);
gboolean (*otr_key_loaded)(void);
gboolean (*otr_is_secure)(const char * const recipient);
gboolean otr_key_loaded(void);
gboolean otr_is_secure(const char * const recipient);
gboolean (*otr_is_trusted)(const char * const recipient);
void (*otr_trust)(const char * const recipient);
void (*otr_untrust)(const char * const recipient);
gboolean otr_is_trusted(const char * const recipient);
void otr_trust(const char * const recipient);
void otr_untrust(const char * const recipient);
void (*otr_smp_secret)(const char * const recipient, const char *secret);
void (*otr_smp_question)(const char * const recipient, const char *question, const char *answer);
void (*otr_smp_answer)(const char * const recipient, const char *answer);
void otr_smp_secret(const char * const recipient, const char *secret);
void otr_smp_question(const char * const recipient, const char *question, const char *answer);
void otr_smp_answer(const char * const recipient, const char *answer);
void (*otr_end_session)(const char * const recipient);
void otr_end_session(const char * const recipient);
char * (*otr_get_my_fingerprint)(void);
char * (*otr_get_their_fingerprint)(const char * const recipient);
char * otr_get_my_fingerprint(void);
char * otr_get_their_fingerprint(const char * const recipient);
char * (*otr_encrypt_message)(const char * const to, const char * const message);
char * (*otr_decrypt_message)(const char * const from, const char * const message,
char * otr_encrypt_message(const char * const to, const char * const message);
char * otr_decrypt_message(const char * const from, const char * const message,
gboolean *was_decrypted);
void (*otr_free_message)(char *message);
void otr_free_message(char *message);
prof_otrpolicy_t (*otr_get_policy)(const char * const recipient);
prof_otrpolicy_t otr_get_policy(const char * const recipient);
#endif

View File

@ -63,22 +63,22 @@
static void _cons_splash_logo(void);
void _show_roster_contacts(GSList *list, gboolean show_groups);
static void
_cons_show_time(void)
void
cons_show_time(void)
{
ProfWin *console = wins_get_console();
win_save_print(console, '-', NULL, NO_EOL, 0, "", "");
}
static void
_cons_show_word(const char * const word)
void
cons_show_word(const char * const word)
{
ProfWin *console = wins_get_console();
win_save_print(console, '-', NULL, NO_DATE | NO_EOL, 0, "", word);
}
static void
_cons_debug(const char * const msg, ...)
void
cons_debug(const char * const msg, ...)
{
ProfWin *console = wins_get_console();
if (strcmp(PACKAGE_STATUS, "development") == 0) {
@ -92,8 +92,8 @@ _cons_debug(const char * const msg, ...)
}
}
static void
_cons_show(const char * const msg, ...)
void
cons_show(const char * const msg, ...)
{
ProfWin *console = wins_get_console();
va_list arg;
@ -105,8 +105,8 @@ _cons_show(const char * const msg, ...)
va_end(arg);
}
static void
_cons_show_error(const char * const msg, ...)
void
cons_show_error(const char * const msg, ...)
{
ProfWin *console = wins_get_console();
va_list arg;
@ -120,8 +120,8 @@ _cons_show_error(const char * const msg, ...)
cons_alert();
}
static void
_cons_show_typing(const char * const barejid)
void
cons_show_typing(const char * const barejid)
{
ProfWin *console = wins_get_console();
const char * display_usr = NULL;
@ -140,8 +140,8 @@ _cons_show_typing(const char * const barejid)
cons_alert();
}
static void
_cons_show_incoming_message(const char * const short_from, const int win_index)
void
cons_show_incoming_message(const char * const short_from, const int win_index)
{
ProfWin *console = wins_get_console();
@ -154,8 +154,8 @@ _cons_show_incoming_message(const char * const short_from, const int win_index)
cons_alert();
}
static void
_cons_about(void)
void
cons_about(void)
{
ProfWin *console = wins_get_console();
int rows, cols;
@ -194,8 +194,8 @@ _cons_about(void)
cons_alert();
}
static void
_cons_check_version(gboolean not_available_msg)
void
cons_check_version(gboolean not_available_msg)
{
ProfWin *console = wins_get_console();
char *latest_release = release_get_latest();
@ -221,8 +221,8 @@ _cons_check_version(gboolean not_available_msg)
}
}
static void
_cons_show_login_success(ProfAccount *account)
void
cons_show_login_success(ProfAccount *account)
{
ProfWin *console = wins_get_console();
win_save_vprint(console, '-', NULL, NO_EOL, 0, "", "%s logged in successfully, ", account->jid);
@ -238,8 +238,8 @@ _cons_show_login_success(ProfAccount *account)
cons_alert();
}
static void
_cons_show_wins(void)
void
cons_show_wins(void)
{
ProfWin *console = wins_get_console();
cons_show("");
@ -256,8 +256,8 @@ _cons_show_wins(void)
cons_alert();
}
static void
_cons_show_room_invites(GSList *invites)
void
cons_show_room_invites(GSList *invites)
{
cons_show("");
if (invites == NULL) {
@ -273,8 +273,8 @@ _cons_show_room_invites(GSList *invites)
cons_alert();
}
static void
_cons_show_info(PContact pcontact)
void
cons_show_info(PContact pcontact)
{
ProfWin *console = wins_get_console();
win_show_info(console, pcontact);
@ -282,8 +282,8 @@ _cons_show_info(PContact pcontact)
cons_alert();
}
static void
_cons_show_caps(const char * const fulljid, resource_presence_t presence)
void
cons_show_caps(const char * const fulljid, resource_presence_t presence)
{
ProfWin *console = wins_get_console();
cons_show("");
@ -352,8 +352,8 @@ _cons_show_caps(const char * const fulljid, resource_presence_t presence)
cons_alert();
}
static void
_cons_show_software_version(const char * const jid, const char * const presence,
void
cons_show_software_version(const char * const jid, const char * const presence,
const char * const name, const char * const version, const char * const os)
{
ProfWin *console = wins_get_console();
@ -376,8 +376,8 @@ _cons_show_software_version(const char * const jid, const char * const presence
cons_alert();
}
static void
_cons_show_received_subs(void)
void
cons_show_received_subs(void)
{
GSList *received = presence_get_subscription_requests();
if (received == NULL) {
@ -395,8 +395,8 @@ _cons_show_received_subs(void)
cons_alert();
}
static void
_cons_show_sent_subs(void)
void
cons_show_sent_subs(void)
{
if (roster_has_pending_subscriptions()) {
GSList *contacts = roster_get_contacts();
@ -416,8 +416,8 @@ _cons_show_sent_subs(void)
cons_alert();
}
static void
_cons_show_room_list(GSList *rooms, const char * const conference_node)
void
cons_show_room_list(GSList *rooms, const char * const conference_node)
{
ProfWin *console = wins_get_console();
if ((rooms != NULL) && (g_slist_length(rooms) > 0)) {
@ -438,8 +438,8 @@ _cons_show_room_list(GSList *rooms, const char * const conference_node)
cons_alert();
}
static void
_cons_show_bookmarks(const GList *list)
void
cons_show_bookmarks(const GList *list)
{
ProfWin *console = wins_get_console();
@ -482,8 +482,8 @@ _cons_show_bookmarks(const GList *list)
cons_alert();
}
static void
_cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
void
cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
{
if (((identities != NULL) && (g_slist_length(identities) > 0)) ||
((features != NULL) && (g_slist_length(features) > 0))) {
@ -524,8 +524,8 @@ _cons_show_disco_info(const char *jid, GSList *identities, GSList *features)
}
}
static void
_cons_show_disco_items(GSList *items, const char * const jid)
void
cons_show_disco_items(GSList *items, const char * const jid)
{
ProfWin *console = wins_get_console();
if ((items != NULL) && (g_slist_length(items) > 0)) {
@ -548,8 +548,8 @@ _cons_show_disco_items(GSList *items, const char * const jid)
cons_alert();
}
static void
_cons_show_status(const char * const barejid)
void
cons_show_status(const char * const barejid)
{
ProfWin *console = wins_get_console();
PContact pcontact = roster_get_contact(barejid);
@ -563,8 +563,8 @@ _cons_show_status(const char * const barejid)
cons_alert();
}
static void
_cons_show_room_invite(const char * const invitor, const char * const room,
void
cons_show_room_invite(const char * const invitor, const char * const room,
const char * const reason)
{
char *display_from = NULL;
@ -599,8 +599,8 @@ _cons_show_room_invite(const char * const invitor, const char * const room,
cons_alert();
}
static void
_cons_show_account_list(gchar **accounts)
void
cons_show_account_list(gchar **accounts)
{
ProfWin *console = wins_get_console();
int size = g_strv_length(accounts);
@ -626,8 +626,8 @@ _cons_show_account_list(gchar **accounts)
cons_alert();
}
static void
_cons_show_account(ProfAccount *account)
void
cons_show_account(ProfAccount *account)
{
ProfWin *console = wins_get_console();
cons_show("");
@ -790,8 +790,8 @@ _cons_show_account(ProfAccount *account)
cons_alert();
}
static void
_cons_show_aliases(GList *aliases)
void
cons_show_aliases(GList *aliases)
{
if (aliases == NULL) {
cons_show("No aliases configured.");
@ -810,8 +810,8 @@ _cons_show_aliases(GList *aliases)
cons_show("");
}
static void
_cons_theme_setting(void)
void
cons_theme_setting(void)
{
char *theme = prefs_get_string(PREF_THEME);
if (theme == NULL) {
@ -822,8 +822,8 @@ _cons_theme_setting(void)
prefs_free_string(theme);
}
static void
_cons_privileges_setting(void)
void
cons_privileges_setting(void)
{
if (prefs_get_boolean(PREF_MUC_PRIVILEGES))
cons_show("MUC privileges (/privileges) : ON");
@ -831,8 +831,8 @@ _cons_privileges_setting(void)
cons_show("MUC privileges (/privileges) : OFF");
}
static void
_cons_beep_setting(void)
void
cons_beep_setting(void)
{
if (prefs_get_boolean(PREF_BEEP))
cons_show("Terminal beep (/beep) : ON");
@ -840,8 +840,8 @@ _cons_beep_setting(void)
cons_show("Terminal beep (/beep) : OFF");
}
static void
_cons_wrap_setting(void)
void
cons_wrap_setting(void)
{
if (prefs_get_boolean(PREF_WRAP))
cons_show("Word wrap (/wrap) : ON");
@ -849,8 +849,8 @@ _cons_wrap_setting(void)
cons_show("Word wrap (/wrap) : OFF");
}
static void
_cons_presence_setting(void)
void
cons_presence_setting(void)
{
if (prefs_get_boolean(PREF_PRESENCE))
cons_show("Contact presence (/presence) : ON");
@ -858,8 +858,8 @@ _cons_presence_setting(void)
cons_show("Contact presence (/presence) : OFF");
}
static void
_cons_flash_setting(void)
void
cons_flash_setting(void)
{
if (prefs_get_boolean(PREF_FLASH))
cons_show("Terminal flash (/flash) : ON");
@ -867,8 +867,8 @@ _cons_flash_setting(void)
cons_show("Terminal flash (/flash) : OFF");
}
static void
_cons_splash_setting(void)
void
cons_splash_setting(void)
{
if (prefs_get_boolean(PREF_SPLASH))
cons_show("Splash screen (/splash) : ON");
@ -876,8 +876,8 @@ _cons_splash_setting(void)
cons_show("Splash screen (/splash) : OFF");
}
static void
_cons_occupants_setting(void)
void
cons_occupants_setting(void)
{
if (prefs_get_boolean(PREF_OCCUPANTS))
cons_show("Occupants (/occupants) : show");
@ -888,8 +888,8 @@ _cons_occupants_setting(void)
cons_show("Occupants size (/occupants) : %d", size);
}
static void
_cons_autoconnect_setting(void)
void
cons_autoconnect_setting(void)
{
char *pref_connect_account = prefs_get_string(PREF_CONNECT_ACCOUNT);
if (pref_connect_account != NULL)
@ -900,8 +900,8 @@ _cons_autoconnect_setting(void)
prefs_free_string(pref_connect_account);
}
static void
_cons_time_setting(void)
void
cons_time_setting(void)
{
char *pref_time = prefs_get_string(PREF_TIME);
if (g_strcmp0(pref_time, "minutes") == 0)
@ -914,8 +914,8 @@ _cons_time_setting(void)
prefs_free_string(pref_time);
}
static void
_cons_vercheck_setting(void)
void
cons_vercheck_setting(void)
{
if (prefs_get_boolean(PREF_VERCHECK))
cons_show("Version checking (/vercheck) : ON");
@ -923,8 +923,8 @@ _cons_vercheck_setting(void)
cons_show("Version checking (/vercheck) : OFF");
}
static void
_cons_mouse_setting(void)
void
cons_mouse_setting(void)
{
if (prefs_get_boolean(PREF_MOUSE))
cons_show("Mouse handling (/mouse) : ON");
@ -932,8 +932,8 @@ _cons_mouse_setting(void)
cons_show("Mouse handling (/mouse) : OFF");
}
static void
_cons_statuses_setting(void)
void
cons_statuses_setting(void)
{
char *console = prefs_get_string(PREF_STATUSES_CONSOLE);
char *chat = prefs_get_string(PREF_STATUSES_CHAT);
@ -948,8 +948,8 @@ _cons_statuses_setting(void)
prefs_free_string(muc);
}
static void
_cons_titlebar_setting(void)
void
cons_titlebar_setting(void)
{
if (prefs_get_boolean(PREF_TITLEBAR)) {
cons_show("Titlebar display (/titlebar) : ON");
@ -958,8 +958,8 @@ _cons_titlebar_setting(void)
}
}
static void
_cons_roster_setting(void)
void
cons_roster_setting(void)
{
if (prefs_get_boolean(PREF_ROSTER))
cons_show("Roster (/roster) : show");
@ -980,8 +980,8 @@ _cons_roster_setting(void)
cons_show("Roster size (/roster) : %d", size);
}
static void
_cons_show_ui_prefs(void)
void
cons_show_ui_prefs(void)
{
cons_show("UI preferences:");
cons_show("");
@ -1004,8 +1004,8 @@ _cons_show_ui_prefs(void)
cons_alert();
}
static void
_cons_notify_setting(void)
void
cons_notify_setting(void)
{
gboolean notify_enabled = FALSE;
#ifdef HAVE_OSXNOTIFY
@ -1087,8 +1087,8 @@ _cons_notify_setting(void)
}
}
static void
_cons_show_desktop_prefs(void)
void
cons_show_desktop_prefs(void)
{
cons_show("Desktop notification preferences:");
cons_show("");
@ -1097,8 +1097,8 @@ _cons_show_desktop_prefs(void)
cons_alert();
}
static void
_cons_states_setting(void)
void
cons_states_setting(void)
{
if (prefs_get_boolean(PREF_STATES))
cons_show("Send chat states (/states) : ON");
@ -1106,8 +1106,8 @@ _cons_states_setting(void)
cons_show("Send chat states (/states) : OFF");
}
static void
_cons_outtype_setting(void)
void
cons_outtype_setting(void)
{
if (prefs_get_boolean(PREF_OUTTYPE))
cons_show("Send composing (/outtype) : ON");
@ -1115,8 +1115,8 @@ _cons_outtype_setting(void)
cons_show("Send composing (/outtype) : OFF");
}
static void
_cons_intype_setting(void)
void
cons_intype_setting(void)
{
if (prefs_get_boolean(PREF_INTYPE))
cons_show("Show typing (/intype) : ON");
@ -1124,8 +1124,8 @@ _cons_intype_setting(void)
cons_show("Show typing (/intype) : OFF");
}
static void
_cons_gone_setting(void)
void
cons_gone_setting(void)
{
gint gone_time = prefs_get_gone();
if (gone_time == 0) {
@ -1137,8 +1137,8 @@ _cons_gone_setting(void)
}
}
static void
_cons_history_setting(void)
void
cons_history_setting(void)
{
if (prefs_get_boolean(PREF_HISTORY))
cons_show("Chat history (/history) : ON");
@ -1146,8 +1146,8 @@ _cons_history_setting(void)
cons_show("Chat history (/history) : OFF");
}
static void
_cons_show_chat_prefs(void)
void
cons_show_chat_prefs(void)
{
cons_show("Chat preferences:");
cons_show("");
@ -1160,14 +1160,14 @@ _cons_show_chat_prefs(void)
cons_alert();
}
static void
_cons_inpblock_setting(void)
void
cons_inpblock_setting(void)
{
cons_show("Input block (/inpblock) : %d milliseconds", prefs_get_inpblock());
}
static void
_cons_log_setting(void)
void
cons_log_setting(void)
{
cons_show("Log file location : %s", get_log_file_location());
cons_show("Max log size (/log maxsize) : %d bytes", prefs_get_max_log_size());
@ -1183,8 +1183,8 @@ _cons_log_setting(void)
cons_show("Shared log (/log shared) : OFF");
}
static void
_cons_chlog_setting(void)
void
cons_chlog_setting(void)
{
if (prefs_get_boolean(PREF_CHLOG))
cons_show("Chat logging (/chlog) : ON");
@ -1192,8 +1192,8 @@ _cons_chlog_setting(void)
cons_show("Chat logging (/chlog) : OFF");
}
static void
_cons_grlog_setting(void)
void
cons_grlog_setting(void)
{
if (prefs_get_boolean(PREF_GRLOG))
cons_show("Groupchat logging (/grlog) : ON");
@ -1201,8 +1201,8 @@ _cons_grlog_setting(void)
cons_show("Groupchat logging (/grlog) : OFF");
}
static void
_cons_show_log_prefs(void)
void
cons_show_log_prefs(void)
{
cons_show("Logging preferences:");
cons_show("");
@ -1213,8 +1213,8 @@ _cons_show_log_prefs(void)
cons_alert();
}
static void
_cons_autoaway_setting(void)
void
cons_autoaway_setting(void)
{
char *pref_autoaway_mode = prefs_get_string(PREF_AUTOAWAY_MODE);
if (strcmp(pref_autoaway_mode, "off") == 0) {
@ -1242,8 +1242,8 @@ _cons_autoaway_setting(void)
}
}
static void
_cons_show_presence_prefs(void)
void
cons_show_presence_prefs(void)
{
cons_show("Presence preferences:");
cons_show("");
@ -1252,8 +1252,8 @@ _cons_show_presence_prefs(void)
cons_alert();
}
static void
_cons_reconnect_setting(void)
void
cons_reconnect_setting(void)
{
gint reconnect_interval = prefs_get_reconnect();
if (reconnect_interval == 0) {
@ -1265,8 +1265,8 @@ _cons_reconnect_setting(void)
}
}
static void
_cons_autoping_setting(void)
void
cons_autoping_setting(void)
{
gint autoping_interval = prefs_get_autoping();
if (autoping_interval == 0) {
@ -1278,15 +1278,15 @@ _cons_autoping_setting(void)
}
}
static void
_cons_priority_setting(void)
void
cons_priority_setting(void)
{
gint priority = prefs_get_priority();
cons_show("Priority (/priority) : %d", priority);
}
static void
_cons_show_connection_prefs(void)
void
cons_show_connection_prefs(void)
{
cons_show("Connection preferences:");
cons_show("");
@ -1297,8 +1297,8 @@ _cons_show_connection_prefs(void)
cons_alert();
}
static void
_cons_show_otr_prefs(void)
void
cons_show_otr_prefs(void)
{
cons_show("OTR preferences:");
cons_show("");
@ -1326,8 +1326,8 @@ _cons_show_otr_prefs(void)
cons_alert();
}
static void
_cons_show_themes(GSList *themes)
void
cons_show_themes(GSList *themes)
{
cons_show("");
@ -1344,8 +1344,8 @@ _cons_show_themes(GSList *themes)
cons_alert();
}
static void
_cons_prefs(void)
void
cons_prefs(void)
{
cons_show("");
cons_show_ui_prefs();
@ -1366,8 +1366,8 @@ _cons_prefs(void)
cons_alert();
}
static void
_cons_help(void)
void
cons_help(void)
{
cons_show("");
cons_show("Choose a help option:");
@ -1387,8 +1387,8 @@ _cons_help(void)
cons_alert();
}
static void
_cons_navigation_help(void)
void
cons_navigation_help(void)
{
cons_show("");
cons_show("Navigation:");
@ -1411,8 +1411,8 @@ _cons_navigation_help(void)
cons_alert();
}
static void
_cons_show_roster_group(const char * const group, GSList *list)
void
cons_show_roster_group(const char * const group, GSList *list)
{
cons_show("");
@ -1427,8 +1427,8 @@ _cons_show_roster_group(const char * const group, GSList *list)
cons_alert();
}
static void
_cons_show_roster(GSList *list)
void
cons_show_roster(GSList *list)
{
cons_show("");
cons_show("Roster: jid (nick) - subscription - groups");
@ -1438,8 +1438,8 @@ _cons_show_roster(GSList *list)
cons_alert();
}
static void
_cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity)
void
cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity)
{
const char *show = string_from_resource_presence(resource->presence);
char *display_str = p_contact_create_display_string(contact, resource->name);
@ -1451,8 +1451,8 @@ _cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_
free(display_str);
}
static void
_cons_show_contact_offline(PContact contact, char *resource, char *status)
void
cons_show_contact_offline(PContact contact, char *resource, char *status)
{
char *display_str = p_contact_create_display_string(contact, resource);
@ -1462,8 +1462,8 @@ _cons_show_contact_offline(PContact contact, char *resource, char *status)
free(display_str);
}
static void
_cons_show_contacts(GSList *list)
void
cons_show_contacts(GSList *list)
{
ProfWin *console = wins_get_console();
GSList *curr = list;
@ -1479,16 +1479,16 @@ _cons_show_contacts(GSList *list)
cons_alert();
}
static void
_cons_alert(void)
void
cons_alert(void)
{
if (ui_current_win_type() != WIN_CONSOLE) {
status_bar_new(1);
}
}
static void
_cons_theme_colours(void)
void
cons_theme_colours(void)
{
/*
* { "default", -1 },
@ -1620,82 +1620,4 @@ _show_roster_contacts(GSList *list, gboolean show_groups)
curr = g_slist_next(curr);
}
}
void
console_init_module(void)
{
cons_show_time = _cons_show_time;
cons_show_word = _cons_show_word;
cons_debug = _cons_debug;
cons_show = _cons_show;
cons_show_error = _cons_show_error;
cons_show_typing = _cons_show_typing;
cons_show_incoming_message = _cons_show_incoming_message;
cons_about = _cons_about;
cons_check_version = _cons_check_version;
cons_show_login_success = _cons_show_login_success;
cons_show_wins = _cons_show_wins;
cons_show_room_invites = _cons_show_room_invites;
cons_show_info = _cons_show_info;
cons_show_caps = _cons_show_caps;
cons_show_software_version = _cons_show_software_version;
cons_show_received_subs = _cons_show_received_subs;
cons_show_sent_subs = _cons_show_sent_subs;
cons_show_room_list = _cons_show_room_list;
cons_show_bookmarks = _cons_show_bookmarks;
cons_show_disco_info = _cons_show_disco_info;
cons_show_disco_items = _cons_show_disco_items;
cons_show_status = _cons_show_status;
cons_show_room_invite = _cons_show_room_invite;
cons_show_account_list = _cons_show_account_list;
cons_show_account = _cons_show_account;
cons_theme_setting = _cons_theme_setting;
cons_privileges_setting = _cons_privileges_setting;
cons_beep_setting = _cons_beep_setting;
cons_wrap_setting = _cons_wrap_setting;
cons_time_setting = _cons_time_setting;
cons_presence_setting = _cons_presence_setting;
cons_flash_setting = _cons_flash_setting;
cons_splash_setting = _cons_splash_setting;
cons_autoconnect_setting = _cons_autoconnect_setting;
cons_occupants_setting = _cons_occupants_setting;
cons_roster_setting = _cons_roster_setting;
cons_vercheck_setting = _cons_vercheck_setting;
cons_mouse_setting = _cons_mouse_setting;
cons_statuses_setting = _cons_statuses_setting;
cons_titlebar_setting = _cons_titlebar_setting;
cons_show_ui_prefs = _cons_show_ui_prefs;
cons_notify_setting = _cons_notify_setting;
cons_show_desktop_prefs = _cons_show_desktop_prefs;
cons_states_setting = _cons_states_setting;
cons_outtype_setting = _cons_outtype_setting;
cons_intype_setting = _cons_intype_setting;
cons_gone_setting = _cons_gone_setting;
cons_history_setting = _cons_history_setting;
cons_show_chat_prefs = _cons_show_chat_prefs;
cons_log_setting = _cons_log_setting;
cons_chlog_setting = _cons_chlog_setting;
cons_grlog_setting = _cons_grlog_setting;
cons_show_log_prefs = _cons_show_log_prefs;
cons_autoaway_setting = _cons_autoaway_setting;
cons_show_presence_prefs = _cons_show_presence_prefs;
cons_show_otr_prefs = _cons_show_otr_prefs;
cons_reconnect_setting = _cons_reconnect_setting;
cons_autoping_setting = _cons_autoping_setting;
cons_priority_setting = _cons_priority_setting;
cons_inpblock_setting = _cons_inpblock_setting;
cons_show_connection_prefs = _cons_show_connection_prefs;
cons_show_themes = _cons_show_themes;
cons_prefs = _cons_prefs;
cons_help = _cons_help;
cons_navigation_help = _cons_navigation_help;
cons_show_roster_group = _cons_show_roster_group;
cons_show_roster = _cons_show_roster;
cons_show_contacts = _cons_show_contacts;
cons_alert = _cons_alert;
cons_show_contact_online = _cons_show_contact_online;
cons_show_contact_offline = _cons_show_contact_offline;
cons_show_aliases = _cons_show_aliases;
cons_theme_colours = _cons_theme_colours;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -52,8 +52,8 @@
static void _notify(const char * const message, int timeout,
const char * const category);
static void
_notifier_uninit(void)
void
notifier_uninit(void)
{
#ifdef HAVE_LIBNOTIFY
if (notify_is_initted()) {
@ -62,8 +62,8 @@ _notifier_uninit(void)
#endif
}
static void
_notify_typing(const char * const handle)
void
notify_typing(const char * const handle)
{
char message[strlen(handle) + 1 + 11];
sprintf(message, "%s: typing...", handle);
@ -71,8 +71,8 @@ _notify_typing(const char * const handle)
_notify(message, 10000, "Incoming message");
}
static void
_notify_invite(const char * const from, const char * const room,
void
notify_invite(const char * const from, const char * const room,
const char * const reason)
{
GString *message = g_string_new("Room invite\nfrom: ");
@ -88,8 +88,8 @@ _notify_invite(const char * const from, const char * const room,
g_string_free(message, TRUE);
}
static void
_notify_message(const char * const handle, int win, const char * const text)
void
notify_message(const char * const handle, int win, const char * const text)
{
GString *message = g_string_new("");
g_string_append_printf(message, "%s (win %d)", handle, win);
@ -102,8 +102,8 @@ _notify_message(const char * const handle, int win, const char * const text)
g_string_free(message, TRUE);
}
static void
_notify_room_message(const char * const handle, const char * const room, int win, const char * const text)
void
notify_room_message(const char * const handle, const char * const room, int win, const char * const text)
{
GString *message = g_string_new("");
g_string_append_printf(message, "%s in %s (win %d)", handle, room, win);
@ -116,8 +116,8 @@ _notify_room_message(const char * const handle, const char * const room, int win
g_string_free(message, TRUE);
}
static void
_notify_subscription(const char * const from)
void
notify_subscription(const char * const from)
{
GString *message = g_string_new("Subscription request: \n");
g_string_append(message, from);
@ -125,8 +125,8 @@ _notify_subscription(const char * const from)
g_string_free(message, TRUE);
}
static void
_notify_remind(void)
void
notify_remind(void)
{
gint unread = ui_unread();
gint open = muc_invites_count();
@ -272,17 +272,4 @@ _notify(const char * const message, int timeout,
g_string_free(notify_command, TRUE);
#endif
}
void
notifier_init_module(void)
{
notifier_uninit = _notifier_uninit;
notify_typing = _notify_typing;
notify_invite = _notify_invite;
notify_message = _notify_message;
notify_room_message = _notify_room_message;
notify_subscription = _notify_subscription;
notify_remind = _notify_remind;
}
}

View File

@ -54,8 +54,8 @@ _occuptantswin_occupant(ProfLayoutSplit *layout, Occupant *occupant)
wattroff(layout->subwin, theme_attrs(presence_colour));
}
static void
_occupantswin_occupants(const char * const roomjid)
void
occupantswin_occupants(const char * const roomjid)
{
ProfMucWin *mucwin = wins_get_muc(roomjid);
if (mucwin) {
@ -117,10 +117,4 @@ _occupantswin_occupants(const char * const roomjid)
g_list_free(occupants);
}
}
void
occupantswin_init_module(void)
{
occupantswin_occupants = _occupantswin_occupants;
}

View File

@ -143,8 +143,8 @@ _rosterwin_contacts_by_no_group(ProfLayoutSplit *layout)
g_slist_free(contacts);
}
static void
_rosterwin_roster(void)
void
rosterwin_roster(void)
{
ProfWin *console = wins_get_console();
if (console) {
@ -192,10 +192,4 @@ _rosterwin_roster(void)
}
free(by);
}
}
void
rosterwin_init_module(void)
{
rosterwin_roster = _rosterwin_roster;
}

View File

@ -53,294 +53,288 @@
#define INP_WIN_MAX 1000
void ui_init_module(void);
void console_init_module(void);
void rosterwin_init_module(void);
void occupantswin_init_module(void);
void notifier_init_module(void);
// ui startup and control
void (*ui_init)(void);
void (*ui_load_colours)(void);
void (*ui_update)(void);
void (*ui_close)(void);
void (*ui_redraw)(void);
void (*ui_resize)(void);
GSList* (*ui_get_recipients)(void);
void (*ui_handle_special_keys)(const wint_t * const ch, const int result);
gboolean (*ui_switch_win)(const int i);
void (*ui_next_win)(void);
void (*ui_previous_win)(void);
void ui_init(void);
void ui_load_colours(void);
void ui_update(void);
void ui_close(void);
void ui_redraw(void);
void ui_resize(void);
GSList* ui_get_recipients(void);
void ui_handle_special_keys(const wint_t * const ch, const int result);
gboolean ui_switch_win(const int i);
void ui_next_win(void);
void ui_previous_win(void);
void (*ui_gone_secure)(const char * const barejid, gboolean trusted);
void (*ui_gone_insecure)(const char * const barejid);
void (*ui_trust)(const char * const barejid);
void (*ui_untrust)(const char * const barejid);
void (*ui_smp_recipient_initiated)(const char * const barejid);
void (*ui_smp_recipient_initiated_q)(const char * const barejid, const char *question);
void ui_gone_secure(const char * const barejid, gboolean trusted);
void ui_gone_insecure(const char * const barejid);
void ui_trust(const char * const barejid);
void ui_untrust(const char * const barejid);
void ui_smp_recipient_initiated(const char * const barejid);
void ui_smp_recipient_initiated_q(const char * const barejid, const char *question);
void (*ui_smp_successful)(const char * const barejid);
void (*ui_smp_unsuccessful_sender)(const char * const barejid);
void (*ui_smp_unsuccessful_receiver)(const char * const barejid);
void (*ui_smp_aborted)(const char * const barejid);
void ui_smp_successful(const char * const barejid);
void ui_smp_unsuccessful_sender(const char * const barejid);
void ui_smp_unsuccessful_receiver(const char * const barejid);
void ui_smp_aborted(const char * const barejid);
void (*ui_smp_answer_success)(const char * const barejid);
void (*ui_smp_answer_failure)(const char * const barejid);
void ui_smp_answer_success(const char * const barejid);
void ui_smp_answer_failure(const char * const barejid);
void (*ui_otr_authenticating)(const char * const barejid);
void (*ui_otr_authetication_waiting)(const char * const recipient);
void ui_otr_authenticating(const char * const barejid);
void ui_otr_authetication_waiting(const char * const recipient);
unsigned long (*ui_get_idle_time)(void);
void (*ui_reset_idle_time)(void);
void (*ui_new_chat_win)(const char * const barejid);
void (*ui_new_private_win)(const char * const fulljid);
void (*ui_print_system_msg_from_recipient)(const char * const barejid, const char *message);
gint (*ui_unread)(void);
void (*ui_close_connected_win)(int index);
int (*ui_close_all_wins)(void);
int (*ui_close_read_wins)(void);
unsigned long ui_get_idle_time(void);
void ui_reset_idle_time(void);
void ui_new_chat_win(const char * const barejid);
void ui_new_private_win(const char * const fulljid);
void ui_print_system_msg_from_recipient(const char * const barejid, const char *message);
gint ui_unread(void);
void ui_close_connected_win(int index);
int ui_close_all_wins(void);
int ui_close_read_wins(void);
// current window actions
void (*ui_clear_current)(void);
win_type_t (*ui_current_win_type)(void);
int (*ui_current_win_index)(void);
gboolean (*ui_current_win_is_otr)(void);
void ui_clear_current(void);
win_type_t ui_current_win_type(void);
int ui_current_win_index(void);
gboolean ui_current_win_is_otr(void);
ProfChatWin *(*ui_get_current_chat)(void);
ProfChatWin *ui_get_current_chat(void);
void (*ui_current_print_line)(const char * const msg, ...);
void (*ui_current_print_formatted_line)(const char show_char, int attrs, const char * const msg, ...);
void (*ui_current_error_line)(const char * const msg);
void ui_current_print_line(const char * const msg, ...);
void ui_current_print_formatted_line(const char show_char, int attrs, const char * const msg, ...);
void ui_current_error_line(const char * const msg);
win_type_t (*ui_win_type)(int index);
void (*ui_close_win)(int index);
gboolean (*ui_win_exists)(int index);
int (*ui_win_unread)(int index);
char * (*ui_ask_password)(void);
win_type_t ui_win_type(int index);
void ui_close_win(int index);
gboolean ui_win_exists(int index);
int ui_win_unread(int index);
char * ui_ask_password(void);
void (*ui_handle_stanza)(const char * const msg);
void ui_handle_stanza(const char * const msg);
// ui events
void (*ui_contact_typing)(const char * const from);
void (*ui_incoming_msg)(const char * const from, const char * const message, GTimeVal *tv_stamp);
void (*ui_incoming_private_msg)(const char * const fulljid, const char * const message, GTimeVal *tv_stamp);
void ui_contact_typing(const char * const from);
void ui_incoming_msg(const char * const from, const char * const message, GTimeVal *tv_stamp);
void ui_incoming_private_msg(const char * const fulljid, const char * const message, GTimeVal *tv_stamp);
void (*ui_disconnected)(void);
void (*ui_recipient_gone)(const char * const barejid);
void ui_disconnected(void);
void ui_recipient_gone(const char * const barejid);
void (*ui_outgoing_chat_msg)(const char * const from, const char * const barejid,
void ui_outgoing_chat_msg(const char * const from, const char * const barejid,
const char * const message);
void (*ui_outgoing_private_msg)(const char * const from, const char * const fulljid,
void ui_outgoing_private_msg(const char * const from, const char * const fulljid,
const char * const message);
void (*ui_room_join)(const char * const roomjid, gboolean focus);
void (*ui_switch_to_room)(const char * const roomjid);
void ui_room_join(const char * const roomjid, gboolean focus);
void ui_switch_to_room(const char * const roomjid);
void (*ui_room_role_change)(const char * const roomjid, const char * const role, const char * const actor,
void ui_room_role_change(const char * const roomjid, const char * const role, const char * const actor,
const char * const reason);
void (*ui_room_affiliation_change)(const char * const roomjid, const char * const affiliation, const char * const actor,
void ui_room_affiliation_change(const char * const roomjid, const char * const affiliation, const char * const actor,
const char * const reason);
void (*ui_room_role_and_affiliation_change)(const char * const roomjid, const char * const role,
void ui_room_role_and_affiliation_change(const char * const roomjid, const char * const role,
const char * const affiliation, const char * const actor, const char * const reason);
void (*ui_room_occupant_role_change)(const char * const roomjid, const char * const nick, const char * const role,
void ui_room_occupant_role_change(const char * const roomjid, const char * const nick, const char * const role,
const char * const actor, const char * const reason);
void (*ui_room_occupant_affiliation_change)(const char * const roomjid, const char * const nick, const char * const affiliation,
void ui_room_occupant_affiliation_change(const char * const roomjid, const char * const nick, const char * const affiliation,
const char * const actor, const char * const reason);
void (*ui_room_occupant_role_and_affiliation_change)(const char * const roomjid, const char * const nick, const char * const role,
void ui_room_occupant_role_and_affiliation_change(const char * const roomjid, const char * const nick, const char * const role,
const char * const affiliation, const char * const actor, const char * const reason);
void (*ui_room_roster)(const char * const roomjid, GList *occupants, const char * const presence);
void (*ui_room_history)(const char * const roomjid, const char * const nick,
void ui_room_roster(const char * const roomjid, GList *occupants, const char * const presence);
void ui_room_history(const char * const roomjid, const char * const nick,
GTimeVal tv_stamp, const char * const message);
void (*ui_room_message)(const char * const roomjid, const char * const nick,
void ui_room_message(const char * const roomjid, const char * const nick,
const char * const message);
void (*ui_room_subject)(const char * const roomjid, const char * const nick, const char * const subject);
void (*ui_room_requires_config)(const char * const roomjid);
void (*ui_room_destroy)(const char * const roomjid);
void (*ui_show_room_info)(ProfMucWin *mucwin);
void (*ui_show_room_role_list)(ProfMucWin *mucwin, muc_role_t role);
void (*ui_show_room_affiliation_list)(ProfMucWin *mucwin, muc_affiliation_t affiliation);
void (*ui_handle_room_info_error)(const char * const roomjid, const char * const error);
void (*ui_show_room_disco_info)(const char * const roomjid, GSList *identities, GSList *features);
void (*ui_room_destroyed)(const char * const roomjid, const char * const reason, const char * const new_jid,
void ui_room_subject(const char * const roomjid, const char * const nick, const char * const subject);
void ui_room_requires_config(const char * const roomjid);
void ui_room_destroy(const char * const roomjid);
void ui_show_room_info(ProfMucWin *mucwin);
void ui_show_room_role_list(ProfMucWin *mucwin, muc_role_t role);
void ui_show_room_affiliation_list(ProfMucWin *mucwin, muc_affiliation_t affiliation);
void ui_handle_room_info_error(const char * const roomjid, const char * const error);
void ui_show_room_disco_info(const char * const roomjid, GSList *identities, GSList *features);
void ui_room_destroyed(const char * const roomjid, const char * const reason, const char * const new_jid,
const char * const password);
void (*ui_room_kicked)(const char * const roomjid, const char * const actor, const char * const reason);
void (*ui_room_member_kicked)(const char * const roomjid, const char * const nick, const char * const actor,
void ui_room_kicked(const char * const roomjid, const char * const actor, const char * const reason);
void ui_room_member_kicked(const char * const roomjid, const char * const nick, const char * const actor,
const char * const reason);
void (*ui_room_banned)(const char * const roomjid, const char * const actor, const char * const reason);
void (*ui_room_member_banned)(const char * const roomjid, const char * const nick, const char * const actor,
void ui_room_banned(const char * const roomjid, const char * const actor, const char * const reason);
void ui_room_member_banned(const char * const roomjid, const char * const nick, const char * const actor,
const char * const reason);
void (*ui_leave_room)(const char * const roomjid);
void (*ui_room_broadcast)(const char * const roomjid,
void ui_leave_room(const char * const roomjid);
void ui_room_broadcast(const char * const roomjid,
const char * const message);
void (*ui_room_member_offline)(const char * const roomjid, const char * const nick);
void (*ui_room_member_online)(const char * const roomjid, const char * const nick, const char * const roles,
void ui_room_member_offline(const char * const roomjid, const char * const nick);
void ui_room_member_online(const char * const roomjid, const char * const nick, const char * const roles,
const char * const affiliation, const char * const show, const char * const status);
void (*ui_room_member_nick_change)(const char * const roomjid,
void ui_room_member_nick_change(const char * const roomjid,
const char * const old_nick, const char * const nick);
void (*ui_room_nick_change)(const char * const roomjid, const char * const nick);
void (*ui_room_member_presence)(const char * const roomjid,
void ui_room_nick_change(const char * const roomjid, const char * const nick);
void ui_room_member_presence(const char * const roomjid,
const char * const nick, const char * const show, const char * const status);
void (*ui_room_show_occupants)(const char * const roomjid);
void (*ui_room_hide_occupants)(const char * const roomjid);
void (*ui_show_roster)(void);
void (*ui_hide_roster)(void);
void (*ui_roster_add)(const char * const barejid, const char * const name);
void (*ui_roster_remove)(const char * const barejid);
void (*ui_contact_already_in_group)(const char * const contact, const char * const group);
void (*ui_contact_not_in_group)(const char * const contact, const char * const group);
void (*ui_group_added)(const char * const contact, const char * const group);
void (*ui_group_removed)(const char * const contact, const char * const group);
void (*ui_chat_win_contact_online)(PContact contact, Resource *resource, GDateTime *last_activity);
void (*ui_chat_win_contact_offline)(PContact contact, char *resource, char *status);
void (*ui_handle_recipient_not_found)(const char * const recipient, const char * const err_msg);
void (*ui_handle_recipient_error)(const char * const recipient, const char * const err_msg);
void (*ui_handle_error)(const char * const err_msg);
void (*ui_clear_win_title)(void);
void (*ui_handle_room_join_error)(const char * const roomjid, const char * const err);
void (*ui_handle_room_configuration)(const char * const roomjid, DataForm *form);
void (*ui_handle_room_configuration_form_error)(const char * const roomjid, const char * const message);
void (*ui_handle_room_config_submit_result)(const char * const roomjid);
void (*ui_handle_room_config_submit_result_error)(const char * const roomjid, const char * const message);
void (*ui_handle_room_affiliation_list_error)(const char * const roomjid, const char * const affiliation,
void ui_room_show_occupants(const char * const roomjid);
void ui_room_hide_occupants(const char * const roomjid);
void ui_show_roster(void);
void ui_hide_roster(void);
void ui_roster_add(const char * const barejid, const char * const name);
void ui_roster_remove(const char * const barejid);
void ui_contact_already_in_group(const char * const contact, const char * const group);
void ui_contact_not_in_group(const char * const contact, const char * const group);
void ui_group_added(const char * const contact, const char * const group);
void ui_group_removed(const char * const contact, const char * const group);
void ui_chat_win_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
void ui_chat_win_contact_offline(PContact contact, char *resource, char *status);
void ui_handle_recipient_not_found(const char * const recipient, const char * const err_msg);
void ui_handle_recipient_error(const char * const recipient, const char * const err_msg);
void ui_handle_error(const char * const err_msg);
void ui_clear_win_title(void);
void ui_handle_room_join_error(const char * const roomjid, const char * const err);
void ui_handle_room_configuration(const char * const roomjid, DataForm *form);
void ui_handle_room_configuration_form_error(const char * const roomjid, const char * const message);
void ui_handle_room_config_submit_result(const char * const roomjid);
void ui_handle_room_config_submit_result_error(const char * const roomjid, const char * const message);
void ui_handle_room_affiliation_list_error(const char * const roomjid, const char * const affiliation,
const char * const error);
void (*ui_handle_room_affiliation_list)(const char * const roomjid, const char * const affiliation, GSList *jids);
void (*ui_handle_room_affiliation_set_error)(const char * const roomjid, const char * const jid,
void ui_handle_room_affiliation_list(const char * const roomjid, const char * const affiliation, GSList *jids);
void ui_handle_room_affiliation_set_error(const char * const roomjid, const char * const jid,
const char * const affiliation, const char * const error);
void (*ui_handle_room_role_set_error)(const char * const roomjid, const char * const nick, const char * const role,
void ui_handle_room_role_set_error(const char * const roomjid, const char * const nick, const char * const role,
const char * const error);
void (*ui_handle_room_role_list_error)(const char * const roomjid, const char * const role, const char * const error);
void (*ui_handle_room_role_list)(const char * const roomjid, const char * const role, GSList *nicks);
void (*ui_handle_room_kick_error)(const char * const roomjid, const char * const nick, const char * const error);
void (*ui_show_form)(ProfMucConfWin *confwin);
void (*ui_show_form_field)(ProfWin *window, DataForm *form, char *tag);
void (*ui_show_form_help)(ProfMucConfWin *confwin);
void (*ui_show_form_field_help)(ProfMucConfWin *confwin, char *tag);
void (*ui_show_lines)(ProfWin *window, const gchar** lines);
void (*ui_redraw_all_room_rosters)(void);
void (*ui_show_all_room_rosters)(void);
void (*ui_hide_all_room_rosters)(void);
void ui_handle_room_role_list_error(const char * const roomjid, const char * const role, const char * const error);
void ui_handle_room_role_list(const char * const roomjid, const char * const role, GSList *nicks);
void ui_handle_room_kick_error(const char * const roomjid, const char * const nick, const char * const error);
void ui_show_form(ProfMucConfWin *confwin);
void ui_show_form_field(ProfWin *window, DataForm *form, char *tag);
void ui_show_form_help(ProfMucConfWin *confwin);
void ui_show_form_field_help(ProfMucConfWin *confwin, char *tag);
void ui_show_lines(ProfWin *window, const gchar** lines);
void ui_redraw_all_room_rosters(void);
void ui_show_all_room_rosters(void);
void ui_hide_all_room_rosters(void);
void (*ui_tidy_wins)(void);
void (*ui_prune_wins)(void);
gboolean (*ui_swap_wins)(int source_win, int target_win);
void ui_tidy_wins(void);
void ui_prune_wins(void);
gboolean ui_swap_wins(int source_win, int target_win);
void (*ui_auto_away)(void);
void (*ui_end_auto_away)(void);
void (*ui_titlebar_presence)(contact_presence_t presence);
void (*ui_handle_login_account_success)(ProfAccount *account);
void (*ui_update_presence)(const resource_presence_t resource_presence,
void ui_auto_away(void);
void ui_end_auto_away(void);
void ui_titlebar_presence(contact_presence_t presence);
void ui_handle_login_account_success(ProfAccount *account);
void ui_update_presence(const resource_presence_t resource_presence,
const char * const message, const char * const show);
void (*ui_about)(void);
void (*ui_statusbar_new)(const int win);
void ui_about(void);
void ui_statusbar_new(const int win);
wint_t (*ui_get_char)(char *input, int *size, int *result);
void (*ui_input_clear)(void);
void (*ui_input_nonblocking)(void);
void (*ui_replace_input)(char *input, const char * const new_input, int *size);
wint_t ui_get_char(char *input, int *size, int *result);
void ui_input_clear(void);
void ui_input_nonblocking(void);
void ui_replace_input(char *input, const char * const new_input, int *size);
void (*ui_invalid_command_usage)(const char * const usage, void (**setting_func)(void));
void ui_invalid_command_usage(const char * const usage, void (*setting_func)(void));
void (*ui_create_xmlconsole_win)(void);
gboolean (*ui_xmlconsole_exists)(void);
void (*ui_open_xmlconsole_win)(void);
void ui_create_xmlconsole_win(void);
gboolean ui_xmlconsole_exists(void);
void ui_open_xmlconsole_win(void);
gboolean (*ui_win_has_unsaved_form)(int num);
gboolean ui_win_has_unsaved_form(int num);
// console window actions
void (*cons_show)(const char * const msg, ...);
void (*cons_about)(void);
void (*cons_help)(void);
void (*cons_navigation_help)(void);
void (*cons_prefs)(void);
void (*cons_show_ui_prefs)(void);
void (*cons_show_desktop_prefs)(void);
void (*cons_show_chat_prefs)(void);
void (*cons_show_log_prefs)(void);
void (*cons_show_presence_prefs)(void);
void (*cons_show_connection_prefs)(void);
void (*cons_show_otr_prefs)(void);
void (*cons_show_account)(ProfAccount *account);
void (*cons_debug)(const char * const msg, ...);
void (*cons_show_time)(void);
void (*cons_show_word)(const char * const word);
void (*cons_show_error)(const char * const cmd, ...);
void (*cons_show_contacts)(GSList * list);
void (*cons_show_roster)(GSList * list);
void (*cons_show_roster_group)(const char * const group, GSList * list);
void (*cons_show_wins)(void);
void (*cons_show_status)(const char * const barejid);
void (*cons_show_info)(PContact pcontact);
void (*cons_show_caps)(const char * const fulljid, resource_presence_t presence);
void (*cons_show_themes)(GSList *themes);
void (*cons_show_aliases)(GList *aliases);
void (*cons_show_login_success)(ProfAccount *account);
void (*cons_show_software_version)(const char * const jid,
void cons_show(const char * const msg, ...);
void cons_about(void);
void cons_help(void);
void cons_navigation_help(void);
void cons_prefs(void);
void cons_show_ui_prefs(void);
void cons_show_desktop_prefs(void);
void cons_show_chat_prefs(void);
void cons_show_log_prefs(void);
void cons_show_presence_prefs(void);
void cons_show_connection_prefs(void);
void cons_show_otr_prefs(void);
void cons_show_account(ProfAccount *account);
void cons_debug(const char * const msg, ...);
void cons_show_time(void);
void cons_show_word(const char * const word);
void cons_show_error(const char * const cmd, ...);
void cons_show_contacts(GSList * list);
void cons_show_roster(GSList * list);
void cons_show_roster_group(const char * const group, GSList * list);
void cons_show_wins(void);
void cons_show_status(const char * const barejid);
void cons_show_info(PContact pcontact);
void cons_show_caps(const char * const fulljid, resource_presence_t presence);
void cons_show_themes(GSList *themes);
void cons_show_aliases(GList *aliases);
void cons_show_login_success(ProfAccount *account);
void cons_show_software_version(const char * const jid,
const char * const presence, const char * const name,
const char * const version, const char * const os);
void (*cons_show_account_list)(gchar **accounts);
void (*cons_show_room_list)(GSList *room, const char * const conference_node);
void (*cons_show_bookmarks)(const GList *list);
void (*cons_show_disco_items)(GSList *items, const char * const jid);
void (*cons_show_disco_info)(const char *from, GSList *identities, GSList *features);
void (*cons_show_room_invite)(const char * const invitor, const char * const room,
void cons_show_account_list(gchar **accounts);
void cons_show_room_list(GSList *room, const char * const conference_node);
void cons_show_bookmarks(const GList *list);
void cons_show_disco_items(GSList *items, const char * const jid);
void cons_show_disco_info(const char *from, GSList *identities, GSList *features);
void cons_show_room_invite(const char * const invitor, const char * const room,
const char * const reason);
void (*cons_check_version)(gboolean not_available_msg);
void (*cons_show_typing)(const char * const barejid);
void (*cons_show_incoming_message)(const char * const short_from, const int win_index);
void (*cons_show_room_invites)(GSList *invites);
void (*cons_show_received_subs)(void);
void (*cons_show_sent_subs)(void);
void (*cons_alert)(void);
void (*cons_theme_setting)(void);
void (*cons_privileges_setting)(void);
void (*cons_beep_setting)(void);
void (*cons_flash_setting)(void);
void (*cons_splash_setting)(void);
void (*cons_vercheck_setting)(void);
void (*cons_occupants_setting)(void);
void (*cons_roster_setting)(void);
void (*cons_presence_setting)(void);
void (*cons_wrap_setting)(void);
void (*cons_time_setting)(void);
void (*cons_mouse_setting)(void);
void (*cons_statuses_setting)(void);
void (*cons_titlebar_setting)(void);
void (*cons_notify_setting)(void);
void (*cons_show_desktop_prefs)(void);
void (*cons_states_setting)(void);
void (*cons_outtype_setting)(void);
void (*cons_intype_setting)(void);
void (*cons_gone_setting)(void);
void (*cons_history_setting)(void);
void (*cons_log_setting)(void);
void (*cons_chlog_setting)(void);
void (*cons_grlog_setting)(void);
void (*cons_autoaway_setting)(void);
void (*cons_reconnect_setting)(void);
void (*cons_autoping_setting)(void);
void (*cons_priority_setting)(void);
void (*cons_autoconnect_setting)(void);
void (*cons_inpblock_setting)(void);
void (*cons_show_contact_online)(PContact contact, Resource *resource, GDateTime *last_activity);
void (*cons_show_contact_offline)(PContact contact, char *resource, char *status);
void (*cons_theme_colours)(void);
void cons_check_version(gboolean not_available_msg);
void cons_show_typing(const char * const barejid);
void cons_show_incoming_message(const char * const short_from, const int win_index);
void cons_show_room_invites(GSList *invites);
void cons_show_received_subs(void);
void cons_show_sent_subs(void);
void cons_alert(void);
void cons_theme_setting(void);
void cons_privileges_setting(void);
void cons_beep_setting(void);
void cons_flash_setting(void);
void cons_splash_setting(void);
void cons_vercheck_setting(void);
void cons_occupants_setting(void);
void cons_roster_setting(void);
void cons_presence_setting(void);
void cons_wrap_setting(void);
void cons_time_setting(void);
void cons_mouse_setting(void);
void cons_statuses_setting(void);
void cons_titlebar_setting(void);
void cons_notify_setting(void);
void cons_show_desktop_prefs(void);
void cons_states_setting(void);
void cons_outtype_setting(void);
void cons_intype_setting(void);
void cons_gone_setting(void);
void cons_history_setting(void);
void cons_log_setting(void);
void cons_chlog_setting(void);
void cons_grlog_setting(void);
void cons_autoaway_setting(void);
void cons_reconnect_setting(void);
void cons_autoping_setting(void);
void cons_priority_setting(void);
void cons_autoconnect_setting(void);
void cons_inpblock_setting(void);
void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *last_activity);
void cons_show_contact_offline(PContact contact, char *resource, char *status);
void cons_theme_colours(void);
// roster window
void (*rosterwin_roster)(void);
void rosterwin_roster(void);
// occupants window
void (*occupantswin_occupants)(const char * const room);
void occupantswin_occupants(const char * const room);
// desktop notifier actions
void (*notifier_uninit)(void);
void notifier_uninit(void);
void (*notify_typing)(const char * const handle);
void (*notify_message)(const char * const handle, int win, const char * const text);
void (*notify_room_message)(const char * const handle, const char * const room,
void notify_typing(const char * const handle);
void notify_message(const char * const handle, int win, const char * const text);
void notify_room_message(const char * const handle, const char * const room,
int win, const char * const text);
void (*notify_remind)(void);
void (*notify_invite)(const char * const from, const char * const room,
void notify_remind(void);
void notify_invite(const char * const from, const char * const room,
const char * const reason);
void (*notify_subscription)(const char * const from);
void notify_subscription(const char * const from);
#endif

View File

@ -88,8 +88,8 @@ bookmark_request(void)
xmpp_stanza_release(iq);
}
static gboolean
_bookmark_add(const char *jid, const char *nick, const char *password, const char *autojoin_str)
gboolean
bookmark_add(const char *jid, const char *nick, const char *password, const char *autojoin_str)
{
if (autocomplete_contains(bookmark_ac, jid)) {
return FALSE;
@ -121,8 +121,8 @@ _bookmark_add(const char *jid, const char *nick, const char *password, const cha
}
}
static gboolean
_bookmark_update(const char *jid, const char *nick, const char *password, const char *autojoin_str)
gboolean
bookmark_update(const char *jid, const char *nick, const char *password, const char *autojoin_str)
{
Bookmark *item = malloc(sizeof(*item));
item->jid = strdup(jid);
@ -156,8 +156,8 @@ _bookmark_update(const char *jid, const char *nick, const char *password, const
}
}
static gboolean
_bookmark_join(const char *jid)
gboolean
bookmark_join(const char *jid)
{
Bookmark *item = malloc(sizeof(*item));
item->jid = strdup(jid);
@ -188,8 +188,8 @@ _bookmark_join(const char *jid)
}
}
static gboolean
_bookmark_remove(const char *jid)
gboolean
bookmark_remove(const char *jid)
{
Bookmark *item = malloc(sizeof(*item));
item->jid = strdup(jid);
@ -213,20 +213,20 @@ _bookmark_remove(const char *jid)
}
}
static const GList *
_bookmark_get_list(void)
const GList *
bookmark_get_list(void)
{
return bookmark_list;
}
static char *
_bookmark_find(char *search_str)
char *
bookmark_find(char *search_str)
{
return autocomplete_complete(bookmark_ac, search_str, TRUE);
}
static void
_bookmark_autocomplete_reset(void)
void
bookmark_autocomplete_reset(void)
{
if (bookmark_ac != NULL) {
autocomplete_reset(bookmark_ac);
@ -468,16 +468,4 @@ _send_bookmarks(void)
xmpp_send(conn, iq);
xmpp_stanza_release(iq);
}
void
bookmark_init_module(void)
{
bookmark_add = _bookmark_add;
bookmark_update = _bookmark_update;
bookmark_remove = _bookmark_remove;
bookmark_join = _bookmark_join;
bookmark_get_list = _bookmark_get_list;
bookmark_find = _bookmark_find;
bookmark_autocomplete_reset = _bookmark_autocomplete_reset;
}
}

View File

@ -60,7 +60,6 @@ static GHashTable *jid_to_caps;
static char *my_sha1;
static void _caps_destroy(Capabilities *caps);
static gchar* _get_cache_file(void);
static void _save_cache(void);
static Capabilities * _caps_by_ver(const char * const ver);
@ -82,7 +81,7 @@ caps_init(void)
NULL);
jid_to_ver = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
jid_to_caps = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)_caps_destroy);
jid_to_caps = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify)caps_destroy);
my_sha1 = NULL;
}
@ -227,8 +226,8 @@ _caps_by_jid(const char * const jid)
return g_hash_table_lookup(jid_to_caps, jid);
}
static Capabilities *
_caps_lookup(const char * const jid)
Capabilities *
caps_lookup(const char * const jid)
{
char *ver = g_hash_table_lookup(jid_to_ver, jid);
if (ver) {
@ -624,8 +623,8 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
return query;
}
static void
_caps_close(void)
void
caps_close(void)
{
g_key_file_free(cache);
cache = NULL;
@ -633,8 +632,8 @@ _caps_close(void)
g_hash_table_destroy(jid_to_caps);
}
static void
_caps_destroy(Capabilities *caps)
void
caps_destroy(Capabilities *caps)
{
if (caps != NULL) {
free(caps->category);
@ -672,12 +671,4 @@ _save_cache(void)
g_file_set_contents(cache_loc, g_cache_data, g_data_size, NULL);
g_chmod(cache_loc, S_IRUSR | S_IWUSR);
g_free(g_cache_data);
}
void
capabilities_init_module(void)
{
caps_lookup = _caps_lookup;
caps_close = _caps_close;
caps_destroy = _caps_destroy;
}
}

View File

@ -104,8 +104,8 @@ void _connection_free_saved_account(void);
void _connection_free_saved_details(void);
void _connection_free_session_data(void);
static void
_jabber_init(const int disable_tls)
void
jabber_init(const int disable_tls)
{
log_info("Initialising XMPP");
jabber_conn.conn_status = JABBER_STARTED;
@ -121,8 +121,8 @@ _jabber_init(const int disable_tls)
xmpp_initialize();
}
static jabber_conn_status_t
_jabber_connect_with_account(const ProfAccount * const account)
jabber_conn_status_t
jabber_connect_with_account(const ProfAccount * const account)
{
assert(account != NULL);
@ -147,8 +147,8 @@ _jabber_connect_with_account(const ProfAccount * const account)
return result;
}
static jabber_conn_status_t
_jabber_connect_with_details(const char * const jid,
jabber_conn_status_t
jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain, const int port)
{
assert(jid != NULL);
@ -184,8 +184,8 @@ _jabber_connect_with_details(const char * const jid,
return _jabber_connect(saved_details.jid, passwd, saved_details.altdomain, saved_details.port);
}
static void
_jabber_disconnect(void)
void
jabber_disconnect(void)
{
// if connected, send end stream and wait for response
if (jabber_conn.conn_status == JABBER_CONNECTED) {
@ -214,8 +214,8 @@ _jabber_disconnect(void)
FREE_SET_NULL(jabber_conn.domain);
}
static void
_jabber_shutdown(void)
void
jabber_shutdown(void)
{
_connection_free_saved_account();
_connection_free_saved_details();
@ -224,8 +224,8 @@ _jabber_shutdown(void)
free(jabber_conn.log);
}
static void
_jabber_process_events(void)
void
jabber_process_events(void)
{
int reconnect_sec;
@ -250,14 +250,14 @@ _jabber_process_events(void)
}
}
static GList *
_jabber_get_available_resources(void)
GList *
jabber_get_available_resources(void)
{
return g_hash_table_get_values(available_resources);
}
static jabber_conn_status_t
_jabber_get_connection_status(void)
jabber_conn_status_t
jabber_get_connection_status(void)
{
return (jabber_conn.conn_status);
}
@ -274,26 +274,26 @@ connection_get_ctx(void)
return jabber_conn.ctx;
}
static const char *
_jabber_get_fulljid(void)
const char *
jabber_get_fulljid(void)
{
return xmpp_conn_get_jid(jabber_conn.conn);
}
static const char *
_jabber_get_domain(void)
const char *
jabber_get_domain(void)
{
return jabber_conn.domain;
}
static char *
_jabber_get_presence_message(void)
char *
jabber_get_presence_message(void)
{
return jabber_conn.presence_message;
}
static char *
_jabber_get_account_name(void)
char *
jabber_get_account_name(void)
{
return saved_account.name;
}
@ -572,21 +572,4 @@ _xmpp_get_file_logger()
file_log->userdata = &level;
return file_log;
}
void
jabber_init_module(void)
{
jabber_init = _jabber_init;
jabber_connect_with_account = _jabber_connect_with_account;
jabber_connect_with_details = _jabber_connect_with_details;
jabber_disconnect = _jabber_disconnect;
jabber_shutdown = _jabber_shutdown;
jabber_process_events = _jabber_process_events;
jabber_get_available_resources = _jabber_get_available_resources;
jabber_get_connection_status = _jabber_get_connection_status;
jabber_get_fulljid = _jabber_get_fulljid;
jabber_get_domain = _jabber_get_domain;
jabber_get_presence_message = _jabber_get_presence_message;
jabber_get_account_name = _jabber_get_account_name;
}
}

View File

@ -379,8 +379,8 @@ _free_field(FormField *field)
}
}
static void
_form_destroy(DataForm *form)
void
form_destroy(DataForm *form)
{
if (form) {
free(form->type);
@ -400,8 +400,8 @@ _field_compare_by_var(FormField *a, FormField *b)
return g_strcmp0(a->var, b->var);
}
static GSList *
_form_get_non_form_type_fields_sorted(DataForm *form)
GSList *
form_get_non_form_type_fields_sorted(DataForm *form)
{
GSList *sorted = NULL;
GSList *curr = form->fields;
@ -416,8 +416,8 @@ _form_get_non_form_type_fields_sorted(DataForm *form)
return sorted;
}
static GSList *
_form_get_field_values_sorted(FormField *field)
GSList *
form_get_field_values_sorted(FormField *field)
{
GSList *sorted = NULL;
GSList *curr = field->values;
@ -432,8 +432,8 @@ _form_get_field_values_sorted(FormField *field)
return sorted;
}
static char *
_form_get_form_type_field(DataForm *form)
char *
form_get_form_type_field(DataForm *form)
{
GSList *curr = form->fields;
while (curr) {
@ -447,8 +447,8 @@ _form_get_form_type_field(DataForm *form)
return NULL;
}
static gboolean
_form_tag_exists(DataForm *form, const char * const tag)
gboolean
form_tag_exists(DataForm *form, const char * const tag)
{
GList *tags = g_hash_table_get_keys(form->tag_to_var);
GList *curr = tags;
@ -463,8 +463,8 @@ _form_tag_exists(DataForm *form, const char * const tag)
return FALSE;
}
static form_field_type_t
_form_get_field_type(DataForm *form, const char * const tag)
form_field_type_t
form_get_field_type(DataForm *form, const char * const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -480,8 +480,8 @@ _form_get_field_type(DataForm *form, const char * const tag)
return FIELD_UNKNOWN;
}
static void
_form_set_value(DataForm *form, const char * const tag, char *value)
void
form_set_value(DataForm *form, const char * const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -505,8 +505,8 @@ _form_set_value(DataForm *form, const char * const tag, char *value)
}
}
static void
_form_add_value(DataForm *form, const char * const tag, char *value)
void
form_add_value(DataForm *form, const char * const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -530,8 +530,8 @@ _form_add_value(DataForm *form, const char * const tag, char *value)
}
}
static gboolean
_form_add_unique_value(DataForm *form, const char * const tag, char *value)
gboolean
form_add_unique_value(DataForm *form, const char * const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -561,8 +561,8 @@ _form_add_unique_value(DataForm *form, const char * const tag, char *value)
return FALSE;
}
static gboolean
_form_remove_value(DataForm *form, const char * const tag, char *value)
gboolean
form_remove_value(DataForm *form, const char * const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -591,8 +591,8 @@ _form_remove_value(DataForm *form, const char * const tag, char *value)
return FALSE;
}
static gboolean
_form_remove_text_multi_value(DataForm *form, const char * const tag, int index)
gboolean
form_remove_text_multi_value(DataForm *form, const char * const tag, int index)
{
index--;
char *var = g_hash_table_lookup(form->tag_to_var, tag);
@ -623,8 +623,8 @@ _form_remove_text_multi_value(DataForm *form, const char * const tag, int index)
return FALSE;
}
static int
_form_get_value_count(DataForm *form, const char * const tag)
int
form_get_value_count(DataForm *form, const char * const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -645,8 +645,8 @@ _form_get_value_count(DataForm *form, const char * const tag)
return 0;
}
static gboolean
_form_field_contains_option(DataForm *form, const char * const tag, char *value)
gboolean
form_field_contains_option(DataForm *form, const char * const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -670,8 +670,8 @@ _form_field_contains_option(DataForm *form, const char * const tag, char *value)
return FALSE;
}
static FormField *
_form_get_field_by_tag(DataForm *form, const char * const tag)
FormField *
form_get_field_by_tag(DataForm *form, const char * const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -687,8 +687,8 @@ _form_get_field_by_tag(DataForm *form, const char * const tag)
return NULL;
}
static Autocomplete
_form_get_value_ac(DataForm *form, const char * const tag)
Autocomplete
form_get_value_ac(DataForm *form, const char * const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -704,8 +704,8 @@ _form_get_value_ac(DataForm *form, const char * const tag)
return NULL;
}
static void
_form_reset_autocompleters(DataForm *form)
void
form_reset_autocompleters(DataForm *form)
{
autocomplete_reset(form->tag_ac);
GSList *curr_field = form->fields;
@ -714,25 +714,4 @@ _form_reset_autocompleters(DataForm *form)
autocomplete_reset(field->value_ac);
curr_field = g_slist_next(curr_field);
}
}
void
form_init_module(void)
{
form_destroy = _form_destroy;
form_get_form_type_field = _form_get_form_type_field;
form_get_field_type = _form_get_field_type;
form_set_value = _form_set_value;
form_add_unique_value = _form_add_unique_value;
form_add_value = _form_add_value;
form_remove_value = _form_remove_value;
form_remove_text_multi_value = _form_remove_text_multi_value;
form_field_contains_option = _form_field_contains_option;
form_tag_exists = _form_tag_exists;
form_get_value_count = _form_get_value_count;
form_get_value_ac = _form_get_value_ac;
form_get_field_by_tag = _form_get_field_by_tag;
form_reset_autocompleters = _form_reset_autocompleters;
form_get_non_form_type_fields_sorted = _form_get_non_form_type_fields_sorted;
form_get_field_values_sorted = _form_get_field_values_sorted;
}
}

View File

@ -125,8 +125,8 @@ iq_add_handlers(void)
}
}
static void
_iq_set_autoping(const int seconds)
void
iq_set_autoping(const int seconds)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -142,8 +142,8 @@ _iq_set_autoping(const int seconds)
}
}
static void
_iq_room_list_request(gchar *conferencejid)
void
iq_room_list_request(gchar *conferencejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -152,8 +152,8 @@ _iq_room_list_request(gchar *conferencejid)
xmpp_stanza_release(iq);
}
static void
_iq_disco_info_request(gchar *jid)
void
iq_disco_info_request(gchar *jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -168,8 +168,8 @@ _iq_disco_info_request(gchar *jid)
xmpp_stanza_release(iq);
}
static void
_iq_room_info_request(gchar *room)
void
iq_room_info_request(gchar *room)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -184,8 +184,8 @@ _iq_room_info_request(gchar *room)
xmpp_stanza_release(iq);
}
static void
_iq_send_caps_request_for_jid(const char * const to, const char * const id,
void
iq_send_caps_request_for_jid(const char * const to, const char * const id,
const char * const node, const char * const ver)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -211,8 +211,8 @@ _iq_send_caps_request_for_jid(const char * const to, const char * const id,
xmpp_stanza_release(iq);
}
static void
_iq_send_caps_request(const char * const to, const char * const id,
void
iq_send_caps_request(const char * const to, const char * const id,
const char * const node, const char * const ver)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -238,8 +238,8 @@ _iq_send_caps_request(const char * const to, const char * const id,
xmpp_stanza_release(iq);
}
static void
_iq_send_caps_request_legacy(const char * const to, const char * const id,
void
iq_send_caps_request_legacy(const char * const to, const char * const id,
const char * const node, const char * const ver)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -265,8 +265,8 @@ _iq_send_caps_request_legacy(const char * const to, const char * const id,
xmpp_stanza_release(iq);
}
static void
_iq_disco_items_request(gchar *jid)
void
iq_disco_items_request(gchar *jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -275,8 +275,8 @@ _iq_disco_items_request(gchar *jid)
xmpp_stanza_release(iq);
}
static void
_iq_send_software_version(const char * const fulljid)
void
iq_send_software_version(const char * const fulljid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -285,8 +285,8 @@ _iq_send_software_version(const char * const fulljid)
xmpp_stanza_release(iq);
}
static void
_iq_confirm_instant_room(const char * const room_jid)
void
iq_confirm_instant_room(const char * const room_jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -295,8 +295,8 @@ _iq_confirm_instant_room(const char * const room_jid)
xmpp_stanza_release(iq);
}
static void
_iq_destroy_room(const char * const room_jid)
void
iq_destroy_room(const char * const room_jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -309,8 +309,8 @@ _iq_destroy_room(const char * const room_jid)
xmpp_stanza_release(iq);
}
static void
_iq_request_room_config_form(const char * const room_jid)
void
iq_request_room_config_form(const char * const room_jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -323,8 +323,8 @@ _iq_request_room_config_form(const char * const room_jid)
xmpp_stanza_release(iq);
}
static void
_iq_submit_room_config(const char * const room, DataForm *form)
void
iq_submit_room_config(const char * const room, DataForm *form)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -337,8 +337,8 @@ _iq_submit_room_config(const char * const room, DataForm *form)
xmpp_stanza_release(iq);
}
static void
_iq_room_config_cancel(const char * const room_jid)
void
iq_room_config_cancel(const char * const room_jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -347,8 +347,8 @@ _iq_room_config_cancel(const char * const room_jid)
xmpp_stanza_release(iq);
}
static void
_iq_room_affiliation_list(const char * const room, char *affiliation)
void
iq_room_affiliation_list(const char * const room, char *affiliation)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -361,8 +361,8 @@ _iq_room_affiliation_list(const char * const room, char *affiliation)
xmpp_stanza_release(iq);
}
static void
_iq_room_kick_occupant(const char * const room, const char * const nick, const char * const reason)
void
iq_room_kick_occupant(const char * const room, const char * const nick, const char * const reason)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -380,8 +380,8 @@ struct privilege_set_t {
char *privilege;
};
static void
_iq_room_affiliation_set(const char * const room, const char * const jid, char *affiliation,
void
iq_room_affiliation_set(const char * const room, const char * const jid, char *affiliation,
const char * const reason)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -400,8 +400,8 @@ _iq_room_affiliation_set(const char * const room, const char * const jid, char *
xmpp_stanza_release(iq);
}
static void
_iq_room_role_set(const char * const room, const char * const nick, char *role,
void
iq_room_role_set(const char * const room, const char * const nick, char *role,
const char * const reason)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -420,8 +420,8 @@ _iq_room_role_set(const char * const room, const char * const nick, char *role,
xmpp_stanza_release(iq);
}
static void
_iq_room_role_list(const char * const room, char *role)
void
iq_room_role_list(const char * const room, char *role)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -434,8 +434,8 @@ _iq_room_role_list(const char * const room, char *role)
xmpp_stanza_release(iq);
}
static void
_iq_send_ping(const char * const target)
void
iq_send_ping(const char * const target)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -1422,29 +1422,4 @@ _disco_items_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
g_slist_free_full(items, (GDestroyNotify)_item_destroy);
return 1;
}
void
iq_init_module(void)
{
iq_room_list_request = _iq_room_list_request;
iq_disco_info_request = _iq_disco_info_request;
iq_disco_items_request = _iq_disco_items_request;
iq_send_software_version = _iq_send_software_version;
iq_set_autoping = _iq_set_autoping;
iq_confirm_instant_room = _iq_confirm_instant_room;
iq_destroy_room = _iq_destroy_room;
iq_send_ping = _iq_send_ping;
iq_request_room_config_form = _iq_request_room_config_form;
iq_room_config_cancel = _iq_room_config_cancel;
iq_submit_room_config = _iq_submit_room_config;
iq_send_caps_request = _iq_send_caps_request;
iq_send_caps_request_for_jid = _iq_send_caps_request_for_jid;
iq_send_caps_request_legacy = _iq_send_caps_request_legacy;
iq_room_info_request = _iq_room_info_request;
iq_room_affiliation_set = _iq_room_affiliation_set;
iq_room_affiliation_list = _iq_room_affiliation_list;
iq_room_role_set = _iq_room_role_set;
iq_room_kick_occupant = _iq_room_kick_occupant;
iq_room_role_list = _iq_room_role_list;
}

View File

@ -79,8 +79,8 @@ message_add_handlers(void)
HANDLE(STANZA_NS_CAPTCHA, NULL, _captcha_handler);
}
static void
_message_send_chat(const char * const barejid, const char * const msg)
void
message_send_chat(const char * const barejid, const char * const msg)
{
const char * jid = NULL;
@ -112,8 +112,8 @@ _message_send_chat(const char * const barejid, const char * const msg)
xmpp_stanza_release(message);
}
static void
_message_send_private(const char * const fulljid, const char * const msg)
void
message_send_private(const char * const fulljid, const char * const msg)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -123,8 +123,8 @@ _message_send_private(const char * const fulljid, const char * const msg)
xmpp_stanza_release(message);
}
static void
_message_send_groupchat(const char * const roomjid, const char * const msg)
void
message_send_groupchat(const char * const roomjid, const char * const msg)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -134,8 +134,8 @@ _message_send_groupchat(const char * const roomjid, const char * const msg)
xmpp_stanza_release(message);
}
static void
_message_send_groupchat_subject(const char * const roomjid, const char * const subject)
void
message_send_groupchat_subject(const char * const roomjid, const char * const subject)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -145,8 +145,8 @@ _message_send_groupchat_subject(const char * const roomjid, const char * const s
xmpp_stanza_release(message);
}
static void
_message_send_invite(const char * const roomjid, const char * const contact,
void
message_send_invite(const char * const roomjid, const char * const contact,
const char * const reason)
{
xmpp_conn_t * const conn = connection_get_conn();
@ -157,8 +157,8 @@ _message_send_invite(const char * const roomjid, const char * const contact,
xmpp_stanza_release(stanza);
}
static void
_message_send_composing(const char * const barejid)
void
message_send_composing(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -170,8 +170,8 @@ _message_send_composing(const char * const barejid)
chat_session_set_sent(barejid);
}
static void
_message_send_paused(const char * const barejid)
void
message_send_paused(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -183,8 +183,8 @@ _message_send_paused(const char * const barejid)
chat_session_set_sent(barejid);
}
static void
_message_send_inactive(const char * const barejid)
void
message_send_inactive(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -196,8 +196,8 @@ _message_send_inactive(const char * const barejid)
chat_session_set_sent(barejid);
}
static void
_message_send_gone(const char * const barejid)
void
message_send_gone(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -510,18 +510,4 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
jid_destroy(jid);
return 1;
}
}
void
message_init_module(void)
{
message_send_chat = _message_send_chat;
message_send_private = _message_send_private;
message_send_groupchat = _message_send_groupchat;
message_send_invite = _message_send_invite;
message_send_composing = _message_send_composing;
message_send_paused = _message_send_paused;
message_send_inactive = _message_send_inactive;
message_send_gone = _message_send_gone;
message_send_groupchat_subject = _message_send_groupchat_subject;
}
}

View File

@ -94,8 +94,8 @@ presence_add_handlers(void)
HANDLE(NULL, NULL, _available_handler);
}
static void
_presence_subscription(const char * const jid, const jabber_subscr_t action)
void
presence_subscription(const char * const jid, const jabber_subscr_t action)
{
assert(jid != NULL);
@ -139,14 +139,14 @@ _presence_subscription(const char * const jid, const jabber_subscr_t action)
free(id);
}
static GSList *
_presence_get_subscription_requests(void)
GSList *
presence_get_subscription_requests(void)
{
return autocomplete_create_list(sub_requests_ac);
}
static gint
_presence_sub_request_count(void)
gint
presence_sub_request_count(void)
{
return autocomplete_length(sub_requests_ac);
}
@ -157,14 +157,14 @@ presence_clear_sub_requests(void)
autocomplete_clear(sub_requests_ac);
}
static char *
_presence_sub_request_find(char * search_str)
char *
presence_sub_request_find(char * search_str)
{
return autocomplete_complete(sub_requests_ac, search_str, TRUE);
}
static gboolean
_presence_sub_request_exists(const char * const bare_jid)
gboolean
presence_sub_request_exists(const char * const bare_jid)
{
gboolean result = FALSE;
GSList *requests_p = autocomplete_create_list(sub_requests_ac);
@ -185,14 +185,14 @@ _presence_sub_request_exists(const char * const bare_jid)
return result;
}
static void
_presence_reset_sub_request_search(void)
void
presence_reset_sub_request_search(void)
{
autocomplete_reset(sub_requests_ac);
}
static void
_presence_update(const resource_presence_t presence_type, const char * const msg,
void
presence_update(const resource_presence_t presence_type, const char * const msg,
const int idle)
{
if (jabber_get_connection_status() != JABBER_CONNECTED) {
@ -266,8 +266,8 @@ _send_room_presence(xmpp_conn_t *conn, xmpp_stanza_t *presence)
}
}
static void
_presence_join_room(char *room, char *nick, char * passwd)
void
presence_join_room(char *room, char *nick, char * passwd)
{
Jid *jid = jid_create_from_bare_and_resource(room, nick);
@ -293,8 +293,8 @@ _presence_join_room(char *room, char *nick, char * passwd)
jid_destroy(jid);
}
static void
_presence_change_room_nick(const char * const room, const char * const nick)
void
presence_change_room_nick(const char * const room, const char * const nick)
{
assert(room != NULL);
assert(nick != NULL);
@ -323,8 +323,8 @@ _presence_change_room_nick(const char * const room, const char * const nick)
free(full_room_jid);
}
static void
_presence_leave_chat_room(const char * const room_jid)
void
presence_leave_chat_room(const char * const room_jid)
{
assert(room_jid != NULL);
@ -774,19 +774,4 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void *
jid_destroy(from_jid);
return 1;
}
void
presence_init_module(void)
{
presence_subscription = _presence_subscription;
presence_get_subscription_requests = _presence_get_subscription_requests;
presence_sub_request_count = _presence_sub_request_count;
presence_sub_request_find = _presence_sub_request_find;
presence_sub_request_exists = _presence_sub_request_exists;
presence_reset_sub_request_search = _presence_reset_sub_request_search;
presence_update = _presence_update;
presence_join_room = _presence_join_room;
presence_change_room_nick = _presence_change_room_nick;
presence_leave_chat_room = _presence_leave_chat_room;
}
}

View File

@ -95,8 +95,8 @@ roster_request(void)
xmpp_stanza_release(iq);
}
static void
_roster_send_add_new(const char * const barejid, const char * const name)
void
roster_send_add_new(const char * const barejid, const char * const name)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -105,8 +105,8 @@ _roster_send_add_new(const char * const barejid, const char * const name)
xmpp_stanza_release(iq);
}
static void
_roster_send_remove(const char * const barejid)
void
roster_send_remove(const char * const barejid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -115,8 +115,8 @@ _roster_send_remove(const char * const barejid)
xmpp_stanza_release(iq);
}
static void
_roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups)
void
roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -126,8 +126,8 @@ _roster_send_name_change(const char * const barejid, const char * const new_name
xmpp_stanza_release(iq);
}
static void
_roster_send_add_to_group(const char * const group, PContact contact)
void
roster_send_add_to_group(const char * const group, PContact contact)
{
GSList *groups = p_contact_groups(contact);
GSList *new_groups = NULL;
@ -171,8 +171,8 @@ _group_add_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
return 0;
}
static void
_roster_send_remove_from_group(const char * const group, PContact contact)
void
roster_send_remove_from_group(const char * const group, PContact contact)
{
GSList *groups = p_contact_groups(contact);
GSList *new_groups = NULL;
@ -351,15 +351,4 @@ _get_groups_from_item(xmpp_stanza_t *item)
}
return groups;
}
void
roster_init_module(void)
{
roster_send_add_new = _roster_send_add_new;
roster_send_remove = _roster_send_remove;
roster_send_name_change = _roster_send_name_change;
roster_send_add_to_group = _roster_send_add_to_group;
roster_send_remove_from_group = _roster_send_remove_from_group;
}
}

View File

@ -129,119 +129,110 @@ typedef struct data_form_t {
gboolean modified;
} DataForm;
void jabber_init_module(void);
void bookmark_init_module(void);
void capabilities_init_module(void);
void iq_init_module(void);
void message_init_module(void);
void presence_init_module(void);
void roster_init_module(void);
void form_init_module(void);
// connection functions
void (*jabber_init)(const int disable_tls);
jabber_conn_status_t (*jabber_connect_with_details)(const char * const jid,
void jabber_init(const int disable_tls);
jabber_conn_status_t jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain, const int port);
jabber_conn_status_t (*jabber_connect_with_account)(const ProfAccount * const account);
void (*jabber_disconnect)(void);
void (*jabber_shutdown)(void);
void (*jabber_process_events)(void);
const char * (*jabber_get_fulljid)(void);
const char * (*jabber_get_domain)(void);
jabber_conn_status_t (*jabber_get_connection_status)(void);
char * (*jabber_get_presence_message)(void);
char* (*jabber_get_account_name)(void);
GList * (*jabber_get_available_resources)(void);
jabber_conn_status_t jabber_connect_with_account(const ProfAccount * const account);
void jabber_disconnect(void);
void jabber_shutdown(void);
void jabber_process_events(void);
const char * jabber_get_fulljid(void);
const char * jabber_get_domain(void);
jabber_conn_status_t jabber_get_connection_status(void);
char * jabber_get_presence_message(void);
char* jabber_get_account_name(void);
GList * jabber_get_available_resources(void);
// message functions
void (*message_send_chat)(const char * const barejid, const char * const msg);
void (*message_send_private)(const char * const fulljid, const char * const msg);
void (*message_send_groupchat)(const char * const roomjid, const char * const msg);
void (*message_send_groupchat_subject)(const char * const roomjid, const char * const subject);
void message_send_chat(const char * const barejid, const char * const msg);
void message_send_private(const char * const fulljid, const char * const msg);
void message_send_groupchat(const char * const roomjid, const char * const msg);
void message_send_groupchat_subject(const char * const roomjid, const char * const subject);
void (*message_send_inactive)(const char * const barejid);
void (*message_send_composing)(const char * const barejid);
void (*message_send_paused)(const char * const barejid);
void (*message_send_gone)(const char * const barejid);
void message_send_inactive(const char * const barejid);
void message_send_composing(const char * const barejid);
void message_send_paused(const char * const barejid);
void message_send_gone(const char * const barejid);
void (*message_send_invite)(const char * const room, const char * const contact,
void message_send_invite(const char * const room, const char * const contact,
const char * const reason);
// presence functions
void (*presence_subscription)(const char * const jid, const jabber_subscr_t action);
GSList* (*presence_get_subscription_requests)(void);
gint (*presence_sub_request_count)(void);
void (*presence_reset_sub_request_search)(void);
char * (*presence_sub_request_find)(char * search_str);
void (*presence_join_room)(char *room, char *nick, char * passwd);
void (*presence_change_room_nick)(const char * const room, const char * const nick);
void (*presence_leave_chat_room)(const char * const room_jid);
void (*presence_update)(resource_presence_t status, const char * const msg,
void presence_subscription(const char * const jid, const jabber_subscr_t action);
GSList* presence_get_subscription_requests(void);
gint presence_sub_request_count(void);
void presence_reset_sub_request_search(void);
char * presence_sub_request_find(char * search_str);
void presence_join_room(char *room, char *nick, char * passwd);
void presence_change_room_nick(const char * const room, const char * const nick);
void presence_leave_chat_room(const char * const room_jid);
void presence_update(resource_presence_t status, const char * const msg,
int idle);
gboolean (*presence_sub_request_exists)(const char * const bare_jid);
gboolean presence_sub_request_exists(const char * const bare_jid);
// iq functions
void (*iq_send_software_version)(const char * const fulljid);
void (*iq_room_list_request)(gchar *conferencejid);
void (*iq_disco_info_request)(gchar *jid);
void (*iq_disco_items_request)(gchar *jid);
void (*iq_set_autoping)(int seconds);
void (*iq_confirm_instant_room)(const char * const room_jid);
void (*iq_destroy_room)(const char * const room_jid);
void (*iq_request_room_config_form)(const char * const room_jid);
void (*iq_submit_room_config)(const char * const room, DataForm *form);
void (*iq_room_config_cancel)(const char * const room_jid);
void (*iq_send_ping)(const char * const target);
void (*iq_send_caps_request)(const char * const to, const char * const id,
void iq_send_software_version(const char * const fulljid);
void iq_room_list_request(gchar *conferencejid);
void iq_disco_info_request(gchar *jid);
void iq_disco_items_request(gchar *jid);
void iq_set_autoping(int seconds);
void iq_confirm_instant_room(const char * const room_jid);
void iq_destroy_room(const char * const room_jid);
void iq_request_room_config_form(const char * const room_jid);
void iq_submit_room_config(const char * const room, DataForm *form);
void iq_room_config_cancel(const char * const room_jid);
void iq_send_ping(const char * const target);
void iq_send_caps_request(const char * const to, const char * const id,
const char * const node, const char * const ver);
void (*iq_send_caps_request_for_jid)(const char * const to, const char * const id,
void iq_send_caps_request_for_jid(const char * const to, const char * const id,
const char * const node, const char * const ver);
void (*iq_send_caps_request_legacy)(const char * const to, const char * const id,
void iq_send_caps_request_legacy(const char * const to, const char * const id,
const char * const node, const char * const ver);
void (*iq_room_info_request)(gchar *room);
void (*iq_room_affiliation_list)(const char * const room, char *affiliation);
void (*iq_room_affiliation_set)(const char * const room, const char * const jid, char *affiliation,
void iq_room_info_request(gchar *room);
void iq_room_affiliation_list(const char * const room, char *affiliation);
void iq_room_affiliation_set(const char * const room, const char * const jid, char *affiliation,
const char * const reason);
void (*iq_room_kick_occupant)(const char * const room, const char * const nick, const char * const reason);
void (*iq_room_role_set)(const char * const room, const char * const nick, char *role,
void iq_room_kick_occupant(const char * const room, const char * const nick, const char * const reason);
void iq_room_role_set(const char * const room, const char * const nick, char *role,
const char * const reason);
void (*iq_room_role_list)(const char * const room, char *role);
void iq_room_role_list(const char * const room, char *role);
// caps functions
Capabilities* (*caps_lookup)(const char * const jid);
void (*caps_close)(void);
void (*caps_destroy)(Capabilities *caps);
Capabilities* caps_lookup(const char * const jid);
void caps_close(void);
void caps_destroy(Capabilities *caps);
gboolean (*bookmark_add)(const char *jid, const char *nick, const char *password, const char *autojoin_str);
gboolean (*bookmark_update)(const char *jid, const char *nick, const char *password, const char *autojoin_str);
gboolean (*bookmark_remove)(const char *jid);
gboolean (*bookmark_join)(const char *jid);
const GList * (*bookmark_get_list)(void);
char * (*bookmark_find)(char *search_str);
void (*bookmark_autocomplete_reset)(void);
gboolean bookmark_add(const char *jid, const char *nick, const char *password, const char *autojoin_str);
gboolean bookmark_update(const char *jid, const char *nick, const char *password, const char *autojoin_str);
gboolean bookmark_remove(const char *jid);
gboolean bookmark_join(const char *jid);
const GList * bookmark_get_list(void);
char * bookmark_find(char *search_str);
void bookmark_autocomplete_reset(void);
void (*roster_send_name_change)(const char * const barejid, const char * const new_name, GSList *groups);
void (*roster_send_add_to_group)(const char * const group, PContact contact);
void (*roster_send_remove_from_group)(const char * const group, PContact contact);
void (*roster_send_add_new)(const char * const barejid, const char * const name);
void (*roster_send_remove)(const char * const barejid);
void roster_send_name_change(const char * const barejid, const char * const new_name, GSList *groups);
void roster_send_add_to_group(const char * const group, PContact contact);
void roster_send_remove_from_group(const char * const group, PContact contact);
void roster_send_add_new(const char * const barejid, const char * const name);
void roster_send_remove(const char * const barejid);
void (*form_destroy)(DataForm *form);
char * (*form_get_form_type_field)(DataForm *form);
void (*form_set_value)(DataForm *form, const char * const tag, char *value);
gboolean (*form_add_unique_value)(DataForm *form, const char * const tag, char *value);
void (*form_add_value)(DataForm *form, const char * const tag, char *value);
gboolean (*form_remove_value)(DataForm *form, const char * const tag, char *value);
gboolean (*form_remove_text_multi_value)(DataForm *form, const char * const tag, int index);
gboolean (*form_tag_exists)(DataForm *form, const char * const tag);
form_field_type_t (*form_get_field_type)(DataForm *form, const char * const tag);
gboolean (*form_field_contains_option)(DataForm *form, const char * const tag, char *value);
int (*form_get_value_count)(DataForm *form, const char * const tag);
FormField* (*form_get_field_by_tag)(DataForm *form, const char * const tag);
Autocomplete (*form_get_value_ac)(DataForm *form, const char * const tag);
void (*form_reset_autocompleters)(DataForm *form);
void form_destroy(DataForm *form);
char * form_get_form_type_field(DataForm *form);
void form_set_value(DataForm *form, const char * const tag, char *value);
gboolean form_add_unique_value(DataForm *form, const char * const tag, char *value);
void form_add_value(DataForm *form, const char * const tag, char *value);
gboolean form_remove_value(DataForm *form, const char * const tag, char *value);
gboolean form_remove_text_multi_value(DataForm *form, const char * const tag, int index);
gboolean form_tag_exists(DataForm *form, const char * const tag);
form_field_type_t form_get_field_type(DataForm *form, const char * const tag);
gboolean form_field_contains_option(DataForm *form, const char * const tag, char *value);
int form_get_value_count(DataForm *form, const char * const tag);
FormField* form_get_field_by_tag(DataForm *form, const char * const tag);
Autocomplete form_get_value_ac(DataForm *form, const char * const tag);
void form_reset_autocompleters(DataForm *form);
GSList * (*form_get_non_form_type_fields_sorted)(DataForm *form);
GSList * (*form_get_field_values_sorted)(FormField *field);
GSList * form_get_non_form_type_fields_sorted(DataForm *form);
GSList * form_get_field_values_sorted(FormField *field);
#endif