diff options
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index 6a0c6a62..5e110cbe 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -477,6 +477,25 @@ int tox_group_message_send(Tox *tox, int groupnumber, uint8_t *message, uint32_t | |||
477 | return group_message_send(m, groupnumber, message, length); | 477 | return group_message_send(m, groupnumber, message, length); |
478 | } | 478 | } |
479 | 479 | ||
480 | /* Return the number of chats in the instance m. | ||
481 | * You should use this to determine how much memory to allocate | ||
482 | * for copy_chatlist. */ | ||
483 | uint32_t tox_count_chatlist(Tox *tox) | ||
484 | { | ||
485 | Messenger *m = tox; | ||
486 | return count_chatlist(m); | ||
487 | } | ||
488 | |||
489 | /* Copy a list of valid chat IDs into the array out_list. | ||
490 | * If out_list is NULL, returns 0. | ||
491 | * Otherwise, returns the number of elements copied. | ||
492 | * If the array was too small, the contents | ||
493 | * of out_list will be truncated to list_size. */ | ||
494 | uint32_t tox_copy_chatlist(Tox *tox, int *out_list, uint32_t list_size) | ||
495 | { | ||
496 | Messenger *m = tox; | ||
497 | return copy_chatlist(m, out_list, list_size); | ||
498 | } | ||
480 | 499 | ||
481 | 500 | ||
482 | /****************FILE SENDING FUNCTIONS*****************/ | 501 | /****************FILE SENDING FUNCTIONS*****************/ |