1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-01 19:24:15 -04:00

Applied coding style to src/xmpp/

This commit is contained in:
James Booth 2015-10-26 00:14:23 +00:00
parent 2ce43b633f
commit c8a6bdb381
14 changed files with 524 additions and 549 deletions

View File

@ -62,10 +62,10 @@
static Autocomplete bookmark_ac;
static GList *bookmark_list;
static int _bookmark_handle_result(xmpp_conn_t * const conn,
xmpp_stanza_t * const stanza, void * const userdata);
static int _bookmark_handle_delete(xmpp_conn_t * const conn,
void * const userdata);
static int _bookmark_handle_result(xmpp_conn_t *const conn,
xmpp_stanza_t *const stanza, void *const userdata);
static int _bookmark_handle_delete(xmpp_conn_t *const conn,
void *const userdata);
static void _bookmark_item_destroy(gpointer item);
static int _match_bookmark_by_jid(gconstpointer a, gconstpointer b);
static void _send_bookmarks(void);
@ -221,14 +221,14 @@ bookmark_remove(const char *jid)
}
}
const GList *
const GList*
bookmark_get_list(void)
{
return bookmark_list;
}
char *
bookmark_find(const char * const search_str)
char*
bookmark_find(const char *const search_str)
{
return autocomplete_complete(bookmark_ac, search_str, TRUE);
}
@ -242,8 +242,8 @@ bookmark_autocomplete_reset(void)
}
static int
_bookmark_handle_result(xmpp_conn_t * const conn,
xmpp_stanza_t * const stanza, void * const userdata)
_bookmark_handle_result(xmpp_conn_t *const conn,
xmpp_stanza_t *const stanza, void *const userdata)
{
xmpp_ctx_t *ctx = connection_get_ctx();
char *id = (char *)userdata;
@ -360,8 +360,8 @@ _bookmark_handle_result(xmpp_conn_t * const conn,
}
static int
_bookmark_handle_delete(xmpp_conn_t * const conn,
void * const userdata)
_bookmark_handle_delete(xmpp_conn_t *const conn,
void *const userdata)
{
char *id = (char *)userdata;

View File

@ -68,9 +68,9 @@ static char *my_sha1;
static gchar* _get_cache_file(void);
static void _save_cache(void);
static Capabilities * _caps_by_ver(const char * const ver);
static Capabilities * _caps_by_jid(const char * const jid);
Capabilities * _caps_copy(Capabilities *caps);
static Capabilities* _caps_by_ver(const char *const ver);
static Capabilities* _caps_by_jid(const char *const jid);
Capabilities* _caps_copy(Capabilities *caps);
void
caps_init(void)
@ -93,7 +93,7 @@ caps_init(void)
}
void
caps_add_by_ver(const char * const ver, Capabilities *caps)
caps_add_by_ver(const char *const ver, Capabilities *caps)
{
gboolean cached = g_key_file_has_group(cache, ver);
if (!cached) {
@ -135,25 +135,25 @@ caps_add_by_ver(const char * const ver, Capabilities *caps)
}
void
caps_add_by_jid(const char * const jid, Capabilities *caps)
caps_add_by_jid(const char *const jid, Capabilities *caps)
{
g_hash_table_insert(jid_to_caps, strdup(jid), caps);
}
void
caps_map_jid_to_ver(const char * const jid, const char * const ver)
caps_map_jid_to_ver(const char *const jid, const char *const ver)
{
g_hash_table_insert(jid_to_ver, strdup(jid), strdup(ver));
}
gboolean
caps_contains(const char * const ver)
caps_contains(const char *const ver)
{
return (g_key_file_has_group(cache, ver));
}
static Capabilities *
_caps_by_ver(const char * const ver)
static Capabilities*
_caps_by_ver(const char *const ver)
{
if (g_key_file_has_group(cache, ver)) {
Capabilities *new_caps = malloc(sizeof(struct capabilities_t));
@ -226,14 +226,14 @@ _caps_by_ver(const char * const ver)
}
}
static Capabilities *
_caps_by_jid(const char * const jid)
static Capabilities*
_caps_by_jid(const char *const jid)
{
return g_hash_table_lookup(jid_to_caps, jid);
}
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) {
@ -254,7 +254,7 @@ caps_lookup(const char * const jid)
return NULL;
}
Capabilities *
Capabilities*
_caps_copy(Capabilities *caps)
{
if (!caps) {
@ -280,8 +280,8 @@ _caps_copy(Capabilities *caps)
}
}
char *
caps_create_sha1_str(xmpp_stanza_t * const query)
char*
caps_create_sha1_str(xmpp_stanza_t *const query)
{
char *category = NULL;
char *type = NULL;
@ -388,7 +388,7 @@ caps_create_sha1_str(xmpp_stanza_t * const query)
return result;
}
Capabilities *
Capabilities*
caps_create(xmpp_stanza_t *query)
{
char *category = NULL;
@ -541,7 +541,7 @@ caps_create(xmpp_stanza_t *query)
}
char*
caps_get_my_sha1(xmpp_ctx_t * const ctx)
caps_get_my_sha1(xmpp_ctx_t *const ctx)
{
if (my_sha1 == NULL) {
xmpp_stanza_t *query = caps_create_query_response_stanza(ctx);
@ -552,8 +552,8 @@ caps_get_my_sha1(xmpp_ctx_t * const ctx)
return my_sha1;
}
xmpp_stanza_t *
caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
xmpp_stanza_t*
caps_create_query_response_stanza(xmpp_ctx_t *const ctx)
{
xmpp_stanza_t *query = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(query, STANZA_NAME_QUERY);
@ -674,7 +674,7 @@ caps_destroy(Capabilities *caps)
}
}
static gchar *
static gchar*
_get_cache_file(void)
{
gchar *xdg_data = xdg_get_data_home();

View File

@ -48,14 +48,14 @@
void caps_init(void);
void caps_add_by_ver(const char * const ver, Capabilities *caps);
void caps_add_by_jid(const char * const jid, Capabilities *caps);
void caps_map_jid_to_ver(const char * const jid, const char * const ver);
gboolean caps_contains(const char * const ver);
void caps_add_by_ver(const char *const ver, Capabilities *caps);
void caps_add_by_jid(const char *const jid, Capabilities *caps);
void caps_map_jid_to_ver(const char *const jid, const char *const ver);
gboolean caps_contains(const char *const ver);
char* caps_create_sha1_str(xmpp_stanza_t * const query);
xmpp_stanza_t* caps_create_query_response_stanza(xmpp_ctx_t * const ctx);
char* caps_create_sha1_str(xmpp_stanza_t *const query);
xmpp_stanza_t* caps_create_query_response_stanza(xmpp_ctx_t *const ctx);
Capabilities* caps_create(xmpp_stanza_t *query);
char* caps_get_my_sha1(xmpp_ctx_t * const ctx);
char* caps_get_my_sha1(xmpp_ctx_t *const ctx);
#endif

View File

@ -95,20 +95,20 @@ static GTimer *reconnect_timer;
static log_level_t _get_log_level(xmpp_log_level_t xmpp_level);
static xmpp_log_level_t _get_xmpp_log_level();
static void _xmpp_file_logger(void * const userdata,
const xmpp_log_level_t level, const char * const area,
const char * const msg);
static void _xmpp_file_logger(void *const userdata,
const xmpp_log_level_t level, const char *const area,
const char *const msg);
static xmpp_log_t * _xmpp_get_file_logger();
static xmpp_log_t* _xmpp_get_file_logger();
static jabber_conn_status_t _jabber_connect(const char * const fulljid,
const char * const passwd, const char * const altdomain, int port, const char *const tls_policy);
static jabber_conn_status_t _jabber_connect(const char *const fulljid,
const char *const passwd, const char *const altdomain, int port, const char *const tls_policy);
static void _jabber_reconnect(void);
static void _connection_handler(xmpp_conn_t * const conn,
static void _connection_handler(xmpp_conn_t *const conn,
const xmpp_conn_event_t status, const int error,
xmpp_stream_error_t * const stream_error, void * const userdata);
xmpp_stream_error_t *const stream_error, void *const userdata);
void _connection_free_saved_account(void);
void _connection_free_saved_details(void);
@ -131,7 +131,7 @@ jabber_init(void)
}
jabber_conn_status_t
jabber_connect_with_account(const ProfAccount * const account)
jabber_connect_with_account(const ProfAccount *const account)
{
assert(account != NULL);
@ -157,8 +157,8 @@ jabber_connect_with_account(const ProfAccount * const account)
}
jabber_conn_status_t
jabber_connect_with_details(const char * const jid,
const char * const passwd, const char * const altdomain, const int port, const char *const tls_policy)
jabber_connect_with_details(const char *const jid,
const char *const passwd, const char *const altdomain, const int port, const char *const tls_policy)
{
assert(jid != NULL);
assert(passwd != NULL);
@ -271,7 +271,7 @@ jabber_process_events(int millis)
}
}
GList *
GList*
jabber_get_available_resources(void)
{
return g_hash_table_get_values(available_resources);
@ -283,37 +283,37 @@ jabber_get_connection_status(void)
return (jabber_conn.conn_status);
}
xmpp_conn_t *
xmpp_conn_t*
connection_get_conn(void)
{
return jabber_conn.conn;
}
xmpp_ctx_t *
xmpp_ctx_t*
connection_get_ctx(void)
{
return jabber_conn.ctx;
}
const char *
const char*
jabber_get_fulljid(void)
{
return xmpp_conn_get_jid(jabber_conn.conn);
}
const char *
const char*
jabber_get_domain(void)
{
return jabber_conn.domain;
}
char *
char*
jabber_get_presence_message(void)
{
return jabber_conn.presence_message;
}
char *
char*
jabber_get_account_name(void)
{
return saved_account.name;
@ -334,7 +334,7 @@ jabber_free_uuid(char *uuid)
}
void
connection_set_presence_message(const char * const message)
connection_set_presence_message(const char *const message)
{
FREE_SET_NULL(jabber_conn.presence_message);
if (message) {
@ -355,7 +355,7 @@ connection_add_available_resource(Resource *resource)
}
void
connection_remove_available_resource(const char * const resource)
connection_remove_available_resource(const char *const resource)
{
g_hash_table_remove(available_resources, resource);
}
@ -387,16 +387,16 @@ _connection_free_session_data(void)
#ifdef HAVE_LIBMESODE
static int
_connection_certfail_cb(const char * const certname, const char * const certfp,
char * const notbefore, const char * const notafter, const char * const errormsg)
_connection_certfail_cb(const char *const certname, const char *const certfp,
char *const notbefore, const char *const notafter, const char *const errormsg)
{
return sv_ev_certfail(errormsg, certname, certfp, notbefore, notafter);
}
#endif
static jabber_conn_status_t
_jabber_connect(const char * const fulljid, const char * const passwd,
const char * const altdomain, int port, const char *const tls_policy)
_jabber_connect(const char *const fulljid, const char *const passwd,
const char *const altdomain, int port, const char *const tls_policy)
{
assert(fulljid != NULL);
assert(passwd != NULL);
@ -488,9 +488,9 @@ _jabber_reconnect(void)
}
static void
_connection_handler(xmpp_conn_t * const conn,
_connection_handler(xmpp_conn_t *const conn,
const xmpp_conn_event_t status, const int error,
xmpp_stream_error_t * const stream_error, void * const userdata)
xmpp_stream_error_t *const stream_error, void *const userdata)
{
// login success
if (status == XMPP_CONN_CONNECT) {
@ -619,8 +619,8 @@ _get_xmpp_log_level()
}
static void
_xmpp_file_logger(void * const userdata, const xmpp_log_level_t level,
const char * const area, const char * const msg)
_xmpp_file_logger(void *const userdata, const xmpp_log_level_t level,
const char *const area, const char *const msg)
{
log_level_t prof_level = _get_log_level(level);
log_msg(prof_level, area, msg);
@ -629,7 +629,7 @@ _xmpp_file_logger(void * const userdata, const xmpp_log_level_t level,
}
}
static xmpp_log_t *
static xmpp_log_t*
_xmpp_get_file_logger()
{
xmpp_log_level_t level = _get_xmpp_log_level();

View File

@ -46,11 +46,11 @@
#include "resource.h"
xmpp_conn_t *connection_get_conn(void);
xmpp_ctx_t *connection_get_ctx(void);
xmpp_conn_t* connection_get_conn(void);
xmpp_ctx_t* connection_get_ctx(void);
void connection_set_priority(int priority);
void connection_set_presence_message(const char * const message);
void connection_set_presence_message(const char *const message);
void connection_add_available_resource(Resource *resource);
void connection_remove_available_resource(const char * const resource);
void connection_remove_available_resource(const char *const resource);
#endif

View File

@ -78,7 +78,7 @@ _is_valid_form_element(xmpp_stanza_t *stanza)
return TRUE;
}
static DataForm *
static DataForm*
_form_new(void)
{
DataForm *form = malloc(sizeof(DataForm));
@ -93,7 +93,7 @@ _form_new(void)
return form;
}
static FormField *
static FormField*
_field_new(void)
{
FormField *field = malloc(sizeof(FormField));
@ -108,8 +108,8 @@ _field_new(void)
return field;
}
static char *
_get_property(xmpp_stanza_t * const stanza, const char * const property)
static char*
_get_property(xmpp_stanza_t *const stanza, const char *const property)
{
char *result = NULL;
xmpp_ctx_t *ctx = connection_get_ctx();
@ -126,8 +126,8 @@ _get_property(xmpp_stanza_t * const stanza, const char * const property)
return result;
}
static char *
_get_attr(xmpp_stanza_t * const stanza, const char * const attr)
static char*
_get_attr(xmpp_stanza_t *const stanza, const char *const attr)
{
char *result = xmpp_stanza_get_attribute(stanza, attr);
if (result) {
@ -138,7 +138,7 @@ _get_attr(xmpp_stanza_t * const stanza, const char * const attr)
}
static gboolean
_is_required(xmpp_stanza_t * const stanza)
_is_required(xmpp_stanza_t *const stanza)
{
xmpp_stanza_t *child = xmpp_stanza_get_child_by_name(stanza, "required");
if (child) {
@ -149,7 +149,7 @@ _is_required(xmpp_stanza_t * const stanza)
}
static form_field_type_t
_get_field_type(const char * const type)
_get_field_type(const char *const type)
{
if (g_strcmp0(type, "hidden") == 0) {
return FIELD_HIDDEN;
@ -184,8 +184,8 @@ _get_field_type(const char * const type)
return FIELD_UNKNOWN;
}
DataForm *
form_create(xmpp_stanza_t * const form_stanza)
DataForm*
form_create(xmpp_stanza_t *const form_stanza)
{
xmpp_ctx_t *ctx = connection_get_ctx();
@ -281,7 +281,7 @@ form_create(xmpp_stanza_t * const form_stanza)
return form;
}
xmpp_stanza_t *
xmpp_stanza_t*
form_create_submission(DataForm *form)
{
xmpp_ctx_t *ctx = connection_get_ctx();
@ -408,7 +408,7 @@ _field_compare_by_var(FormField *a, FormField *b)
return g_strcmp0(a->var, b->var);
}
GSList *
GSList*
form_get_non_form_type_fields_sorted(DataForm *form)
{
GSList *sorted = NULL;
@ -424,7 +424,7 @@ form_get_non_form_type_fields_sorted(DataForm *form)
return sorted;
}
GSList *
GSList*
form_get_field_values_sorted(FormField *field)
{
GSList *sorted = NULL;
@ -440,7 +440,7 @@ form_get_field_values_sorted(FormField *field)
return sorted;
}
char *
char*
form_get_form_type_field(DataForm *form)
{
GSList *curr = form->fields;
@ -456,7 +456,7 @@ form_get_form_type_field(DataForm *form)
}
gboolean
form_tag_exists(DataForm *form, const char * const tag)
form_tag_exists(DataForm *form, const char *const tag)
{
GList *tags = g_hash_table_get_keys(form->tag_to_var);
GList *curr = tags;
@ -472,7 +472,7 @@ form_tag_exists(DataForm *form, const char * const tag)
}
form_field_type_t
form_get_field_type(DataForm *form, const char * const tag)
form_get_field_type(DataForm *form, const char *const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -489,7 +489,7 @@ form_get_field_type(DataForm *form, const char * const tag)
}
void
form_set_value(DataForm *form, const char * const tag, char *value)
form_set_value(DataForm *form, const char *const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -514,7 +514,7 @@ form_set_value(DataForm *form, const char * const tag, char *value)
}
void
form_add_value(DataForm *form, const char * const tag, char *value)
form_add_value(DataForm *form, const char *const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -539,7 +539,7 @@ form_add_value(DataForm *form, const char * const tag, char *value)
}
gboolean
form_add_unique_value(DataForm *form, const char * const tag, char *value)
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) {
@ -570,7 +570,7 @@ form_add_unique_value(DataForm *form, const char * const tag, char *value)
}
gboolean
form_remove_value(DataForm *form, const char * const tag, char *value)
form_remove_value(DataForm *form, const char *const tag, char *value)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -600,7 +600,7 @@ 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)
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);
@ -632,7 +632,7 @@ form_remove_text_multi_value(DataForm *form, const char * const tag, int index)
}
int
form_get_value_count(DataForm *form, const char * const tag)
form_get_value_count(DataForm *form, const char *const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {
@ -654,7 +654,7 @@ form_get_value_count(DataForm *form, const char * const tag)
}
gboolean
form_field_contains_option(DataForm *form, const char * const tag, char *value)
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) {
@ -678,8 +678,8 @@ form_field_contains_option(DataForm *form, const char * const tag, char *value)
return FALSE;
}
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) {
@ -696,7 +696,7 @@ form_get_field_by_tag(DataForm *form, const char * const tag)
}
Autocomplete
form_get_value_ac(DataForm *form, const char * const tag)
form_get_value_ac(DataForm *form, const char *const tag)
{
char *var = g_hash_table_lookup(form->tag_to_var, tag);
if (var) {

View File

@ -37,7 +37,7 @@
#include "xmpp/xmpp.h"
DataForm* form_create(xmpp_stanza_t * const stanza);
DataForm* form_create(xmpp_stanza_t *const stanza);
xmpp_stanza_t* form_create_submission(DataForm *form);
#endif

View File

@ -70,32 +70,32 @@ typedef struct p_room_info_data_t {
gboolean display;
} ProfRoomInfoData;
static int _error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _ping_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _version_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _disco_info_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _disco_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _last_activity_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _last_activity_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _disco_items_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _disco_items_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _destroy_room_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_config_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_config_submit_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_affiliation_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_affiliation_set_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_role_set_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_role_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _room_kick_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _enable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _disable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _manual_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _ping_timed_handler(xmpp_conn_t * const conn, void * const userdata);
static int _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _error_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _ping_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _version_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _version_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _disco_info_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _disco_info_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _last_activity_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _last_activity_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_info_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _disco_items_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _disco_items_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _destroy_room_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_config_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_config_submit_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_affiliation_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_affiliation_set_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_role_set_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_role_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _room_kick_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _enable_carbons_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _disable_carbons_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _manual_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _ping_timed_handler(xmpp_conn_t *const conn, void *const userdata);
static int _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
void
iq_add_handlers(void)
@ -150,7 +150,7 @@ iq_room_list_request(gchar *conferencejid)
}
void
iq_enable_carbons()
iq_enable_carbons(void)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -164,7 +164,7 @@ iq_enable_carbons()
}
void
iq_disable_carbons()
iq_disable_carbons(void)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -210,7 +210,7 @@ iq_last_activity_request(gchar *jid)
}
void
iq_room_info_request(const char * const room, gboolean display_result)
iq_room_info_request(const char *const room, gboolean display_result)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -232,8 +232,8 @@ iq_room_info_request(const char * const room, gboolean display_result)
void
iq_send_caps_request_for_jid(const char * const to, const char * const id,
const char * const node, const char * const ver)
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();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -259,8 +259,8 @@ iq_send_caps_request_for_jid(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)
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();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -286,8 +286,8 @@ iq_send_caps_request(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)
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();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -323,7 +323,7 @@ iq_disco_items_request(gchar *jid)
}
void
iq_send_software_version(const char * const fulljid)
iq_send_software_version(const char *const fulljid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -337,7 +337,7 @@ iq_send_software_version(const char * const fulljid)
}
void
iq_confirm_instant_room(const char * const room_jid)
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();
@ -347,7 +347,7 @@ iq_confirm_instant_room(const char * const room_jid)
}
void
iq_destroy_room(const char * const room_jid)
iq_destroy_room(const char *const room_jid)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -361,7 +361,7 @@ iq_destroy_room(const char * const room_jid)
}
void
iq_request_room_config_form(const char * const room_jid)
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();
@ -375,7 +375,7 @@ iq_request_room_config_form(const char * const room_jid)
}
void
iq_submit_room_config(const char * const room, DataForm *form)
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();
@ -389,7 +389,7 @@ iq_submit_room_config(const char * const room, DataForm *form)
}
void
iq_room_config_cancel(const char * const room_jid)
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();
@ -399,7 +399,7 @@ iq_room_config_cancel(const char * const room_jid)
}
void
iq_room_affiliation_list(const char * const room, char *affiliation)
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();
@ -413,7 +413,7 @@ iq_room_affiliation_list(const char * const room, char *affiliation)
}
void
iq_room_kick_occupant(const char * const room, const char * const nick, const char * const reason)
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();
@ -432,8 +432,8 @@ struct privilege_set_t {
};
void
iq_room_affiliation_set(const char * const room, const char * const jid, char *affiliation,
const char * const reason)
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();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -452,8 +452,8 @@ iq_room_affiliation_set(const char * const room, const char * const jid, char *a
}
void
iq_room_role_set(const char * const room, const char * const nick, char *role,
const char * const reason)
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();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -472,7 +472,7 @@ iq_room_role_set(const char * const room, const char * const nick, char *role,
}
void
iq_room_role_list(const char * const room, char *role)
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();
@ -486,7 +486,7 @@ iq_room_role_list(const char * const room, char *role)
}
void
iq_send_ping(const char * const target)
iq_send_ping(const char *const target)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -501,8 +501,8 @@ iq_send_ping(const char * const target)
}
static int
_error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_error_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
char *error_msg = stanza_get_error_message(stanza);
@ -521,8 +521,8 @@ _error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
char *id = xmpp_stanza_get_id(stanza);
char *type = xmpp_stanza_get_type(stanza);
@ -561,8 +561,8 @@ _pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
}
static int
_caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
@ -635,8 +635,8 @@ _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
}
static int
_caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
char *jid = (char *)userdata;
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
@ -694,8 +694,8 @@ _caps_response_handler_for_jid(xmpp_conn_t *const conn, xmpp_stanza_t * const st
}
static int
_caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
@ -767,7 +767,7 @@ _caps_response_handler_legacy(xmpp_conn_t *const conn, xmpp_stanza_t * const sta
}
static int
_enable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
_enable_carbons_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
{
char *type = xmpp_stanza_get_type(stanza);
if (g_strcmp0(type, "error") == 0) {
@ -783,7 +783,7 @@ _enable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_disable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
_disable_carbons_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
{
char *type = xmpp_stanza_get_type(stanza);
if (g_strcmp0(type, "error") == 0) {
@ -799,8 +799,8 @@ _disable_carbons_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_manual_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_manual_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
char *type = xmpp_stanza_get_type(stanza);
@ -838,7 +838,7 @@ _manual_pong_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
}
static int
_ping_timed_handler(xmpp_conn_t * const conn, void * const userdata)
_ping_timed_handler(xmpp_conn_t *const conn, void *const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
@ -858,8 +858,8 @@ _ping_timed_handler(xmpp_conn_t * const conn, void * const userdata)
}
static int
_version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_version_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
char *id = xmpp_stanza_get_id(stanza);
@ -953,8 +953,8 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_ping_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_ping_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
@ -988,8 +988,8 @@ _ping_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_version_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_version_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
@ -1056,8 +1056,8 @@ _version_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_disco_items_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_disco_items_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
@ -1088,8 +1088,8 @@ _disco_items_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_last_activity_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_last_activity_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
xmpp_ctx_t *ctx = connection_get_ctx();
const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
@ -1150,8 +1150,8 @@ _last_activity_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz
}
static int
_disco_info_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_disco_info_get_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
@ -1188,8 +1188,8 @@ _disco_info_get_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
}
static int
_destroy_room_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_destroy_room_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
@ -1210,8 +1210,8 @@ _destroy_room_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const sta
}
static int
_room_config_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_room_config_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1264,8 +1264,9 @@ _room_config_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
return 0;
}
static int _room_affiliation_set_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
static int
_room_affiliation_set_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1293,8 +1294,9 @@ static int _room_affiliation_set_result_handler(xmpp_conn_t * const conn, xmpp_s
return 0;
}
static int _room_role_set_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
static int
_room_role_set_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1323,7 +1325,7 @@ static int _room_role_set_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t
}
static int
_room_affiliation_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
_room_affiliation_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1371,7 +1373,7 @@ _room_affiliation_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t *
}
static int
_room_role_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
_room_role_list_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1418,8 +1420,8 @@ _room_role_list_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const s
}
static int
_room_config_submit_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_room_config_submit_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1445,7 +1447,7 @@ _room_config_submit_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
}
static int
_room_kick_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
_room_kick_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata)
{
const char *id = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_ID);
const char *type = xmpp_stanza_get_type(stanza);
@ -1494,8 +1496,8 @@ _item_destroy(DiscoItem *item)
}
static int
_room_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_room_info_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *type = xmpp_stanza_get_type(stanza);
ProfRoomInfoData *cb_data = (ProfRoomInfoData *)userdata;
@ -1573,8 +1575,8 @@ _room_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
}
static int
_last_activity_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_last_activity_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
if (!from) {
@ -1628,8 +1630,8 @@ _last_activity_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const
}
static int
_disco_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_disco_info_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
const char *from = xmpp_stanza_get_attribute(stanza, STANZA_ATTR_FROM);
const char *type = xmpp_stanza_get_type(stanza);
@ -1706,8 +1708,8 @@ _disco_info_response_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const sta
}
static int
_disco_items_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
void * const userdata)
_disco_items_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
void *const userdata)
{
log_debug("Received diso#items response");

View File

@ -61,13 +61,13 @@
#define HANDLE(ns, type, func) xmpp_handler_add(conn, func, ns, STANZA_NAME_MESSAGE, type, ctx)
static int _groupchat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _conference_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _captcha_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _message_error_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _receipt_received_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata);
static int _groupchat_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _chat_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _muc_user_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _conference_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _captcha_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _message_error_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
static int _receipt_received_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza, void *const userdata);
void
message_add_handlers(void)
@ -85,7 +85,7 @@ message_add_handlers(void)
}
static char*
_session_jid(const char * const barejid)
_session_jid(const char *const barejid)
{
ChatSession *session = chat_session_get(barejid);
char *jid = NULL;
@ -101,7 +101,7 @@ _session_jid(const char * const barejid)
}
static char*
_session_state(const char * const barejid)
_session_state(const char *const barejid)
{
ChatSession *session = chat_session_get(barejid);
char *state = NULL;
@ -118,8 +118,8 @@ _session_state(const char * const barejid)
return state;
}
char *
message_send_chat(const char * const barejid, const char * const msg)
char*
message_send_chat(const char *const barejid, const char *const msg)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_ctx_t * const ctx = connection_get_ctx();
@ -145,8 +145,8 @@ message_send_chat(const char * const barejid, const char * const msg)
return id;
}
char *
message_send_chat_pgp(const char * const barejid, const char * const msg)
char*
message_send_chat_pgp(const char *const barejid, const char *const msg)
{
xmpp_conn_t * const conn = connection_get_conn();
xmpp_