diff options
author | irungentoo <irungentoo@gmail.com> | 2013-11-29 07:47:09 -0800 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-11-29 07:47:09 -0800 |
commit | c8985d9d47bd5c382cda9ecf860cb76b281bbd8e (patch) | |
tree | 9abd27379ece55e90c6646273edb6dddf961ca9e /toxcore/tox.c | |
parent | 6e691a3c34ba41f38cf69fb9c9e1daea2762ebd1 (diff) | |
parent | 2cb7f241325684a98acf33ffba539f859ea2247c (diff) |
Merge pull request #668 from aitjcize/api-name
Fix API name consistency.
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index f4e65ec8..bdc110e6 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -37,7 +37,7 @@ typedef struct Messenger Tox; | |||
37 | * Format: [client_id (32 bytes)][nospam number (4 bytes)][checksum (2 bytes)] | 37 | * Format: [client_id (32 bytes)][nospam number (4 bytes)][checksum (2 bytes)] |
38 | * | 38 | * |
39 | */ | 39 | */ |
40 | void tox_getaddress(Tox *tox, uint8_t *address) | 40 | void tox_get_address(Tox *tox, uint8_t *address) |
41 | { | 41 | { |
42 | Messenger *m = tox; | 42 | Messenger *m = tox; |
43 | getaddress(m, address); | 43 | getaddress(m, address); |
@@ -60,7 +60,7 @@ void tox_getaddress(Tox *tox, uint8_t *address) | |||
60 | * (the nospam for that friend was set to the new one). | 60 | * (the nospam for that friend was set to the new one). |
61 | * return FAERR_NOMEM if increasing the friend list size fails. | 61 | * return FAERR_NOMEM if increasing the friend list size fails. |
62 | */ | 62 | */ |
63 | int tox_addfriend(Tox *tox, uint8_t *address, uint8_t *data, uint16_t length) | 63 | int tox_add_friend(Tox *tox, uint8_t *address, uint8_t *data, uint16_t length) |
64 | { | 64 | { |
65 | Messenger *m = tox; | 65 | Messenger *m = tox; |
66 | return m_addfriend(m, address, data, length); | 66 | return m_addfriend(m, address, data, length); |
@@ -71,7 +71,7 @@ int tox_addfriend(Tox *tox, uint8_t *address, uint8_t *data, uint16_t length) | |||
71 | * return the friend number if success. | 71 | * return the friend number if success. |
72 | * return -1 if failure. | 72 | * return -1 if failure. |
73 | */ | 73 | */ |
74 | int tox_addfriend_norequest(Tox *tox, uint8_t *client_id) | 74 | int tox_add_friend_norequest(Tox *tox, uint8_t *client_id) |
75 | { | 75 | { |
76 | Messenger *m = tox; | 76 | Messenger *m = tox; |
77 | return m_addfriend_norequest(m, client_id); | 77 | return m_addfriend_norequest(m, client_id); |
@@ -80,7 +80,7 @@ int tox_addfriend_norequest(Tox *tox, uint8_t *client_id) | |||
80 | /* return the friend id associated to that client id. | 80 | /* return the friend id associated to that client id. |
81 | * return -1 if no such friend. | 81 | * return -1 if no such friend. |
82 | */ | 82 | */ |
83 | int tox_getfriend_id(Tox *tox, uint8_t *client_id) | 83 | int tox_get_friend_id(Tox *tox, uint8_t *client_id) |
84 | { | 84 | { |
85 | Messenger *m = tox; | 85 | Messenger *m = tox; |
86 | return getfriend_id(m, client_id); | 86 | return getfriend_id(m, client_id); |
@@ -92,14 +92,14 @@ int tox_getfriend_id(Tox *tox, uint8_t *client_id) | |||
92 | * return 0 if success. | 92 | * return 0 if success. |
93 | * return -1 if failure. | 93 | * return -1 if failure. |
94 | */ | 94 | */ |
95 | int tox_getclient_id(Tox *tox, int friend_id, uint8_t *client_id) | 95 | int tox_get_client_id(Tox *tox, int friend_id, uint8_t *client_id) |
96 | { | 96 | { |
97 | Messenger *m = tox; | 97 | Messenger *m = tox; |
98 | return getclient_id(m, friend_id, client_id); | 98 | return getclient_id(m, friend_id, client_id); |
99 | } | 99 | } |
100 | 100 | ||
101 | /* Remove a friend. */ | 101 | /* Remove a friend. */ |
102 | int tox_delfriend(Tox *tox, int friendnumber) | 102 | int tox_del_friend(Tox *tox, int friendnumber) |
103 | { | 103 | { |
104 | Messenger *m = tox; | 104 | Messenger *m = tox; |
105 | return m_delfriend(m, friendnumber); | 105 | return m_delfriend(m, friendnumber); |
@@ -111,7 +111,7 @@ int tox_delfriend(Tox *tox, int friendnumber) | |||
111 | * return 0 if friend is not connected to us (Offline). | 111 | * return 0 if friend is not connected to us (Offline). |
112 | * return -1 on failure. | 112 | * return -1 on failure. |
113 | */ | 113 | */ |
114 | int tox_get_friend_connectionstatus(Tox *tox, int friendnumber) | 114 | int tox_get_friend_connection_status(Tox *tox, int friendnumber) |
115 | { | 115 | { |
116 | Messenger *m = tox; | 116 | Messenger *m = tox; |
117 | return m_get_friend_connectionstatus(m, friendnumber); | 117 | return m_get_friend_connectionstatus(m, friendnumber); |
@@ -137,13 +137,13 @@ int tox_friend_exists(Tox *tox, int friendnumber) | |||
137 | * m_sendmessage_withid will send a message with the id of your choosing, | 137 | * m_sendmessage_withid will send a message with the id of your choosing, |
138 | * however we can generate an id for you by calling plain m_sendmessage. | 138 | * however we can generate an id for you by calling plain m_sendmessage. |
139 | */ | 139 | */ |
140 | uint32_t tox_sendmessage(Tox *tox, int friendnumber, uint8_t *message, uint32_t length) | 140 | uint32_t tox_send_message(Tox *tox, int friendnumber, uint8_t *message, uint32_t length) |
141 | { | 141 | { |
142 | Messenger *m = tox; | 142 | Messenger *m = tox; |
143 | return m_sendmessage(m, friendnumber, message, length); | 143 | return m_sendmessage(m, friendnumber, message, length); |
144 | } | 144 | } |
145 | 145 | ||
146 | uint32_t tox_sendmessage_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *message, uint32_t length) | 146 | uint32_t tox_send_message_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *message, uint32_t length) |
147 | { | 147 | { |
148 | Messenger *m = tox; | 148 | Messenger *m = tox; |
149 | return m_sendmessage_withid(m, friendnumber, theid, message, length); | 149 | return m_sendmessage_withid(m, friendnumber, theid, message, length); |
@@ -159,13 +159,13 @@ uint32_t tox_sendmessage_withid(Tox *tox, int friendnumber, uint32_t theid, uint | |||
159 | * m_sendaction_withid will send an action message with the id of your choosing, | 159 | * m_sendaction_withid will send an action message with the id of your choosing, |
160 | * however we can generate an id for you by calling plain m_sendaction. | 160 | * however we can generate an id for you by calling plain m_sendaction. |
161 | */ | 161 | */ |
162 | uint32_t tox_sendaction(Tox *tox, int friendnumber, uint8_t *action, uint32_t length) | 162 | uint32_t tox_send_action(Tox *tox, int friendnumber, uint8_t *action, uint32_t length) |
163 | { | 163 | { |
164 | Messenger *m = tox; | 164 | Messenger *m = tox; |
165 | return m_sendaction(m, friendnumber, action, length); | 165 | return m_sendaction(m, friendnumber, action, length); |
166 | } | 166 | } |
167 | 167 | ||
168 | uint32_t tox_sendaction_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *action, uint32_t length) | 168 | uint32_t tox_send_action_withid(Tox *tox, int friendnumber, uint32_t theid, uint8_t *action, uint32_t length) |
169 | { | 169 | { |
170 | Messenger *m = tox; | 170 | Messenger *m = tox; |
171 | return m_sendaction_withid(m, friendnumber, theid, action, length); | 171 | return m_sendaction_withid(m, friendnumber, theid, action, length); |
@@ -179,7 +179,7 @@ uint32_t tox_sendaction_withid(Tox *tox, int friendnumber, uint32_t theid, uint8 | |||
179 | * return 0 if success. | 179 | * return 0 if success. |
180 | * return -1 if failure. | 180 | * return -1 if failure. |
181 | */ | 181 | */ |
182 | int tox_setname(Tox *tox, uint8_t *name, uint16_t length) | 182 | int tox_set_name(Tox *tox, uint8_t *name, uint16_t length) |
183 | { | 183 | { |
184 | Messenger *m = tox; | 184 | Messenger *m = tox; |
185 | return setname(m, name, length); | 185 | return setname(m, name, length); |
@@ -193,7 +193,7 @@ int tox_setname(Tox *tox, uint8_t *name, uint16_t length) | |||
193 | * return length of the name. | 193 | * return length of the name. |
194 | * return 0 on error. | 194 | * return 0 on error. |
195 | */ | 195 | */ |
196 | uint16_t tox_getselfname(Tox *tox, uint8_t *name, uint16_t nlen) | 196 | uint16_t tox_get_self_name(Tox *tox, uint8_t *name, uint16_t nlen) |
197 | { | 197 | { |
198 | Messenger *m = tox; | 198 | Messenger *m = tox; |
199 | return getself_name(m, name, nlen); | 199 | return getself_name(m, name, nlen); |
@@ -205,7 +205,7 @@ uint16_t tox_getselfname(Tox *tox, uint8_t *name, uint16_t nlen) | |||
205 | * return length of name (with the NULL terminator) if success. | 205 | * return length of name (with the NULL terminator) if success. |
206 | * return -1 if failure. | 206 | * return -1 if failure. |
207 | */ | 207 | */ |
208 | int tox_getname(Tox *tox, int friendnumber, uint8_t *name) | 208 | int tox_get_name(Tox *tox, int friendnumber, uint8_t *name) |
209 | { | 209 | { |
210 | Messenger *m = tox; | 210 | Messenger *m = tox; |
211 | return getname(m, friendnumber, name); | 211 | return getname(m, friendnumber, name); |
@@ -216,7 +216,7 @@ int tox_getname(Tox *tox, int friendnumber, uint8_t *name) | |||
216 | * | 216 | * |
217 | * return 0 on success, -1 on failure. | 217 | * return 0 on success, -1 on failure. |
218 | */ | 218 | */ |
219 | int tox_set_statusmessage(Tox *tox, uint8_t *status, uint16_t length) | 219 | int tox_set_status_message(Tox *tox, uint8_t *status, uint16_t length) |
220 | { | 220 | { |
221 | Messenger *m = tox; | 221 | Messenger *m = tox; |
222 | return m_set_statusmessage(m, status, length); | 222 | return m_set_statusmessage(m, status, length); |
@@ -231,7 +231,7 @@ int tox_set_userstatus(Tox *tox, TOX_USERSTATUS status) | |||
231 | /* return the length of friendnumber's status message, including null. | 231 | /* return the length of friendnumber's status message, including null. |
232 | * Pass it into malloc. | 232 | * Pass it into malloc. |
233 | */ | 233 | */ |
234 | int tox_get_statusmessage_size(Tox *tox, int friendnumber) | 234 | int tox_get_status_message_size(Tox *tox, int friendnumber) |
235 | { | 235 | { |
236 | Messenger *m = tox; | 236 | Messenger *m = tox; |
237 | return m_get_statusmessage_size(m, friendnumber); | 237 | return m_get_statusmessage_size(m, friendnumber); |
@@ -241,13 +241,13 @@ int tox_get_statusmessage_size(Tox *tox, int friendnumber) | |||
241 | * Get the size you need to allocate from m_get_statusmessage_size. | 241 | * Get the size you need to allocate from m_get_statusmessage_size. |
242 | * The self variant will copy our own status message. | 242 | * The self variant will copy our own status message. |
243 | */ | 243 | */ |
244 | int tox_copy_statusmessage(Tox *tox, int friendnumber, uint8_t *buf, uint32_t maxlen) | 244 | int tox_get_status_message(Tox *tox, int friendnumber, uint8_t *buf, uint32_t maxlen) |
245 | { | 245 | { |
246 | Messenger *m = tox; | 246 | Messenger *m = tox; |
247 | return m_copy_statusmessage(m, friendnumber, buf, maxlen); | 247 | return m_copy_statusmessage(m, friendnumber, buf, maxlen); |
248 | } | 248 | } |
249 | 249 | ||
250 | int tox_copy_self_statusmessage(Tox *tox, uint8_t *buf, uint32_t maxlen) | 250 | int tox_get_self_status_message(Tox *tox, uint8_t *buf, uint32_t maxlen) |
251 | { | 251 | { |
252 | Messenger *m = tox; | 252 | Messenger *m = tox; |
253 | return m_copy_self_statusmessage(m, buf, maxlen); | 253 | return m_copy_self_statusmessage(m, buf, maxlen); |
@@ -258,13 +258,13 @@ int tox_copy_self_statusmessage(Tox *tox, uint8_t *buf, uint32_t maxlen) | |||
258 | * As above, the self variant will return our own USERSTATUS. | 258 | * As above, the self variant will return our own USERSTATUS. |
259 | * If friendnumber is invalid, this shall return USERSTATUS_INVALID. | 259 | * If friendnumber is invalid, this shall return USERSTATUS_INVALID. |
260 | */ | 260 | */ |
261 | TOX_USERSTATUS tox_get_userstatus(Tox *tox, int friendnumber) | 261 | TOX_USERSTATUS tox_get_user_status(Tox *tox, int friendnumber) |
262 | { | 262 | { |
263 | Messenger *m = tox; | 263 | Messenger *m = tox; |
264 | return (TOX_USERSTATUS)m_get_userstatus(m, friendnumber); | 264 | return (TOX_USERSTATUS)m_get_userstatus(m, friendnumber); |
265 | } | 265 | } |
266 | 266 | ||
267 | TOX_USERSTATUS tox_get_selfuserstatus(Tox *tox) | 267 | TOX_USERSTATUS tox_get_self_user_status(Tox *tox) |
268 | { | 268 | { |
269 | Messenger *m = tox; | 269 | Messenger *m = tox; |
270 | return (TOX_USERSTATUS)m_get_self_userstatus(m); | 270 | return (TOX_USERSTATUS)m_get_self_userstatus(m); |
@@ -294,7 +294,7 @@ uint32_t tox_count_friendlist(Tox *tox) | |||
294 | * Otherwise, returns the number of elements copied. | 294 | * Otherwise, returns the number of elements copied. |
295 | * If the array was too small, the contents | 295 | * If the array was too small, the contents |
296 | * of out_list will be truncated to list_size. */ | 296 | * of out_list will be truncated to list_size. */ |
297 | uint32_t tox_copy_friendlist(Tox *tox, int *out_list, uint32_t list_size) | 297 | uint32_t tox_get_friendlist(Tox *tox, int *out_list, uint32_t list_size) |
298 | { | 298 | { |
299 | Messenger *m = tox; | 299 | Messenger *m = tox; |
300 | return copy_friendlist(m, out_list, list_size); | 300 | return copy_friendlist(m, out_list, list_size); |
@@ -303,7 +303,7 @@ uint32_t tox_copy_friendlist(Tox *tox, int *out_list, uint32_t list_size) | |||
303 | /* Set the function that will be executed when a friend request is received. | 303 | /* Set the function that will be executed when a friend request is received. |
304 | * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) | 304 | * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) |
305 | */ | 305 | */ |
306 | void tox_callback_friendrequest(Tox *tox, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), void *userdata) | 306 | void tox_callback_friend_request(Tox *tox, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), void *userdata) |
307 | { | 307 | { |
308 | Messenger *m = tox; | 308 | Messenger *m = tox; |
309 | m_callback_friendrequest(m, function, userdata); | 309 | m_callback_friendrequest(m, function, userdata); |
@@ -313,7 +313,7 @@ void tox_callback_friendrequest(Tox *tox, void (*function)(uint8_t *, uint8_t *, | |||
313 | /* Set the function that will be executed when a message from a friend is received. | 313 | /* Set the function that will be executed when a message from a friend is received. |
314 | * Function format is: function(int friendnumber, uint8_t * message, uint32_t length) | 314 | * Function format is: function(int friendnumber, uint8_t * message, uint32_t length) |
315 | */ | 315 | */ |
316 | void tox_callback_friendmessage(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), | 316 | void tox_callback_friend_message(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), |
317 | void *userdata) | 317 | void *userdata) |
318 | { | 318 | { |
319 | Messenger *m = tox; | 319 | Messenger *m = tox; |
@@ -333,7 +333,7 @@ void tox_callback_action(Tox *tox, void (*function)(Messenger *tox, int, uint8_t | |||
333 | * function(int friendnumber, uint8_t *newname, uint16_t length) | 333 | * function(int friendnumber, uint8_t *newname, uint16_t length) |
334 | * You are not responsible for freeing newname. | 334 | * You are not responsible for freeing newname. |
335 | */ | 335 | */ |
336 | void tox_callback_namechange(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), | 336 | void tox_callback_name_change(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), |
337 | void *userdata) | 337 | void *userdata) |
338 | { | 338 | { |
339 | Messenger *m = tox; | 339 | Messenger *m = tox; |
@@ -344,7 +344,7 @@ void tox_callback_namechange(Tox *tox, void (*function)(Messenger *tox, int, uin | |||
344 | * function(int friendnumber, uint8_t *newstatus, uint16_t length) | 344 | * function(int friendnumber, uint8_t *newstatus, uint16_t length) |
345 | * You are not responsible for freeing newstatus. | 345 | * You are not responsible for freeing newstatus. |
346 | */ | 346 | */ |
347 | void tox_callback_statusmessage(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), | 347 | void tox_callback_status_message(Tox *tox, void (*function)(Messenger *tox, int, uint8_t *, uint16_t, void *), |
348 | void *userdata) | 348 | void *userdata) |
349 | { | 349 | { |
350 | Messenger *m = tox; | 350 | Messenger *m = tox; |
@@ -354,7 +354,7 @@ void tox_callback_statusmessage(Tox *tox, void (*function)(Messenger *tox, int, | |||
354 | /* Set the callback for status type changes. | 354 | /* Set the callback for status type changes. |
355 | * function(int friendnumber, USERSTATUS kind) | 355 | * function(int friendnumber, USERSTATUS kind) |
356 | */ | 356 | */ |
357 | void tox_callback_userstatus(Tox *tox, void (*_function)(Tox *tox, int, TOX_USERSTATUS, void *), void *userdata) | 357 | void tox_callback_user_status(Tox *tox, void (*_function)(Tox *tox, int, TOX_USERSTATUS, void *), void *userdata) |
358 | { | 358 | { |
359 | Messenger *m = tox; | 359 | Messenger *m = tox; |
360 | typedef void (*function_type)(Messenger *, int, USERSTATUS, void *); | 360 | typedef void (*function_type)(Messenger *, int, USERSTATUS, void *); |
@@ -388,7 +388,7 @@ void tox_callback_read_receipt(Tox *tox, void (*function)(Messenger *tox, int, u | |||
388 | * being previously online" part. It's assumed that when adding friends, | 388 | * being previously online" part. It's assumed that when adding friends, |
389 | * their connection status is offline. | 389 | * their connection status is offline. |
390 | */ | 390 | */ |
391 | void tox_callback_connectionstatus(Tox *tox, void (*function)(Messenger *tox, int, uint8_t, void *), void *userdata) | 391 | void tox_callback_connection_status(Tox *tox, void (*function)(Messenger *tox, int, uint8_t, void *), void *userdata) |
392 | { | 392 | { |
393 | Messenger *m = tox; | 393 | Messenger *m = tox; |
394 | m_callback_connectionstatus(m, function, userdata); | 394 | m_callback_connectionstatus(m, function, userdata); |
@@ -422,7 +422,7 @@ void tox_callback_group_message(Tox *tox, void (*function)(Messenger *tox, int, | |||
422 | * Function(Tox *tox, int groupnumber, void *userdata) | 422 | * Function(Tox *tox, int groupnumber, void *userdata) |
423 | */ | 423 | */ |
424 | 424 | ||
425 | void tox_callback_group_namelistchange(Tox *tox, void (*function)(Tox *tox, int, int, uint8_t, void *), void *userdata) | 425 | void tox_callback_group_namelist_change(Tox *tox, void (*function)(Tox *tox, int, int, uint8_t, void *), void *userdata) |
426 | { | 426 | { |
427 | Messenger *m = tox; | 427 | Messenger *m = tox; |
428 | m_callback_group_namelistchange(m, function, userdata); | 428 | m_callback_group_namelistchange(m, function, userdata); |
@@ -507,7 +507,7 @@ int tox_group_number_peers(Tox *tox, int groupnumber) | |||
507 | * | 507 | * |
508 | * return -1 on failure. | 508 | * return -1 on failure. |
509 | */ | 509 | */ |
510 | int tox_group_copy_names(Tox *tox, int groupnumber, uint8_t names[][TOX_MAX_NAME_LENGTH], uint16_t length) | 510 | int tox_group_get_names(Tox *tox, int groupnumber, uint8_t names[][TOX_MAX_NAME_LENGTH], uint16_t length) |
511 | { | 511 | { |
512 | Messenger *m = tox; | 512 | Messenger *m = tox; |
513 | return group_names(m, groupnumber, names, length); | 513 | return group_names(m, groupnumber, names, length); |
@@ -527,7 +527,7 @@ uint32_t tox_count_chatlist(Tox *tox) | |||
527 | * Otherwise, returns the number of elements copied. | 527 | * Otherwise, returns the number of elements copied. |
528 | * If the array was too small, the contents | 528 | * If the array was too small, the contents |
529 | * of out_list will be truncated to list_size. */ | 529 | * of out_list will be truncated to list_size. */ |
530 | uint32_t tox_copy_chatlist(Tox *tox, int *out_list, uint32_t list_size) | 530 | uint32_t tox_get_chatlist(Tox *tox, int *out_list, uint32_t list_size) |
531 | { | 531 | { |
532 | Messenger *m = tox; | 532 | Messenger *m = tox; |
533 | return copy_chatlist(m, out_list, list_size); | 533 | return copy_chatlist(m, out_list, list_size); |
@@ -541,7 +541,7 @@ uint32_t tox_copy_chatlist(Tox *tox, int *out_list, uint32_t list_size) | |||
541 | * | 541 | * |
542 | * Function(Tox *tox, int friendnumber, uint8_t filenumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length, void *userdata) | 542 | * Function(Tox *tox, int friendnumber, uint8_t filenumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length, void *userdata) |
543 | */ | 543 | */ |
544 | void tox_callback_file_sendrequest(Tox *tox, void (*function)(Messenger *tox, int, uint8_t, uint64_t, uint8_t *, | 544 | void tox_callback_file_send_request(Tox *tox, void (*function)(Messenger *tox, int, uint8_t, uint64_t, uint8_t *, |
545 | uint16_t, | 545 | uint16_t, |
546 | void *), void *userdata) | 546 | void *), void *userdata) |
547 | { | 547 | { |
@@ -577,7 +577,7 @@ void tox_callback_file_data(Tox *tox, void (*function)(Messenger *tox, int, uint | |||
577 | * return file number on success | 577 | * return file number on success |
578 | * return -1 on failure | 578 | * return -1 on failure |
579 | */ | 579 | */ |
580 | int tox_new_filesender(Tox *tox, int friendnumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length) | 580 | int tox_new_file_sender(Tox *tox, int friendnumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length) |
581 | { | 581 | { |
582 | Messenger *m = tox; | 582 | Messenger *m = tox; |
583 | return new_filesender(m, friendnumber, filesize, filename, filename_length); | 583 | return new_filesender(m, friendnumber, filesize, filename, filename_length); |
@@ -588,7 +588,7 @@ int tox_new_filesender(Tox *tox, int friendnumber, uint64_t filesize, uint8_t *f | |||
588 | * return 0 on success | 588 | * return 0 on success |
589 | * return -1 on failure | 589 | * return -1 on failure |
590 | */ | 590 | */ |
591 | int tox_file_sendcontrol(Tox *tox, int friendnumber, uint8_t send_receive, uint8_t filenumber, uint8_t message_id, | 591 | int tox_file_send_control(Tox *tox, int friendnumber, uint8_t send_receive, uint8_t filenumber, uint8_t message_id, |
592 | uint8_t *data, uint16_t length) | 592 | uint8_t *data, uint16_t length) |
593 | { | 593 | { |
594 | Messenger *m = tox; | 594 | Messenger *m = tox; |
@@ -599,18 +599,18 @@ int tox_file_sendcontrol(Tox *tox, int friendnumber, uint8_t send_receive, uint8 | |||
599 | * return 0 on success | 599 | * return 0 on success |
600 | * return -1 on failure | 600 | * return -1 on failure |
601 | */ | 601 | */ |
602 | int tox_file_senddata(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length) | 602 | int tox_file_send_data(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length) |
603 | { | 603 | { |
604 | Messenger *m = tox; | 604 | Messenger *m = tox; |
605 | return file_data(m, friendnumber, filenumber, data, length); | 605 | return file_data(m, friendnumber, filenumber, data, length); |
606 | } | 606 | } |
607 | 607 | ||
608 | /* Returns the recommended/maximum size of the filedata you send with tox_file_senddata() | 608 | /* Returns the recommended/maximum size of the filedata you send with tox_file_send_data() |
609 | * | 609 | * |
610 | * return size on success | 610 | * return size on success |
611 | * return -1 on failure (currently will never return -1) | 611 | * return -1 on failure (currently will never return -1) |
612 | */ | 612 | */ |
613 | int tox_filedata_size(Tox *tox, int friendnumber) | 613 | int tox_file_data_size(Tox *tox, int friendnumber) |
614 | { | 614 | { |
615 | return MAX_DATA_SIZE - crypto_box_MACBYTES - 3; | 615 | return MAX_DATA_SIZE - crypto_box_MACBYTES - 3; |
616 | } | 616 | } |
@@ -622,7 +622,7 @@ int tox_filedata_size(Tox *tox, int friendnumber) | |||
622 | * return number of bytes remaining to be sent/received on success | 622 | * return number of bytes remaining to be sent/received on success |
623 | * return 0 on failure | 623 | * return 0 on failure |
624 | */ | 624 | */ |
625 | uint64_t tox_file_dataremaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive) | 625 | uint64_t tox_file_data_remaining(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t send_receive) |
626 | { | 626 | { |
627 | Messenger *m = tox; | 627 | Messenger *m = tox; |
628 | return file_dataremaining(m, friendnumber, filenumber, send_receive); | 628 | return file_dataremaining(m, friendnumber, filenumber, send_receive); |