summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-03-05 12:49:38 -0500
committerirungentoo <irungentoo@gmail.com>2015-03-05 12:49:38 -0500
commitf66f9fe76ee491dfb0882860d0bcfd6acbbfe95f (patch)
tree20a78811bcda38bf81373ab93e0dae8d66f7b7d0
parentac7da66529884da7db6a72fdf20f02748b849396 (diff)
enums are no longer typedefed to uint8_t.
-rw-r--r--toxcore/Messenger.c4
-rw-r--r--toxcore/Messenger.h9
-rw-r--r--toxcore/tox.h114
3 files changed, 58 insertions, 69 deletions
diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c
index 94cb93dd..373fc334 100644
--- a/toxcore/Messenger.c
+++ b/toxcore/Messenger.c
@@ -829,7 +829,7 @@ void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, uint3
829 m->friend_statusmessagechange_userdata = userdata; 829 m->friend_statusmessagechange_userdata = userdata;
830} 830}
831 831
832void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *), void *userdata) 832void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *), void *userdata)
833{ 833{
834 m->friend_userstatuschange = function; 834 m->friend_userstatuschange = function;
835 m->friend_userstatuschange_userdata = userdata; 835 m->friend_userstatuschange_userdata = userdata;
@@ -847,7 +847,7 @@ void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, uint32
847 m->read_receipt_userdata = userdata; 847 m->read_receipt_userdata = userdata;
848} 848}
849 849
850void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *), 850void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *),
851 void *userdata) 851 void *userdata)
852{ 852{
853 m->friend_connectionstatuschange = function; 853 m->friend_connectionstatuschange = function;
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h
index 67c2358d..90c66e2c 100644
--- a/toxcore/Messenger.h
+++ b/toxcore/Messenger.h
@@ -230,13 +230,13 @@ struct Messenger {
230 void *friend_namechange_userdata; 230 void *friend_namechange_userdata;
231 void (*friend_statusmessagechange)(struct Messenger *m, uint32_t, const uint8_t *, size_t, void *); 231 void (*friend_statusmessagechange)(struct Messenger *m, uint32_t, const uint8_t *, size_t, void *);
232 void *friend_statusmessagechange_userdata; 232 void *friend_statusmessagechange_userdata;
233 void (*friend_userstatuschange)(struct Messenger *m, uint32_t, uint8_t, void *); 233 void (*friend_userstatuschange)(struct Messenger *m, uint32_t, unsigned int, void *);
234 void *friend_userstatuschange_userdata; 234 void *friend_userstatuschange_userdata;
235 void (*friend_typingchange)(struct Messenger *m, uint32_t, _Bool, void *); 235 void (*friend_typingchange)(struct Messenger *m, uint32_t, _Bool, void *);
236 void *friend_typingchange_userdata; 236 void *friend_typingchange_userdata;
237 void (*read_receipt)(struct Messenger *m, uint32_t, uint32_t, void *); 237 void (*read_receipt)(struct Messenger *m, uint32_t, uint32_t, void *);
238 void *read_receipt_userdata; 238 void *read_receipt_userdata;
239 void (*friend_connectionstatuschange)(struct Messenger *m, uint32_t, uint8_t, void *); 239 void (*friend_connectionstatuschange)(struct Messenger *m, uint32_t, unsigned int, void *);
240 void *friend_connectionstatuschange_userdata; 240 void *friend_connectionstatuschange_userdata;
241 void (*friend_connectionstatuschange_internal)(struct Messenger *m, uint32_t, uint8_t, void *); 241 void (*friend_connectionstatuschange_internal)(struct Messenger *m, uint32_t, uint8_t, void *);
242 void *friend_connectionstatuschange_internal_userdata; 242 void *friend_connectionstatuschange_internal_userdata;
@@ -495,7 +495,8 @@ void m_callback_statusmessage(Messenger *m, void (*function)(Messenger *m, uint3
495/* Set the callback for status type changes. 495/* Set the callback for status type changes.
496 * Function(uint32_t friendnumber, USERSTATUS kind) 496 * Function(uint32_t friendnumber, USERSTATUS kind)
497 */ 497 */
498void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *), void *userdata); 498void m_callback_userstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *),
499 void *userdata);
499 500
500/* Set the callback for typing changes. 501/* Set the callback for typing changes.
501 * Function(uint32_t friendnumber, uint8_t is_typing) 502 * Function(uint32_t friendnumber, uint8_t is_typing)
@@ -524,7 +525,7 @@ void m_callback_read_receipt(Messenger *m, void (*function)(Messenger *m, uint32
524 * being previously online" part. 525 * being previously online" part.
525 * It's assumed that when adding friends, their connection status is offline. 526 * It's assumed that when adding friends, their connection status is offline.
526 */ 527 */
527void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *), 528void m_callback_connectionstatus(Messenger *m, void (*function)(Messenger *m, uint32_t, unsigned int, void *),
528 void *userdata); 529 void *userdata);
529/* Same as previous but for internal A/V core usage only */ 530/* Same as previous but for internal A/V core usage only */
530void m_callback_connectionstatus_internal_av(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *), 531void m_callback_connectionstatus_internal_av(Messenger *m, void (*function)(Messenger *m, uint32_t, uint8_t, void *),
diff --git a/toxcore/tox.h b/toxcore/tox.h
index 8a489411..23d37cd9 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -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 */
263enum TOX_STATUS { 263typedef enum TOX_STATUS {
264 /** 264 /**
265 * User is online and available. 265 * User is online and available.
266 */ 266 */
@@ -279,8 +279,8 @@ 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}; 282} TOX_STATUS;
283typedef uint8_t TOX_STATUS; 283
284 284
285/******************************************************************************* 285/*******************************************************************************
286 * 286 *
@@ -289,7 +289,7 @@ typedef uint8_t TOX_STATUS;
289 ******************************************************************************/ 289 ******************************************************************************/
290 290
291 291
292enum TOX_PROXY_TYPE { 292typedef enum TOX_PROXY_TYPE {
293 /** 293 /**
294 * Don't use a proxy. 294 * Don't use a proxy.
295 */ 295 */
@@ -302,8 +302,8 @@ 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}; 305} TOX_PROXY_TYPE;
306typedef uint8_t TOX_PROXY_TYPE; 306
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
@@ -389,14 +389,13 @@ struct Tox_Options {
389void tox_options_default(struct Tox_Options *options); 389void tox_options_default(struct Tox_Options *options);
390 390
391 391
392enum TOX_ERR_OPTIONS_NEW { 392typedef enum TOX_ERR_OPTIONS_NEW {
393 TOX_ERR_OPTIONS_NEW_OK, 393 TOX_ERR_OPTIONS_NEW_OK,
394 /** 394 /**
395 * The function failed to allocate enough memory for the options struct. 395 * The function failed to allocate enough memory for the options struct.
396 */ 396 */
397 TOX_ERR_OPTIONS_NEW_MALLOC 397 TOX_ERR_OPTIONS_NEW_MALLOC
398}; 398} TOX_ERR_OPTIONS_NEW;
399typedef uint8_t TOX_ERR_OPTIONS_NEW;
400 399
401/** 400/**
402 * Allocates a new Tox_Options object and initialises it with the default 401 * Allocates a new Tox_Options object and initialises it with the default
@@ -427,7 +426,7 @@ void tox_options_free(struct Tox_Options *options);
427 ******************************************************************************/ 426 ******************************************************************************/
428 427
429 428
430enum TOX_ERR_NEW { 429typedef enum TOX_ERR_NEW {
431 TOX_ERR_NEW_OK, 430 TOX_ERR_NEW_OK,
432 TOX_ERR_NEW_NULL, 431 TOX_ERR_NEW_NULL,
433 /** 432 /**
@@ -478,8 +477,8 @@ enum TOX_ERR_NEW {
478 * causes this error. 477 * causes this error.
479 */ 478 */
480 TOX_ERR_NEW_LOAD_BAD_FORMAT 479 TOX_ERR_NEW_LOAD_BAD_FORMAT
481}; 480} TOX_ERR_NEW;
482typedef uint8_t TOX_ERR_NEW; 481
483 482
484/** 483/**
485 * @brief Creates and initialises a new Tox instance with the options passed. 484 * @brief Creates and initialises a new Tox instance with the options passed.
@@ -539,7 +538,7 @@ void tox_save(const Tox *tox, uint8_t *data);
539 ******************************************************************************/ 538 ******************************************************************************/
540 539
541 540
542enum TOX_ERR_BOOTSTRAP { 541typedef enum TOX_ERR_BOOTSTRAP {
543 TOX_ERR_BOOTSTRAP_OK, 542 TOX_ERR_BOOTSTRAP_OK,
544 TOX_ERR_BOOTSTRAP_NULL, 543 TOX_ERR_BOOTSTRAP_NULL,
545 /** 544 /**
@@ -551,8 +550,7 @@ enum TOX_ERR_BOOTSTRAP {
551 * The port passed was invalid. The valid port range is (1, 65535). 550 * The port passed was invalid. The valid port range is (1, 65535).
552 */ 551 */
553 TOX_ERR_BOOTSTRAP_BAD_PORT 552 TOX_ERR_BOOTSTRAP_BAD_PORT
554}; 553} TOX_ERR_BOOTSTRAP;
555typedef uint8_t TOX_ERR_BOOTSTRAP;
556 554
557/** 555/**
558 * Sends a "get nodes" request to the given bootstrap node with IP, port, and 556 * Sends a "get nodes" request to the given bootstrap node with IP, port, and
@@ -593,7 +591,7 @@ bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8
593 TOX_ERR_BOOTSTRAP *error); 591 TOX_ERR_BOOTSTRAP *error);
594 592
595 593
596enum TOX_CONNECTION { 594typedef enum TOX_CONNECTION {
597 /** 595 /**
598 * There is no connection. This instance, or the friend the state change is 596 * There is no connection. This instance, or the friend the state change is
599 * about, is now offline. 597 * about, is now offline.
@@ -612,8 +610,8 @@ enum TOX_CONNECTION {
612 * particular friend was built using direct UDP packets. 610 * particular friend was built using direct UDP packets.
613 */ 611 */
614 TOX_CONNECTION_UDP 612 TOX_CONNECTION_UDP
615}; 613} TOX_CONNECTION;
616typedef uint8_t TOX_CONNECTION; 614
617 615
618/** 616/**
619 * Return whether we are connected to the DHT. The return value is equal to the 617 * Return whether we are connected to the DHT. The return value is equal to the
@@ -716,15 +714,15 @@ void tox_self_get_private_key(const Tox *tox, uint8_t *private_key);
716 * Common error codes for all functions that set a piece of user-visible 714 * Common error codes for all functions that set a piece of user-visible
717 * client information. 715 * client information.
718 */ 716 */
719enum TOX_ERR_SET_INFO { 717typedef enum TOX_ERR_SET_INFO {
720 TOX_ERR_SET_INFO_OK, 718 TOX_ERR_SET_INFO_OK,
721 TOX_ERR_SET_INFO_NULL, 719 TOX_ERR_SET_INFO_NULL,
722 /** 720 /**
723 * Information length exceeded maximum permissible size. 721 * Information length exceeded maximum permissible size.
724 */ 722 */
725 TOX_ERR_SET_INFO_TOO_LONG 723 TOX_ERR_SET_INFO_TOO_LONG
726}; 724} TOX_ERR_SET_INFO;
727typedef uint8_t TOX_ERR_SET_INFO; 725
728 726
729/** 727/**
730 * Set the nickname for the Tox client. 728 * Set the nickname for the Tox client.
@@ -818,7 +816,7 @@ TOX_STATUS tox_self_get_status(const Tox *tox);
818 ******************************************************************************/ 816 ******************************************************************************/
819 817
820 818
821enum TOX_ERR_FRIEND_ADD { 819typedef enum TOX_ERR_FRIEND_ADD {
822 TOX_ERR_FRIEND_ADD_OK, 820 TOX_ERR_FRIEND_ADD_OK,
823 TOX_ERR_FRIEND_ADD_NULL, 821 TOX_ERR_FRIEND_ADD_NULL,
824 /** 822 /**
@@ -852,8 +850,7 @@ enum TOX_ERR_FRIEND_ADD {
852 * A memory allocation failed when trying to increase the friend list size. 850 * A memory allocation failed when trying to increase the friend list size.
853 */ 851 */
854 TOX_ERR_FRIEND_ADD_MALLOC 852 TOX_ERR_FRIEND_ADD_MALLOC
855}; 853} TOX_ERR_FRIEND_ADD;
856typedef uint8_t TOX_ERR_FRIEND_ADD;
857 854
858/** 855/**
859 * Add a friend to the friend list and send a friend request. 856 * Add a friend to the friend list and send a friend request.
@@ -902,14 +899,13 @@ uint32_t tox_friend_add(Tox *tox, const uint8_t *address, const uint8_t *message
902uint32_t tox_friend_add_norequest(Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_ADD *error); 899uint32_t tox_friend_add_norequest(Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_ADD *error);
903 900
904 901
905enum TOX_ERR_FRIEND_DELETE { 902typedef enum TOX_ERR_FRIEND_DELETE {
906 TOX_ERR_FRIEND_DELETE_OK, 903 TOX_ERR_FRIEND_DELETE_OK,
907 /** 904 /**
908 * There was no friend with the given friend number. No friends were deleted. 905 * There was no friend with the given friend number. No friends were deleted.
909 */ 906 */
910 TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND 907 TOX_ERR_FRIEND_DELETE_FRIEND_NOT_FOUND
911}; 908} TOX_ERR_FRIEND_DELETE;
912typedef uint8_t TOX_ERR_FRIEND_DELETE;
913 909
914/** 910/**
915 * Remove a friend from the friend list. 911 * Remove a friend from the friend list.
@@ -932,15 +928,14 @@ bool tox_friend_delete(Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_DELETE *
932 ******************************************************************************/ 928 ******************************************************************************/
933 929
934 930
935enum TOX_ERR_FRIEND_BY_PUBLIC_KEY { 931typedef enum TOX_ERR_FRIEND_BY_PUBLIC_KEY {
936 TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK, 932 TOX_ERR_FRIEND_BY_PUBLIC_KEY_OK,
937 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL, 933 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NULL,
938 /** 934 /**
939 * No friend with the given Public Key exists on the friend list. 935 * No friend with the given Public Key exists on the friend list.
940 */ 936 */
941 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NOT_FOUND 937 TOX_ERR_FRIEND_BY_PUBLIC_KEY_NOT_FOUND
942}; 938} TOX_ERR_FRIEND_BY_PUBLIC_KEY;
943typedef uint8_t TOX_ERR_FRIEND_BY_PUBLIC_KEY;
944 939
945/** 940/**
946 * Return the friend number associated with that Public Key. 941 * Return the friend number associated with that Public Key.
@@ -951,15 +946,14 @@ typedef uint8_t TOX_ERR_FRIEND_BY_PUBLIC_KEY;
951uint32_t tox_friend_by_public_key(const Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); 946uint32_t tox_friend_by_public_key(const Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error);
952 947
953 948
954enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { 949typedef enum TOX_ERR_FRIEND_GET_PUBLIC_KEY {
955 TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK, 950 TOX_ERR_FRIEND_GET_PUBLIC_KEY_OK,
956 TOX_ERR_FRIEND_GET_PUBLIC_KEY_NULL, 951 TOX_ERR_FRIEND_GET_PUBLIC_KEY_NULL,
957 /** 952 /**
958 * No friend with the given number exists on the friend list. 953 * No friend with the given number exists on the friend list.
959 */ 954 */
960 TOX_ERR_FRIEND_GET_PUBLIC_KEY_FRIEND_NOT_FOUND 955 TOX_ERR_FRIEND_GET_PUBLIC_KEY_FRIEND_NOT_FOUND
961}; 956} TOX_ERR_FRIEND_GET_PUBLIC_KEY;
962typedef uint8_t TOX_ERR_FRIEND_GET_PUBLIC_KEY;
963 957
964/** 958/**
965 * Copies the Public Key associated with a given friend number to a byte array. 959 * Copies the Public Key associated with a given friend number to a byte array.
@@ -1012,7 +1006,7 @@ void tox_friend_list(const Tox *tox, uint32_t *list);
1012/** 1006/**
1013 * Common error codes for friend state query functions. 1007 * Common error codes for friend state query functions.
1014 */ 1008 */
1015enum TOX_ERR_FRIEND_QUERY { 1009typedef enum TOX_ERR_FRIEND_QUERY {
1016 TOX_ERR_FRIEND_QUERY_OK, 1010 TOX_ERR_FRIEND_QUERY_OK,
1017 /** 1011 /**
1018 * The pointer parameter for storing the query result (name, message) was 1012 * The pointer parameter for storing the query result (name, message) was
@@ -1024,8 +1018,8 @@ enum TOX_ERR_FRIEND_QUERY {
1024 * The friend_number did not designate a valid friend. 1018 * The friend_number did not designate a valid friend.
1025 */ 1019 */
1026 TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND 1020 TOX_ERR_FRIEND_QUERY_FRIEND_NOT_FOUND
1027}; 1021} TOX_ERR_FRIEND_QUERY;
1028typedef uint8_t TOX_ERR_FRIEND_QUERY; 1022
1029 1023
1030/** 1024/**
1031 * Return the length of the friend's name. If the friend number is invalid, the 1025 * Return the length of the friend's name. If the friend number is invalid, the
@@ -1213,14 +1207,13 @@ void tox_callback_friend_typing(Tox *tox, tox_friend_typing_cb *function, void *
1213 ******************************************************************************/ 1207 ******************************************************************************/
1214 1208
1215 1209
1216enum TOX_ERR_SET_TYPING { 1210typedef enum TOX_ERR_SET_TYPING {
1217 TOX_ERR_SET_TYPING_OK, 1211 TOX_ERR_SET_TYPING_OK,
1218 /** 1212 /**
1219 * The friend number did not designate a valid friend. 1213 * The friend number did not designate a valid friend.
1220 */ 1214 */
1221 TOX_ERR_SET_TYPING_FRIEND_NOT_FOUND 1215 TOX_ERR_SET_TYPING_FRIEND_NOT_FOUND
1222}; 1216} TOX_ERR_SET_TYPING;
1223typedef uint8_t TOX_ERR_SET_TYPING;
1224 1217
1225/** 1218/**
1226 * Set the client's typing status for a friend. 1219 * Set the client's typing status for a friend.
@@ -1235,7 +1228,7 @@ typedef uint8_t TOX_ERR_SET_TYPING;
1235bool tox_self_set_typing(Tox *tox, uint32_t friend_number, bool is_typing, TOX_ERR_SET_TYPING *error); 1228bool tox_self_set_typing(Tox *tox, uint32_t friend_number, bool is_typing, TOX_ERR_SET_TYPING *error);
1236 1229
1237 1230
1238enum TOX_ERR_SEND_MESSAGE { 1231typedef enum TOX_ERR_SEND_MESSAGE {
1239 TOX_ERR_SEND_MESSAGE_OK, 1232 TOX_ERR_SEND_MESSAGE_OK,
1240 TOX_ERR_SEND_MESSAGE_NULL, 1233 TOX_ERR_SEND_MESSAGE_NULL,
1241 /** 1234 /**
@@ -1258,8 +1251,7 @@ enum TOX_ERR_SEND_MESSAGE {
1258 * Attempted to send a zero-length message. 1251 * Attempted to send a zero-length message.
1259 */ 1252 */
1260 TOX_ERR_SEND_MESSAGE_EMPTY 1253 TOX_ERR_SEND_MESSAGE_EMPTY
1261}; 1254} TOX_ERR_SEND_MESSAGE;
1262typedef uint8_t TOX_ERR_SEND_MESSAGE;
1263 1255
1264/** 1256/**
1265 * Send a text chat message to an online friend. 1257 * Send a text chat message to an online friend.
@@ -1398,7 +1390,7 @@ void tox_callback_friend_action(Tox *tox, tox_friend_action_cb *function, void *
1398 ******************************************************************************/ 1390 ******************************************************************************/
1399 1391
1400 1392
1401enum TOX_FILE_KIND { 1393typedef enum TOX_FILE_KIND {
1402 /** 1394 /**
1403 * Arbitrary file data. Clients can choose to handle it based on the file name 1395 * Arbitrary file data. Clients can choose to handle it based on the file name
1404 * or magic or any other way they choose. 1396 * or magic or any other way they choose.
@@ -1421,8 +1413,8 @@ enum TOX_FILE_KIND {
1421 * transfer if it matches. 1413 * transfer if it matches.
1422 */ 1414 */
1423 TOX_FILE_KIND_AVATAR 1415 TOX_FILE_KIND_AVATAR
1424}; 1416} TOX_FILE_KIND;
1425typedef uint8_t TOX_FILE_KIND; 1417
1426 1418
1427/** 1419/**
1428 * Generates a cryptographic hash of the given data. 1420 * Generates a cryptographic hash of the given data.
@@ -1446,7 +1438,7 @@ typedef uint8_t TOX_FILE_KIND;
1446bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length); 1438bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length);
1447 1439
1448 1440
1449enum TOX_FILE_CONTROL { 1441typedef enum TOX_FILE_CONTROL {
1450 /** 1442 /**
1451 * Sent by the receiving side to accept a file send request. Also sent after a 1443 * Sent by the receiving side to accept a file send request. Also sent after a
1452 * TOX_FILE_CONTROL_PAUSE command to continue sending or receiving. 1444 * TOX_FILE_CONTROL_PAUSE command to continue sending or receiving.
@@ -1464,10 +1456,10 @@ enum TOX_FILE_CONTROL {
1464 * commands are sent. Also sent by either side to terminate a file transfer. 1456 * commands are sent. Also sent by either side to terminate a file transfer.
1465 */ 1457 */
1466 TOX_FILE_CONTROL_CANCEL 1458 TOX_FILE_CONTROL_CANCEL
1467}; 1459} TOX_FILE_CONTROL;
1468typedef uint8_t TOX_FILE_CONTROL;
1469 1460
1470enum TOX_ERR_FILE_CONTROL { 1461
1462typedef enum TOX_ERR_FILE_CONTROL {
1471 TOX_ERR_FILE_CONTROL_OK, 1463 TOX_ERR_FILE_CONTROL_OK,
1472 /** 1464 /**
1473 * The friend_number passed did not designate a valid friend. 1465 * The friend_number passed did not designate a valid friend.
@@ -1494,8 +1486,7 @@ enum TOX_ERR_FILE_CONTROL {
1494 * A PAUSE control was sent, but the file transfer was already paused. 1486 * A PAUSE control was sent, but the file transfer was already paused.
1495 */ 1487 */
1496 TOX_ERR_FILE_CONTROL_ALREADY_PAUSED 1488 TOX_ERR_FILE_CONTROL_ALREADY_PAUSED
1497}; 1489} TOX_ERR_FILE_CONTROL;
1498typedef uint8_t TOX_ERR_FILE_CONTROL;
1499 1490
1500/** 1491/**
1501 * Sends a file control command to a friend for a given file transfer. 1492 * Sends a file control command to a friend for a given file transfer.
@@ -1541,7 +1532,7 @@ void tox_callback_file_control(Tox *tox, tox_file_control_cb *function, void *us
1541 ******************************************************************************/ 1532 ******************************************************************************/
1542 1533
1543 1534
1544enum TOX_ERR_FILE_SEND { 1535typedef enum TOX_ERR_FILE_SEND {
1545 TOX_ERR_FILE_SEND_OK, 1536 TOX_ERR_FILE_SEND_OK,
1546 TOX_ERR_FILE_SEND_NULL, 1537 TOX_ERR_FILE_SEND_NULL,
1547 /** 1538 /**
@@ -1565,8 +1556,7 @@ enum TOX_ERR_FILE_SEND {
1565 * is 256 per friend per direction (sending and receiving). 1556 * is 256 per friend per direction (sending and receiving).
1566 */ 1557 */
1567 TOX_ERR_FILE_SEND_TOO_MANY 1558 TOX_ERR_FILE_SEND_TOO_MANY
1568}; 1559} TOX_ERR_FILE_SEND;
1569typedef uint8_t TOX_ERR_FILE_SEND;
1570 1560
1571/** 1561/**
1572 * Send a file transmission request. 1562 * Send a file transmission request.
@@ -1627,7 +1617,7 @@ uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uin
1627 const uint8_t *filename, size_t filename_length, TOX_ERR_FILE_SEND *error); 1617 const uint8_t *filename, size_t filename_length, TOX_ERR_FILE_SEND *error);
1628 1618
1629 1619
1630enum TOX_ERR_FILE_SEND_CHUNK { 1620typedef enum TOX_ERR_FILE_SEND_CHUNK {
1631 TOX_ERR_FILE_SEND_CHUNK_OK, 1621 TOX_ERR_FILE_SEND_CHUNK_OK,
1632 /** 1622 /**
1633 * The length parameter was non-zero, but data was NULL. 1623 * The length parameter was non-zero, but data was NULL.
@@ -1651,8 +1641,7 @@ enum TOX_ERR_FILE_SEND_CHUNK {
1651 * the file. Trying to send more will result in no data being sent. 1641 * the file. Trying to send more will result in no data being sent.
1652 */ 1642 */
1653 TOX_ERR_FILE_SEND_CHUNK_TOO_LARGE 1643 TOX_ERR_FILE_SEND_CHUNK_TOO_LARGE
1654}; 1644} TOX_ERR_FILE_SEND_CHUNK;
1655typedef uint8_t TOX_ERR_FILE_SEND_CHUNK;
1656 1645
1657/** 1646/**
1658 * Send a chunk of file data to a friend. 1647 * Send a chunk of file data to a friend.
@@ -1790,7 +1779,7 @@ void tox_callback_file_receive_chunk(Tox *tox, tox_file_receive_chunk_cb *functi
1790 ******************************************************************************/ 1779 ******************************************************************************/
1791 1780
1792 1781
1793enum TOX_ERR_SEND_CUSTOM_PACKET { 1782typedef enum TOX_ERR_SEND_CUSTOM_PACKET {
1794 TOX_ERR_SEND_CUSTOM_PACKET_OK, 1783 TOX_ERR_SEND_CUSTOM_PACKET_OK,
1795 TOX_ERR_SEND_CUSTOM_PACKET_NULL, 1784 TOX_ERR_SEND_CUSTOM_PACKET_NULL,
1796 /** 1785 /**
@@ -1818,8 +1807,8 @@ enum TOX_ERR_SEND_CUSTOM_PACKET {
1818 * Send queue size exceeded. 1807 * Send queue size exceeded.
1819 */ 1808 */
1820 TOX_ERR_SEND_CUSTOM_PACKET_SENDQ 1809 TOX_ERR_SEND_CUSTOM_PACKET_SENDQ
1821}; 1810} TOX_ERR_SEND_CUSTOM_PACKET;
1822typedef uint8_t TOX_ERR_SEND_CUSTOM_PACKET; 1811
1823 1812
1824/** 1813/**
1825 * Send a custom lossy packet to a friend. 1814 * Send a custom lossy packet to a friend.
@@ -1918,14 +1907,13 @@ void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb
1918void tox_get_dht_id(const Tox *tox, uint8_t *dht_id); 1907void tox_get_dht_id(const Tox *tox, uint8_t *dht_id);
1919 1908
1920 1909
1921enum TOX_ERR_GET_PORT { 1910typedef enum TOX_ERR_GET_PORT {
1922 TOX_ERR_GET_PORT_OK, 1911 TOX_ERR_GET_PORT_OK,
1923 /** 1912 /**
1924 * The instance was not bound to any port. 1913 * The instance was not bound to any port.
1925 */ 1914 */
1926 TOX_ERR_GET_PORT_NOT_BOUND 1915 TOX_ERR_GET_PORT_NOT_BOUND
1927}; 1916} TOX_ERR_GET_PORT;
1928typedef uint8_t TOX_ERR_GET_PORT;
1929 1917
1930/** 1918/**
1931 * Return the UDP port this Tox instance is bound to. 1919 * Return the UDP port this Tox instance is bound to.