summaryrefslogtreecommitdiff
path: root/core/Messenger.h
diff options
context:
space:
mode:
authorKonstantin Kowalski <kostyakow42@gmail.com>2013-07-26 23:07:25 -0400
committerKonstantin Kowalski <kostyakow42@gmail.com>2013-07-26 23:07:25 -0400
commit241aca98bdc8106221ee7d7dbcea9f2fa17f24bc (patch)
tree15c324c865eb8c61c17dc442009f33b24505714d /core/Messenger.h
parent1b4ea2e1aeb874e872a2c767326633450de12d20 (diff)
A *lot* of style changes.
Diffstat (limited to 'core/Messenger.h')
-rw-r--r--core/Messenger.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/Messenger.h b/core/Messenger.h
index 1067d156..0e2606d9 100644
--- a/core/Messenger.h
+++ b/core/Messenger.h
@@ -51,23 +51,23 @@ extern "C" {
51 data is the data and length is the length 51 data is the data and length is the length
52 returns the friend number if success 52 returns the friend number if success
53 return -1 if failure. */ 53 return -1 if failure. */
54int m_addfriend(uint8_t * client_id, uint8_t * data, uint16_t length); 54int m_addfriend(uint8_t *client_id, uint8_t *data, uint16_t length);
55 55
56 56
57/* add a friend without sending a friendrequest. 57/* add a friend without sending a friendrequest.
58 returns the friend number if success 58 returns the friend number if success
59 return -1 if failure. */ 59 return -1 if failure. */
60int m_addfriend_norequest(uint8_t * client_id); 60int m_addfriend_norequest(uint8_t *client_id);
61 61
62/* return the friend id associated to that client id. 62/* return the friend id associated to that client id.
63 return -1 if no such friend */ 63 return -1 if no such friend */
64int getfriend_id(uint8_t * client_id); 64int getfriend_id(uint8_t *client_id);
65 65
66/* copies the public key associated to that friend id into client_id buffer. 66/* copies the public key associated to that friend id into client_id buffer.
67 make sure that client_id is of size CLIENT_ID_SIZE. 67 make sure that client_id is of size CLIENT_ID_SIZE.
68 return 0 if success 68 return 0 if success
69 return -1 if failure */ 69 return -1 if failure */
70int getclient_id(int friend_id, uint8_t * client_id); 70int getclient_id(int friend_id, uint8_t *client_id);
71 71
72/* remove a friend */ 72/* remove a friend */
73int m_delfriend(int friendnumber); 73int m_delfriend(int friendnumber);
@@ -82,20 +82,20 @@ int m_friendstatus(int friendnumber);
82/* send a text chat message to an online friend 82/* send a text chat message to an online friend
83 returns 1 if packet was successfully put into the send queue 83 returns 1 if packet was successfully put into the send queue
84 return 0 if it was not */ 84 return 0 if it was not */
85int m_sendmessage(int friendnumber, uint8_t * message, uint32_t length); 85int m_sendmessage(int friendnumber, uint8_t *message, uint32_t length);
86 86
87/* Set our nickname 87/* Set our nickname
88 name must be a string of maximum MAX_NAME_LENGTH length. 88 name must be a string of maximum MAX_NAME_LENGTH length.
89 return 0 if success 89 return 0 if success
90 return -1 if failure */ 90 return -1 if failure */
91int setname(uint8_t * name, uint16_t length); 91int setname(uint8_t *name, uint16_t length);
92 92
93/* get name of friendnumber 93/* get name of friendnumber
94 put it in name 94 put it in name
95 name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes. 95 name needs to be a valid memory location with a size of at least MAX_NAME_LENGTH (128) bytes.
96 return 0 if success 96 return 0 if success
97 return -1 if failure */ 97 return -1 if failure */
98int getname(int friendnumber, uint8_t * name); 98int getname(int friendnumber, uint8_t *name);
99 99
100/* set our user status 100/* set our user status
101 you are responsible for freeing status after 101 you are responsible for freeing status after
@@ -109,7 +109,7 @@ int m_get_userstatus_size(int friendnumber);
109 109
110/* copy friendnumber's userstatus into buf, truncating if size is over maxlen 110/* copy friendnumber's userstatus into buf, truncating if size is over maxlen
111 get the size you need to allocate from m_get_userstatus_size */ 111 get the size you need to allocate from m_get_userstatus_size */
112int m_copy_userstatus(int friendnumber, uint8_t * buf, uint32_t maxlen); 112int m_copy_userstatus(int friendnumber, uint8_t *buf, uint32_t maxlen);
113 113
114/* set the function that will be executed when a friend request is received. 114/* set the function that will be executed when a friend request is received.
115 function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */ 115 function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) */
@@ -143,10 +143,10 @@ void doMessenger();
143uint32_t Messenger_size(); 143uint32_t Messenger_size();
144 144
145/* save the messenger in data (must be allocated memory of size Messenger_size()) */ 145/* save the messenger in data (must be allocated memory of size Messenger_size()) */
146void Messenger_save(uint8_t * data); 146void Messenger_save(uint8_t *data);
147 147
148/* load the messenger from data of size length */ 148/* load the messenger from data of size length */
149int Messenger_load(uint8_t * data, uint32_t length); 149int Messenger_load(uint8_t *data, uint32_t length);
150 150
151#ifdef __cplusplus 151#ifdef __cplusplus
152} 152}