about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-10-25 22:40:09 +0000
committerJames Booth <boothj5@gmail.com>2015-10-25 22:40:09 +0000
commit894fa355e8a2ae8dbf76f258928b20aa49b204f9 (patch)
tree493ae48da900fd19c1903c43f9b83850814aae22 /src
parentafbd2693cd966525b1a0625540b208a33d44b40e (diff)
downloadprofani-tty-894fa355e8a2ae8dbf76f258928b20aa49b204f9.tar.gz
Applied coding style to src/otr/
Diffstat (limited to 'src')
-rw-r--r--src/otr/otr.c48
-rw-r--r--src/otr/otr.h32
-rw-r--r--src/otr/otrlib.h12
-rw-r--r--src/otr/otrlibv3.c16
-rw-r--r--src/otr/otrlibv4.c19
5 files changed, 63 insertions, 64 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c
index 511d6843..9ff4a503 100644
--- a/src/otr/otr.c
+++ b/src/otr/otr.c
@@ -63,13 +63,13 @@ otr_userstate(void)
     return user_state;
 }
 
-OtrlMessageAppOps *
+OtrlMessageAppOps*
 otr_messageops(void)
 {
     return &ops;
 }
 
-GHashTable *
+GHashTable*
 otr_smpinitators(void)
 {
     return smp_initiators;
@@ -146,13 +146,13 @@ cb_gone_secure(void *opdata, ConnContext *context)
     ui_gone_secure(context->username, otr_is_trusted(context->username));
 }
 
-char *
+char*
 otr_libotr_version(void)
 {
     return OTRL_VERSION;
 }
 
-char *
+char*
 otr_start_query(void)
 {
     return otrlib_start_query();
@@ -274,7 +274,7 @@ otr_on_connect(ProfAccount *account)
 }
 
 char*
-otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message, gboolean *decrypted)
+otr_on_message_recv(const char *const barejid, const char *const resource, const char *const message, gboolean *decrypted)
 {
     prof_otrpolicy_t policy = otr_get_policy(barejid);
     char *whitespace_base = strstr(message, OTRL_MESSAGE_TAG_BASE);
@@ -314,7 +314,7 @@ otr_on_message_recv(const char * const barejid, const char * const resource, con
 }
 
 gboolean
-otr_on_message_send(ProfChatWin *chatwin, const char * const message)
+otr_on_message_send(ProfChatWin *chatwin, const char *const message)
 {
     char *id = NULL;
     prof_otrpolicy_t policy = otr_get_policy(chatwin->barejid);
@@ -451,8 +451,8 @@ otr_key_loaded(void)
     return data_loaded;
 }
 
-char *
-otr_tag_message(const char * const msg)
+char*
+otr_tag_message(const char *const msg)
 {
     GString *otr_message = g_string_new(msg);
     g_string_append(otr_message, OTRL_MESSAGE_TAG_BASE);
@@ -464,7 +464,7 @@ otr_tag_message(const char * const msg)
 }
 
 gboolean
-otr_is_secure(const char * const recipient)
+otr_is_secure(const char *const recipient)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -480,7 +480,7 @@ otr_is_secure(const char * const recipient)
 }
 
 gboolean
-otr_is_trusted(const char * const recipient)
+otr_is_trusted(const char *const recipient)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -506,7 +506,7 @@ otr_is_trusted(const char * const recipient)
 }
 
 void
-otr_trust(const char * const recipient)
+otr_trust(const char *const recipient)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -530,7 +530,7 @@ otr_trust(const char * const recipient)
 }
 
 void
-otr_untrust(const char * const recipient)
+otr_untrust(const char *const recipient)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -554,7 +554,7 @@ otr_untrust(const char * const recipient)
 }
 
 void
-otr_smp_secret(const char * const recipient, const char *secret)
+otr_smp_secret(const char *const recipient, const char *secret)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -578,7 +578,7 @@ otr_smp_secret(const char * const recipient, const char *secret)
 }
 
 void
-otr_smp_question(const char * const recipient, const char *question, const char *answer)
+otr_smp_question(const char *const recipient, const char *question, const char *answer)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -595,7 +595,7 @@ otr_smp_question(const char * const recipient, const char *question, const char
 }
 
 void
-otr_smp_answer(const char * const recipient, const char *answer)
+otr_smp_answer(const char *const recipient, const char *answer)
 {
     ConnContext *context = otrlib_context_find(user_state, recipient, jid);
 
@@ -612,12 +612,12 @@ otr_smp_answer(const char * const recipient, const char *answer)
 }
 
 void
-otr_end_session(const char * const recipient)
+otr_end_session(const char *const recipient)
 {
     otrlib_end_session(user_state, recipient, jid, &ops);
 }
 
-char *
+char*
 otr_get_my_fingerprint(void)
 {
     char fingerprint[45];
@@ -627,8 +627,8 @@ otr_get_my_fingerprint(void)
     return result;
 }
 
-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);
 
@@ -643,7 +643,7 @@ otr_get_their_fingerprint(const char * const recipient)
 }
 
 prof_otrpolicy_t
-otr_get_policy(const char * const recipient)
+otr_get_policy(const char *const recipient)
 {
     char *account_name = jabber_get_account_name();
     ProfAccount *account = accounts_get_account(account_name);
@@ -695,8 +695,8 @@ otr_get_policy(const char * const recipient)
     return result;
 }
 
-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);
@@ -716,8 +716,8 @@ _otr_tlv_free(OtrlTLV *tlvs)
     }
 }
 
-char *
-otr_decrypt_message(const char * const from, const char * const message, gboolean *decrypted)
+char*
+otr_decrypt_message(const char *const from, const char *const message, gboolean *decrypted)
 {
     char *newmessage = NULL;
     OtrlTLV *tlvs = NULL;
diff --git a/src/otr/otr.h b/src/otr/otr.h
index cd11709f..f966239e 100644
--- a/src/otr/otr.h
+++ b/src/otr/otr.h
@@ -58,35 +58,35 @@ char* otr_start_query(void);
 void otr_poll(void);
 void otr_on_connect(ProfAccount *account);
 
-char* otr_on_message_recv(const char * const barejid, const char * const resource, const char * const message, gboolean *decrypted);
-gboolean otr_on_message_send(ProfChatWin *chatwin, const char * const message);
+char* otr_on_message_recv(const char *const barejid, const char *const resource, const char *const message, gboolean *decrypted);
+gboolean otr_on_message_send(ProfChatWin *chatwin, const char *const message);
 
 void otr_keygen(ProfAccount *account);
 
-char* otr_tag_message(const char * const msg);
+char* otr_tag_message(const char *const msg);
 
 gboolean otr_key_loaded(void);
-gboolean otr_is_secure(const char * const recipient);
+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 *decrypted);
 
 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
diff --git a/src/otr/otrlib.h b/src/otr/otrlib.h
index 0310c9e6..f4b9b804 100644
--- a/src/otr/otrlib.h
+++ b/src/otr/otrlib.h
@@ -44,15 +44,15 @@ void otrlib_init_ops(OtrlMessageAppOps *ops);
 void otrlib_init_timer(void);
 void otrlib_poll(void);
 
-ConnContext * otrlib_context_find(OtrlUserState user_state, const char * const recipient, char *jid);
+ConnContext* otrlib_context_find(OtrlUserState user_state, const char *const recipient, char *jid);
 
-void otrlib_end_session(OtrlUserState user_state, const char * const recipient, char *jid, OtrlMessageAppOps *ops);
+void otrlib_end_session(OtrlUserState user_state, const char *const recipient, char *jid, OtrlMessageAppOps *ops);
 
-gcry_error_t otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const to,
-    const char * const message, char **newmessage);
+gcry_error_t otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const to,
+    const char *const message, char **newmessage);
 
-int otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const from,
-    const char * const message, char **decrypted, OtrlTLV **tlvs);
+int otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const from,
+    const char *const message, char **decrypted, OtrlTLV **tlvs);
 
 void otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext *context, OtrlTLV *tlvs, GHashTable *smp_initiators);
 
diff --git a/src/otr/otrlibv3.c b/src/otr/otrlibv3.c
index 0b81796c..9bab4eed 100644
--- a/src/otr/otrlibv3.c
+++ b/src/otr/otrlibv3.c
@@ -55,7 +55,7 @@ otrlib_poll(void)
 {
 }
 
-char *
+char*
 otrlib_start_query(void)
 {
     return "?OTR?v2? This user has requested an Off-the-Record private conversation. However, you do not have a plugin to support that. See http://otr.cypherpunks.ca/ for more information.";
@@ -75,14 +75,14 @@ otrlib_init_ops(OtrlMessageAppOps *ops)
     ops->display_otr_message = cb_display_otr_message;
 }
 
-ConnContext *
-otrlib_context_find(OtrlUserState user_state, const char * const recipient, char *jid)
+ConnContext*
+otrlib_context_find(OtrlUserState user_state, const char *const recipient, char *jid)
 {
     return otrl_context_find(user_state, recipient, jid, "xmpp", 0, NULL, NULL, NULL);
 }
 
 void
-otrlib_end_session(OtrlUserState user_state, const char * const recipient, char *jid, OtrlMessageAppOps *ops)
+otrlib_end_session(OtrlUserState user_state, const char *const recipient, char *jid, OtrlMessageAppOps *ops)
 {
     ConnContext *context = otrl_context_find(user_state, recipient, jid, "xmpp",
         0, NULL, NULL, NULL);
@@ -93,8 +93,8 @@ otrlib_end_session(OtrlUserState user_state, const char * const recipient, char
 }
 
 gcry_error_t
-otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const to,
-    const char * const message, char **newmessage)
+otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const to,
+    const char *const message, char **newmessage)
 {
     gcry_error_t err;
     err = otrl_message_sending(
@@ -114,8 +114,8 @@ otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *j
 }
 
 int
-otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const from,
-    const char * const message, char **decrypted, OtrlTLV **tlvs)
+otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const from,
+    const char *const message, char **decrypted, OtrlTLV **tlvs)
 {
     return otrl_message_receiving(
         user_state,
diff --git a/src/otr/otrlibv4.c b/src/otr/otrlibv4.c
index fc1f5285..8ed17fcf 100644
--- a/src/otr/otrlibv4.c
+++ b/src/otr/otrlibv4.c
@@ -71,15 +71,14 @@ otrlib_poll(void)
     }
 }
 
-char *
+char*
 otrlib_start_query(void)
 {
     return "?OTR?v2? This user has requested an Off-the-Record private conversation. However, you do not have a plugin to support that. See http://otr.cypherpunks.ca/ for more information.";
 }
 
 static const char*
-cb_otr_error_message(void *opdata, ConnContext *context,
-    OtrlErrorCode err_code)
+cb_otr_error_message(void *opdata, ConnContext *context, OtrlErrorCode err_code)
 {
     switch(err_code)
     {
@@ -241,14 +240,14 @@ otrlib_init_ops(OtrlMessageAppOps *ops)
     ops->timer_control = cb_timer_control;
 }
 
-ConnContext *
-otrlib_context_find(OtrlUserState user_state, const char * const recipient, char *jid)
+ConnContext*
+otrlib_context_find(OtrlUserState user_state, const char *const recipient, char *jid)
 {
     return otrl_context_find(user_state, recipient, jid, "xmpp", OTRL_INSTAG_MASTER, 0, NULL, NULL, NULL);
 }
 
 void
-otrlib_end_session(OtrlUserState user_state, const char * const recipient, char *jid, OtrlMessageAppOps *ops)
+otrlib_end_session(OtrlUserState user_state, const char *const recipient, char *jid, OtrlMessageAppOps *ops)
 {
     ConnContext *context = otrl_context_find(user_state, recipient, jid, "xmpp",
         OTRL_INSTAG_MASTER, 0, NULL, NULL, NULL);
@@ -259,8 +258,8 @@ otrlib_end_session(OtrlUserState user_state, const char * const recipient, char
 }
 
 gcry_error_t
-otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const to,
-    const char * const message, char **newmessage)
+otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const to,
+    const char *const message, char **newmessage)
 {
     gcry_error_t err;
 
@@ -284,8 +283,8 @@ otrlib_encrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *j
 }
 
 int
-otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char * const from,
-    const char * const message, char **decrypted, OtrlTLV **tlvs)
+otrlib_decrypt_message(OtrlUserState user_state, OtrlMessageAppOps *ops, char *jid, const char *const from,
+    const char *const message, char **decrypted, OtrlTLV **tlvs)
 {
     return otrl_message_receiving(
         user_state,