diff options
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 2dc1594c..1a189ae3 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -274,7 +274,11 @@ typedef enum TOX_STATUS { | |||
274 | * User is busy. Signals to other clients that this client does not | 274 | * User is busy. Signals to other clients that this client does not |
275 | * currently wish to communicate. | 275 | * currently wish to communicate. |
276 | */ | 276 | */ |
277 | TOX_STATUS_BUSY | 277 | TOX_STATUS_BUSY, |
278 | /** | ||
279 | * Invalid status used when function returns an error. | ||
280 | */ | ||
281 | TOX_STATUS_INVALID | ||
278 | } TOX_STATUS; | 282 | } TOX_STATUS; |
279 | 283 | ||
280 | 284 | ||
@@ -833,7 +837,7 @@ typedef enum TOX_ERR_FRIEND_ADD { | |||
833 | * be the same as before. Deleting a friend creates a gap in the friend number | 837 | * be the same as before. Deleting a friend creates a gap in the friend number |
834 | * set, which is filled by the next adding of a friend. | 838 | * set, which is filled by the next adding of a friend. |
835 | * | 839 | * |
836 | * If more than UINT32_MAX friends are added, this function causes undefined | 840 | * If more than INT32_MAX friends are added, this function causes undefined |
837 | * behaviour. | 841 | * behaviour. |
838 | * | 842 | * |
839 | * @param address The address of the friend (returned by tox_self_get_address of | 843 | * @param address The address of the friend (returned by tox_self_get_address of |
@@ -841,7 +845,7 @@ typedef enum TOX_ERR_FRIEND_ADD { | |||
841 | * @param message The message that will be sent along with the friend request. | 845 | * @param message The message that will be sent along with the friend request. |
842 | * @param length The length of the data byte array. | 846 | * @param length The length of the data byte array. |
843 | * | 847 | * |
844 | * @return the friend number. | 848 | * @return the friend number on success, UINT32_MAX on failure. |
845 | */ | 849 | */ |
846 | uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message, size_t length, | 850 | uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message, size_t length, |
847 | TOX_ERR_FRIEND_ADD *error); | 851 | TOX_ERR_FRIEND_ADD *error); |
@@ -862,7 +866,7 @@ uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message | |||
862 | * @param public_key A byte array of length TOX_PUBLIC_KEY_SIZE containing the | 866 | * @param public_key A byte array of length TOX_PUBLIC_KEY_SIZE containing the |
863 | * Public Key (not the Address) of the friend to add. | 867 | * Public Key (not the Address) of the friend to add. |
864 | * | 868 | * |
865 | * @return the friend number. | 869 | * @return the friend number on success, UINT32_MAX on failure. |
866 | * @see tox_friend_add for a more detailed description of friend numbers. | 870 | * @see tox_friend_add for a more detailed description of friend numbers. |
867 | */ | 871 | */ |
868 | uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error); | 872 | uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error); |
@@ -909,6 +913,7 @@ typedef enum TOX_ERR_FRIEND_BY_PUBLIC_KEY { | |||
909 | /** | 913 | /** |
910 | * Return the friend number associated with that Public Key. | 914 | * Return the friend number associated with that Public Key. |
911 | * | 915 | * |
916 | * @return the friend number on success, UINT32_MAX on failure. | ||
912 | * @param public_key A byte array containing the Public Key. | 917 | * @param public_key A byte array containing the Public Key. |
913 | */ | 918 | */ |
914 | uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); | 919 | uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); |
@@ -916,6 +921,7 @@ uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX | |||
916 | 921 | ||
917 | typedef enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { | 922 | typedef enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { |
918 | TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK, | 923 | TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK, |
924 | TOX_ERR_FRIEND_GET_PUBLIC_KEY_NULL, | ||
919 | /** | 925 | /** |
920 | * No friend with the given number exists on the friend list. | 926 | * No friend with the given number exists on the friend list. |
921 | */ | 927 | */ |
@@ -990,7 +996,7 @@ typedef enum TOX_ERR_FRIEND_QUERY { | |||
990 | 996 | ||
991 | /** | 997 | /** |
992 | * Return the length of the friend's name. If the friend number is invalid, the | 998 | * Return the length of the friend's name. If the friend number is invalid, the |
993 | * return value is unspecified. | 999 | * return value is SIZE_MAX. |
994 | * | 1000 | * |
995 | * The return value is equal to the `length` argument received by the last | 1001 | * The return value is equal to the `length` argument received by the last |
996 | * `friend_name` callback. | 1002 | * `friend_name` callback. |
@@ -1034,7 +1040,7 @@ void tox_callback_friend_name(Tox *tox, tox_friend_name_cb *function, void *user | |||
1034 | 1040 | ||
1035 | /** | 1041 | /** |
1036 | * Return the length of the friend's status message. If the friend number is | 1042 | * Return the length of the friend's status message. If the friend number is |
1037 | * invalid, the return value is unspecified. | 1043 | * invalid, the return value is SIZE_MAX. |
1038 | */ | 1044 | */ |
1039 | size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1045 | size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1040 | 1046 | ||