summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toxcore/tox.h116
1 files changed, 64 insertions, 52 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h
index 1a189ae3..a3973ae9 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -83,7 +83,7 @@ extern "C" {
83 * It is possible to run multiple concurrent threads with a Tox instance for 83 * It is possible to run multiple concurrent threads with a Tox instance for
84 * each thread. It is also possible to run all Tox instances in the same thread. 84 * each thread. It is also possible to run all Tox instances in the same thread.
85 * A common way to run Tox (multiple or single instance) is to have one thread 85 * A common way to run Tox (multiple or single instance) is to have one thread
86 * running a simple tox_iteration loop, sleeping for tox_iteration_time 86 * running a simple tox_iteration loop, sleeping for tox_iteration_interval
87 * milliseconds on each iteration. 87 * milliseconds on each iteration.
88 * 88 *
89 * If you want to access a single Tox instance from multiple threads, access 89 * If you want to access a single Tox instance from multiple threads, access
@@ -260,7 +260,7 @@ bool tox_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch);
260/** 260/**
261 * Represents the possible statuses a client can have. 261 * Represents the possible statuses a client can have.
262 */ 262 */
263typedef enum TOX_STATUS { 263enum TOX_STATUS {
264 /** 264 /**
265 * User is online and available. 265 * User is online and available.
266 */ 266 */
@@ -279,8 +279,8 @@ typedef enum TOX_STATUS {
279 * Invalid status used when function returns an error. 279 * Invalid status used when function returns an error.
280 */ 280 */
281 TOX_STATUS_INVALID 281 TOX_STATUS_INVALID
282} TOX_STATUS; 282};
283 283typedef uint8_t TOX_STATUS;
284 284
285/******************************************************************************* 285/*******************************************************************************
286 * 286 *
@@ -289,7 +289,7 @@ typedef enum TOX_STATUS {
289 ******************************************************************************/ 289 ******************************************************************************/
290 290
291 291
292typedef enum TOX_PROXY_TYPE { 292enum TOX_PROXY_TYPE {
293 /** 293 /**
294 * Don't use a proxy. 294 * Don't use a proxy.
295 */ 295 */
@@ -302,8 +302,8 @@ typedef enum TOX_PROXY_TYPE {
302 * SOCKS proxy for simple socket pipes. 302 * SOCKS proxy for simple socket pipes.
303 */ 303 */
304 TOX_PROXY_TYPE_SOCKS5 304 TOX_PROXY_TYPE_SOCKS5
305} TOX_PROXY_TYPE; 305};
306 306typedef uint8_t TOX_PROXY_TYPE;
307 307
308/** 308/**
309 * This struct contains all the startup options for Tox. You can either allocate 309 * This struct contains all the startup options for Tox. You can either allocate
@@ -370,13 +370,14 @@ struct Tox_Options {
370void tox_options_default(struct Tox_Options *options); 370void tox_options_default(struct Tox_Options *options);
371 371
372 372
373typedef enum TOX_ERR_OPTIONS_NEW { 373enum TOX_ERR_OPTIONS_NEW {
374 TOX_ERR_OPTIONS_NEW_OK, 374 TOX_ERR_OPTIONS_NEW_OK,
375 /** 375 /**
376 * The function failed to allocate enough memory for the options struct. 376 * The function failed to allocate enough memory for the options struct.
377 */ 377 */
378 TOX_ERR_OPTIONS_NEW_MALLOC 378 TOX_ERR_OPTIONS_NEW_MALLOC
379} TOX_ERR_OPTIONS_NEW; 379};
380typedef uint8_t TOX_ERR_OPTIONS_NEW;
380 381
381/** 382/**
382 * Allocates a new Tox_Options object and initialises it with the default 383 * Allocates a new Tox_Options object and initialises it with the default
@@ -407,7 +408,7 @@ void tox_options_free(struct Tox_Options *options);
407 ******************************************************************************/ 408 ******************************************************************************/
408 409
409 410
410typedef enum TOX_ERR_NEW { 411enum TOX_ERR_NEW {
411 TOX_ERR_NEW_OK, 412 TOX_ERR_NEW_OK,
412 TOX_ERR_NEW_NULL, 413 TOX_ERR_NEW_NULL,
413 /** 414 /**
@@ -450,8 +451,8 @@ typedef enum TOX_ERR_NEW {
450 * causes this error. 451 * causes this error.
451 */ 452 */
452 TOX_ERR_NEW_LOAD_BAD_FORMAT 453 TOX_ERR_NEW_LOAD_BAD_FORMAT
453} TOX_ERR_NEW; 454};
454 455typedef uint8_t TOX_ERR_NEW;
455 456
456/** 457/**
457 * @brief Creates and initialises a new Tox instance with the options passed. 458 * @brief Creates and initialises a new Tox instance with the options passed.
@@ -511,7 +512,7 @@ void tox_save(Tox const *tox, uint8_t *data);
511 ******************************************************************************/ 512 ******************************************************************************/
512 513
513 514
514typedef enum TOX_ERR_BOOTSTRAP { 515enum TOX_ERR_BOOTSTRAP {
515 TOX_ERR_BOOTSTRAP_OK, 516 TOX_ERR_BOOTSTRAP_OK,
516 TOX_ERR_BOOTSTRAP_NULL, 517 TOX_ERR_BOOTSTRAP_NULL,
517 /** 518 /**
@@ -523,7 +524,8 @@ typedef enum TOX_ERR_BOOTSTRAP {
523 * The port passed was invalid. The valid port range is (1, 65535). 524 * The port passed was invalid. The valid port range is (1, 65535).
524 */ 525 */
525 TOX_ERR_BOOTSTRAP_BAD_PORT 526 TOX_ERR_BOOTSTRAP_BAD_PORT
526} TOX_ERR_BOOTSTRAP; 527};
528typedef uint8_t TOX_ERR_BOOTSTRAP;
527 529
528/** 530/**
529 * Sends a "get nodes" request to the given bootstrap node with IP, port, and 531 * Sends a "get nodes" request to the given bootstrap node with IP, port, and
@@ -564,7 +566,7 @@ bool tox_add_tcp_relay(Tox *tox, char const *address, uint16_t port, uint8_t con
564 TOX_ERR_BOOTSTRAP *error); 566 TOX_ERR_BOOTSTRAP *error);
565 567
566 568
567typedef enum TOX_CONNECTION { 569enum TOX_CONNECTION {
568 /** 570 /**
569 * There is no connection. This instance, or the friend the state change is 571 * There is no connection. This instance, or the friend the state change is
570 * about, is now offline. 572 * about, is now offline.
@@ -583,8 +585,8 @@ typedef enum TOX_CONNECTION {
583 * particular friend was built using direct UDP packets. 585 * particular friend was built using direct UDP packets.
584 */ 586 */
585 TOX_CONNECTION_UDP 587 TOX_CONNECTION_UDP
586} TOX_CONNECTION; 588};
587 589typedef uint8_t TOX_CONNECTION;
588 590
589/** 591/**
590 * Return whether we are connected to the DHT. The return value is equal to the 592 * Return whether we are connected to the DHT. The return value is equal to the
@@ -687,15 +689,15 @@ void tox_self_get_private_key(Tox const *tox, uint8_t *private_key);
687 * Common error codes for all functions that set a piece of user-visible 689 * Common error codes for all functions that set a piece of user-visible
688 * client information. 690 * client information.
689 */ 691 */
690typedef enum TOX_ERR_SET_INFO { 692enum TOX_ERR_SET_INFO {
691 TOX_ERR_SET_INFO_OK, 693 TOX_ERR_SET_INFO_OK,
692 TOX_ERR_SET_INFO_NULL, 694 TOX_ERR_SET_INFO_NULL,
693 /** 695 /**
694 * Information length exceeded maximum permissible size. 696 * Information length exceeded maximum permissible size.
695 */ 697 */
696 TOX_ERR_SET_INFO_TOO_LONG 698 TOX_ERR_SET_INFO_TOO_LONG
697} TOX_ERR_SET_INFO; 699};
698 700typedef uint8_t TOX_ERR_SET_INFO;
699 701
700/** 702/**
701 * Set the nickname for the Tox client. 703 * Set the nickname for the Tox client.
@@ -789,7 +791,7 @@ TOX_STATUS tox_self_get_status(Tox const *tox);
789 ******************************************************************************/ 791 ******************************************************************************/
790 792
791 793
792typedef enum TOX_ERR_FRIEND_ADD { 794enum TOX_ERR_FRIEND_ADD {
793 TOX_ERR_FRIEND_ADD_OK, 795 TOX_ERR_FRIEND_ADD_OK,
794 TOX_ERR_FRIEND_ADD_NULL, 796 TOX_ERR_FRIEND_ADD_NULL,
795 /** 797 /**
@@ -823,7 +825,8 @@ typedef enum TOX_ERR_FRIEND_ADD {
823 * A memory allocation failed when trying to increase the friend list size. 825 * A memory allocation failed when trying to increase the friend list size.
824 */ 826 */
825 TOX_ERR_FRIEND_ADD_MALLOC 827 TOX_ERR_FRIEND_ADD_MALLOC
826} TOX_ERR_FRIEND_ADD; 828};
829typedef uint8_t TOX_ERR_FRIEND_ADD;
827 830
828/** 831/**
829 * Add a friend to the friend list and send a friend request. 832 * Add a friend to the friend list and send a friend request.
@@ -872,13 +875,14 @@ uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message
872uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error); 875uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error);
873 876
874 877
875typedef enum TOX_ERR_FRIEND_DELETE { 878enum TOX_ERR_FRIEND_DELETE {
876 TOX_ERR_FRIEND_DELETE_OK, 879 TOX_ERR_FRIEND_DELETE_OK,
877 /** 880 /**
878 * There was no friend with the given friend number. No friends were deleted. 881 * There was no friend with the given friend number. No friends were deleted.
879 */ 882 */
880 TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND 883 TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND
881} TOX_ERR_FRIEND_DELETE; 884};
885typedef uint8_t TOX_ERR_FRIEND_DELETE;
882 886
883/** 887/**
884 * Remove a friend from the friend list. 888 * Remove a friend from the friend list.
@@ -901,14 +905,15 @@ bool tox_friend_delete(Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_DELETE *
901 ******************************************************************************/ 905 ******************************************************************************/
902 906
903 907
904typedef enum TOX_ERR_FRIEND_BY_PUBLIC_KEY { 908enum TOX_ERR_FRIEND_BY_PUBLIC_KEY {
905 TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK, 909 TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK,
906 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL, 910 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL,
907 /** 911 /**
908 * No friend with the given Public Key exists on the friend list. 912 * No friend with the given Public Key exists on the friend list.
909 */ 913 */
910 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NOT_FOUND 914 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NOT_FOUND
911} TOX_ERR_FRIEND_BY_PUBLIC_KEY; 915};
916typedef uint8_t TOX_ERR_FRIEND_BY_PUBLIC_KEY;
912 917
913/** 918/**
914 * Return the friend number associated with that Public Key. 919 * Return the friend number associated with that Public Key.
@@ -919,14 +924,15 @@ typedef enum TOX_ERR_FRIEND_BY_PUBLIC_KEY {
919uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); 924uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error);
920 925
921 926
922typedef enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { 927enum TOX_ERR_FRIEND_GET_PUBLIC_KEY {
923 TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK, 928 TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK,
924 TOX_ERR_FRIEND_GET_PUBLIC_KEY_NULL, 929 TOX_ERR_FRIEND_GET_PUBLIC_KEY_NULL,
925 /** 930 /**
926 * No friend with the given number exists on the friend list. 931 * No friend with the given number exists on the friend list.
927 */ 932 */
928 TOX_ERR_FRIEND_GET_PUBLIC_KEY_FRIEND_NOT_FOUND 933 TOX_ERR_FRIEND_GET_PUBLIC_KEY_FRIEND_NOT_FOUND
929} TOX_ERR_FRIEND_GET_PUBLIC_KEY; 934};
935typedef uint8_t TOX_ERR_FRIEND_GET_PUBLIC_KEY;
930 936
931/** 937/**
932 * Copies the Public Key associated with a given friend number to a byte array. 938 * Copies the Public Key associated with a given friend number to a byte array.
@@ -979,7 +985,7 @@ void tox_friend_list(Tox const *tox, uint32_t *list);
979/** 985/**
980 * Common error codes for friend state query functions. 986 * Common error codes for friend state query functions.
981 */ 987 */
982typedef enum TOX_ERR_FRIEND_QUERY { 988enum TOX_ERR_FRIEND_QUERY {
983 TOX_ERR_FRIEND_QUERY_OK, 989 TOX_ERR_FRIEND_QUERY_OK,
984 /** 990 /**
985 * The pointer parameter for storing the query result (name, message) was 991 * The pointer parameter for storing the query result (name, message) was
@@ -991,8 +997,8 @@ typedef enum TOX_ERR_FRIEND_QUERY {
991 * The friend_number did not designate a valid friend. 997 * The friend_number did not designate a valid friend.
992 */ 998 */
993 TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND 999 TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND
994} TOX_ERR_FRIEND_QUERY; 1000};
995 1001typedef uint8_t TOX_ERR_FRIEND_QUERY;
996 1002
997/** 1003/**
998 * Return the length of the friend's name. If the friend number is invalid, the 1004 * Return the length of the friend's name. If the friend number is invalid, the
@@ -1180,13 +1186,14 @@ void tox_callback_friend_typing(Tox *tox, tox_friend_typing_cb *function, void *
1180 ******************************************************************************/ 1186 ******************************************************************************/
1181 1187
1182 1188
1183typedef enum TOX_ERR_SET_TYPING { 1189enum TOX_ERR_SET_TYPING {
1184 TOX_ERR_SET_TYPING_OK, 1190 TOX_ERR_SET_TYPING_OK,
1185 /** 1191 /**
1186 * The friend number did not designate a valid friend. 1192 * The friend number did not designate a valid friend.
1187 */ 1193 */
1188 TOX_ERR_SET_TYPING_FRIEND_NOT_FOUND 1194 TOX_ERR_SET_TYPING_FRIEND_NOT_FOUND
1189} TOX_ERR_SET_TYPING; 1195};
1196typedef uint8_t TOX_ERR_SET_TYPING;
1190 1197
1191/** 1198/**
1192 * Set the client's typing status for a friend. 1199 * Set the client's typing status for a friend.
@@ -1201,7 +1208,7 @@ typedef enum TOX_ERR_SET_TYPING {
1201bool tox_self_set_typing(Tox *tox, uint32_t friend_number, bool is_typing, TOX_ERR_SET_TYPING *error); 1208bool tox_self_set_typing(Tox *tox, uint32_t friend_number, bool is_typing, TOX_ERR_SET_TYPING *error);
1202 1209
1203 1210
1204typedef enum TOX_ERR_SEND_MESSAGE { 1211enum TOX_ERR_SEND_MESSAGE {
1205 TOX_ERR_SEND_MESSAGE_OK, 1212 TOX_ERR_SEND_MESSAGE_OK,
1206 TOX_ERR_SEND_MESSAGE_NULL, 1213 TOX_ERR_SEND_MESSAGE_NULL,
1207 /** 1214 /**
@@ -1224,7 +1231,8 @@ typedef enum TOX_ERR_SEND_MESSAGE {
1224 * Attempted to send a zero-length message. 1231 * Attempted to send a zero-length message.
1225 */ 1232 */
1226 TOX_ERR_SEND_MESSAGE_EMPTY 1233 TOX_ERR_SEND_MESSAGE_EMPTY
1227} TOX_ERR_SEND_MESSAGE; 1234};
1235typedef uint8_t TOX_ERR_SEND_MESSAGE;
1228 1236
1229/** 1237/**
1230 * Send a text chat message to an online friend. 1238 * Send a text chat message to an online friend.
@@ -1363,7 +1371,7 @@ void tox_callback_friend_action(Tox *tox, tox_friend_action_cb *function, void *
1363 ******************************************************************************/ 1371 ******************************************************************************/
1364 1372
1365 1373
1366typedef enum TOX_FILE_KIND { 1374enum TOX_FILE_KIND {
1367 /** 1375 /**
1368 * Arbitrary file data. Clients can choose to handle it based on the file name 1376 * Arbitrary file data. Clients can choose to handle it based on the file name
1369 * or magic or any other way they choose. 1377 * or magic or any other way they choose.
@@ -1386,8 +1394,8 @@ typedef enum TOX_FILE_KIND {
1386 * transfer if it matches. 1394 * transfer if it matches.
1387 */ 1395 */
1388 TOX_FILE_KIND_AVATAR 1396 TOX_FILE_KIND_AVATAR
1389} TOX_FILE_KIND; 1397};
1390 1398typedef uint8_t TOX_FILE_KIND;
1391 1399
1392/** 1400/**
1393 * Generates a cryptographic hash of the given data. 1401 * Generates a cryptographic hash of the given data.
@@ -1411,7 +1419,7 @@ typedef enum TOX_FILE_KIND {
1411bool tox_hash(uint8_t *hash, uint8_t const *data, size_t length); 1419bool tox_hash(uint8_t *hash, uint8_t const *data, size_t length);
1412 1420
1413 1421
1414typedef enum TOX_FILE_CONTROL { 1422enum TOX_FILE_CONTROL {
1415 /** 1423 /**
1416 * Sent by the receiving side to accept a file send request. Also sent after a 1424 * Sent by the receiving side to accept a file send request. Also sent after a
1417 * TOX_FILE_CONTROL_PAUSE command to continue sending or receiving. 1425 * TOX_FILE_CONTROL_PAUSE command to continue sending or receiving.
@@ -1429,10 +1437,10 @@ typedef enum TOX_FILE_CONTROL {
1429 * commands are sent. Also sent by either side to terminate a file transfer. 1437 * commands are sent. Also sent by either side to terminate a file transfer.
1430 */ 1438 */
1431 TOX_FILE_CONTROL_CANCEL 1439 TOX_FILE_CONTROL_CANCEL
1432} TOX_FILE_CONTROL; 1440};
1433 1441typedef uint8_t TOX_FILE_CONTROL;
1434 1442
1435typedef enum TOX_ERR_FILE_CONTROL { 1443enum TOX_ERR_FILE_CONTROL {
1436 TOX_ERR_FILE_CONTROL_OK, 1444 TOX_ERR_FILE_CONTROL_OK,
1437 /** 1445 /**
1438 * The friend_number passed did not designate a valid friend. 1446 * The friend_number passed did not designate a valid friend.
@@ -1459,7 +1467,8 @@ typedef enum TOX_ERR_FILE_CONTROL {
1459 * A PAUSE control was sent, but the file transfer was already paused. 1467 * A PAUSE control was sent, but the file transfer was already paused.
1460 */ 1468 */
1461 TOX_ERR_FILE_CONTROL_ALREADY_PAUSED 1469 TOX_ERR_FILE_CONTROL_ALREADY_PAUSED
1462} TOX_ERR_FILE_CONTROL; 1470};
1471typedef uint8_t TOX_ERR_FILE_CONTROL;
1463 1472
1464/** 1473/**
1465 * Sends a file control command to a friend for a given file transfer. 1474 * Sends a file control command to a friend for a given file transfer.
@@ -1505,7 +1514,7 @@ void tox_callback_file_control(Tox *tox, tox_file_control_cb *function, void *us
1505 ******************************************************************************/ 1514 ******************************************************************************/
1506 1515
1507 1516
1508typedef enum TOX_ERR_FILE_SEND { 1517enum TOX_ERR_FILE_SEND {
1509 TOX_ERR_FILE_SEND_OK, 1518 TOX_ERR_FILE_SEND_OK,
1510 TOX_ERR_FILE_SEND_NULL, 1519 TOX_ERR_FILE_SEND_NULL,
1511 /** 1520 /**
@@ -1529,7 +1538,8 @@ typedef enum TOX_ERR_FILE_SEND {
1529 * is 256 per friend per direction (sending and receiving). 1538 * is 256 per friend per direction (sending and receiving).
1530 */ 1539 */
1531 TOX_ERR_FILE_SEND_TOO_MANY 1540 TOX_ERR_FILE_SEND_TOO_MANY
1532} TOX_ERR_FILE_SEND; 1541};
1542typedef uint8_t TOX_ERR_FILE_SEND;
1533 1543
1534/** 1544/**
1535 * Send a file transmission request. 1545 * Send a file transmission request.
@@ -1590,7 +1600,7 @@ uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uin
1590 uint8_t const *filename, size_t filename_length, TOX_ERR_FILE_SEND *error); 1600 uint8_t const *filename, size_t filename_length, TOX_ERR_FILE_SEND *error);
1591 1601
1592 1602
1593typedef enum TOX_ERR_FILE_SEND_CHUNK { 1603enum TOX_ERR_FILE_SEND_CHUNK {
1594 TOX_ERR_FILE_SEND_CHUNK_OK, 1604 TOX_ERR_FILE_SEND_CHUNK_OK,
1595 /** 1605 /**
1596 * The length parameter was non-zero, but data was NULL. 1606 * The length parameter was non-zero, but data was NULL.
@@ -1614,7 +1624,8 @@ typedef enum TOX_ERR_FILE_SEND_CHUNK {
1614 * the file. Trying to send more will result in no data being sent. 1624 * the file. Trying to send more will result in no data being sent.
1615 */ 1625 */
1616 TOX_ERR_FILE_SEND_CHUNK_TOO_LARGE 1626 TOX_ERR_FILE_SEND_CHUNK_TOO_LARGE
1617} TOX_ERR_FILE_SEND_CHUNK; 1627};
1628typedef uint8_t TOX_ERR_FILE_SEND_CHUNK;
1618 1629
1619/** 1630/**
1620 * Send a chunk of file data to a friend. 1631 * Send a chunk of file data to a friend.
@@ -1752,7 +1763,7 @@ void tox_callback_file_receive_chunk(Tox *tox, tox_file_receive_chunk_cb *functi
1752 ******************************************************************************/ 1763 ******************************************************************************/
1753 1764
1754 1765
1755typedef enum TOX_ERR_SEND_CUSTOM_PACKET { 1766enum TOX_ERR_SEND_CUSTOM_PACKET {
1756 TOX_ERR_SEND_CUSTOM_PACKET_OK, 1767 TOX_ERR_SEND_CUSTOM_PACKET_OK,
1757 TOX_ERR_SEND_CUSTOM_PACKET_NULL, 1768 TOX_ERR_SEND_CUSTOM_PACKET_NULL,
1758 /** 1769 /**
@@ -1780,8 +1791,8 @@ typedef enum TOX_ERR_SEND_CUSTOM_PACKET {
1780 * Send queue size exceeded. 1791 * Send queue size exceeded.
1781 */ 1792 */
1782 TOX_ERR_SEND_CUSTOM_PACKET_SENDQ 1793 TOX_ERR_SEND_CUSTOM_PACKET_SENDQ
1783} TOX_ERR_SEND_CUSTOM_PACKET; 1794};
1784 1795typedef uint8_t TOX_ERR_SEND_CUSTOM_PACKET;
1785 1796
1786/** 1797/**
1787 * Send a custom lossy packet to a friend. 1798 * Send a custom lossy packet to a friend.
@@ -1880,13 +1891,14 @@ void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb
1880void tox_get_dht_id(Tox const *tox, uint8_t *dht_id); 1891void tox_get_dht_id(Tox const *tox, uint8_t *dht_id);
1881 1892
1882 1893
1883typedef enum TOX_ERR_GET_PORT { 1894enum TOX_ERR_GET_PORT {
1884 TOX_ERR_GET_PORT_OK, 1895 TOX_ERR_GET_PORT_OK,
1885 /** 1896 /**
1886 * The instance was not bound to any port. 1897 * The instance was not bound to any port.
1887 */ 1898 */
1888 TOX_ERR_GET_PORT_NOT_BOUND 1899 TOX_ERR_GET_PORT_NOT_BOUND
1889} TOX_ERR_GET_PORT; 1900};
1901typedef uint8_t TOX_ERR_GET_PORT;
1890 1902
1891/** 1903/**
1892 * Return the UDP port this Tox instance is bound to. 1904 * Return the UDP port this Tox instance is bound to.