diff options
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 8fb03af3..5b619cd0 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -236,7 +236,7 @@ int tox_get_self_name_size(Tox *tox); | |||
236 | * returns -1 on failure. | 236 | * returns -1 on failure. |
237 | */ | 237 | */ |
238 | int tox_set_status_message(Tox *tox, uint8_t *status, uint16_t length); | 238 | int tox_set_status_message(Tox *tox, uint8_t *status, uint16_t length); |
239 | int tox_set_user_status(Tox *tox, TOX_USERSTATUS userstatus); | 239 | int tox_set_user_status(Tox *tox, uint8_t userstatus); |
240 | 240 | ||
241 | /* returns the length of status message on success. | 241 | /* returns the length of status message on success. |
242 | * returns -1 on failure. | 242 | * returns -1 on failure. |
@@ -259,8 +259,8 @@ int tox_get_self_status_message(Tox *tox, uint8_t *buf, uint32_t maxlen); | |||
259 | * As above, the self variant will return our own TOX_USERSTATUS. | 259 | * As above, the self variant will return our own TOX_USERSTATUS. |
260 | * If friendnumber is invalid, this shall return TOX_USERSTATUS_INVALID. | 260 | * If friendnumber is invalid, this shall return TOX_USERSTATUS_INVALID. |
261 | */ | 261 | */ |
262 | TOX_USERSTATUS tox_get_user_status(Tox *tox, int32_t friendnumber); | 262 | uint8_t tox_get_user_status(Tox *tox, int32_t friendnumber); |
263 | TOX_USERSTATUS tox_get_self_user_status(Tox *tox); | 263 | uint8_t tox_get_self_user_status(Tox *tox); |
264 | 264 | ||
265 | /* Set our typing status for a friend. | 265 | /* Set our typing status for a friend. |
266 | * You are responsible for turning it on or off. | 266 | * You are responsible for turning it on or off. |
@@ -298,48 +298,48 @@ uint32_t tox_get_num_online_friends(Tox *tox); | |||
298 | uint32_t tox_get_friendlist(Tox *tox, int32_t *out_list, uint32_t list_size); | 298 | uint32_t tox_get_friendlist(Tox *tox, int32_t *out_list, uint32_t list_size); |
299 | 299 | ||
300 | /* Set the function that will be executed when a friend request is received. | 300 | /* Set the function that will be executed when a friend request is received. |
301 | * Function format is function(uint8_t * public_key, uint8_t * data, uint16_t length) | 301 | * Function format is function(Tox *tox, uint8_t * public_key, uint8_t * data, uint16_t length, void *userdata) |
302 | */ | 302 | */ |
303 | void tox_callback_friend_request(Tox *tox, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), void *userdata); | 303 | void tox_callback_friend_request(Tox *tox, void (*function)(uint8_t *, uint8_t *, uint16_t, void *), void *userdata); |
304 | 304 | ||
305 | /* Set the function that will be executed when a message from a friend is received. | 305 | /* Set the function that will be executed when a message from a friend is received. |
306 | * Function format is: function(int friendnumber, uint8_t * message, uint32_t length) | 306 | * Function format is: function(Tox *tox, int friendnumber, uint8_t * message, uint32_t length, void *userdata) |
307 | */ | 307 | */ |
308 | void tox_callback_friend_message(Tox *tox, void (*function)(Tox *tox, int, uint8_t *, uint16_t, void *), | 308 | void tox_callback_friend_message(Tox *tox, void (*function)(Tox *tox, int, uint8_t *, uint16_t, void *), |
309 | void *userdata); | 309 | void *userdata); |
310 | 310 | ||
311 | /* Set the function that will be executed when an action from a friend is received. | 311 | /* Set the function that will be executed when an action from a friend is received. |
312 | * Function format is: function(int32_t friendnumber, uint8_t * action, uint32_t length) | 312 | * Function format is: function(Tox *tox, int32_t friendnumber, uint8_t * action, uint32_t length, void *userdata) |
313 | */ | 313 | */ |
314 | void tox_callback_friend_action(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), | 314 | void tox_callback_friend_action(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), |
315 | void *userdata); | 315 | void *userdata); |
316 | 316 | ||
317 | /* Set the callback for name changes. | 317 | /* Set the callback for name changes. |
318 | * function(int32_t friendnumber, uint8_t *newname, uint16_t length) | 318 | * function(Tox *tox, int32_t friendnumber, uint8_t *newname, uint16_t length, void *userdata) |
319 | * You are not responsible for freeing newname | 319 | * You are not responsible for freeing newname |
320 | */ | 320 | */ |
321 | void tox_callback_name_change(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), | 321 | void tox_callback_name_change(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), |
322 | void *userdata); | 322 | void *userdata); |
323 | 323 | ||
324 | /* Set the callback for status message changes. | 324 | /* Set the callback for status message changes. |
325 | * function(int32_t friendnumber, uint8_t *newstatus, uint16_t length) | 325 | * function(Tox *tox, int32_t friendnumber, uint8_t *newstatus, uint16_t length, void *userdata) |
326 | * You are not responsible for freeing newstatus. | 326 | * You are not responsible for freeing newstatus. |
327 | */ | 327 | */ |
328 | void tox_callback_status_message(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), | 328 | void tox_callback_status_message(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t *, uint16_t, void *), |
329 | void *userdata); | 329 | void *userdata); |
330 | 330 | ||
331 | /* Set the callback for status type changes. | 331 | /* Set the callback for status type changes. |
332 | * function(int32_t friendnumber, USERSTATUS kind) | 332 | * function(Tox *tox, int32_t friendnumber, uint8_t TOX_USERSTATUS, void *userdata) |
333 | */ | 333 | */ |
334 | void tox_callback_user_status(Tox *tox, void (*function)(Tox *tox, int32_t, TOX_USERSTATUS, void *), void *userdata); | 334 | void tox_callback_user_status(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, void *), void *userdata); |
335 | 335 | ||
336 | /* Set the callback for typing changes. | 336 | /* Set the callback for typing changes. |
337 | * function (int32_t friendnumber, int is_typing) | 337 | * function (Tox *tox, int32_t friendnumber, int is_typing, void *userdata) |
338 | */ | 338 | */ |
339 | void tox_callback_typing_change(Tox *tox, void (*function)(Tox *tox, int32_t, int, void *), void *userdata); | 339 | void tox_callback_typing_change(Tox *tox, void (*function)(Tox *tox, int32_t, int, void *), void *userdata); |
340 | 340 | ||
341 | /* Set the callback for read receipts. | 341 | /* Set the callback for read receipts. |
342 | * function(int32_t friendnumber, uint32_t receipt) | 342 | * function(Tox *tox, int32_t friendnumber, uint32_t receipt, void *userdata) |
343 | * | 343 | * |
344 | * If you are keeping a record of returns from m_sendmessage; | 344 | * If you are keeping a record of returns from m_sendmessage; |
345 | * receipt might be one of those values, meaning the message | 345 | * receipt might be one of those values, meaning the message |
@@ -350,7 +350,7 @@ void tox_callback_typing_change(Tox *tox, void (*function)(Tox *tox, int32_t, in | |||
350 | void tox_callback_read_receipt(Tox *tox, void (*function)(Tox *tox, int32_t, uint32_t, void *), void *userdata); | 350 | void tox_callback_read_receipt(Tox *tox, void (*function)(Tox *tox, int32_t, uint32_t, void *), void *userdata); |
351 | 351 | ||
352 | /* Set the callback for connection status changes. | 352 | /* Set the callback for connection status changes. |
353 | * function(int32_t friendnumber, uint8_t status) | 353 | * function(Tox *tox, int32_t friendnumber, uint8_t status, void *userdata) |
354 | * | 354 | * |
355 | * Status: | 355 | * Status: |
356 | * 0 -- friend went offline after being previously online | 356 | * 0 -- friend went offline after being previously online |