diff options
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index a3973ae9..2506779e 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -344,7 +344,7 @@ struct Tox_Options { | |||
344 | * | 344 | * |
345 | * This member is ignored (it can be NULL) if proxy_enabled is false. | 345 | * This member is ignored (it can be NULL) if proxy_enabled is false. |
346 | */ | 346 | */ |
347 | char const *proxy_address; | 347 | const char *proxy_address; |
348 | 348 | ||
349 | /** | 349 | /** |
350 | * The port to use to connect to the proxy server. | 350 | * The port to use to connect to the proxy server. |
@@ -474,7 +474,7 @@ typedef uint8_t TOX_ERR_NEW; | |||
474 | * | 474 | * |
475 | * @see tox_iteration for the event loop. | 475 | * @see tox_iteration for the event loop. |
476 | */ | 476 | */ |
477 | Tox *tox_new(struct Tox_Options const *options, uint8_t const *data, size_t length, TOX_ERR_NEW *error); | 477 | Tox *tox_new(const struct Tox_Options *options, const uint8_t *data, size_t length, TOX_ERR_NEW *error); |
478 | 478 | ||
479 | 479 | ||
480 | /** | 480 | /** |
@@ -493,7 +493,7 @@ void tox_kill(Tox *tox); | |||
493 | * | 493 | * |
494 | * @see threading for concurrency implications. | 494 | * @see threading for concurrency implications. |
495 | */ | 495 | */ |
496 | size_t tox_save_size(Tox const *tox); | 496 | size_t tox_save_size(const Tox *tox); |
497 | 497 | ||
498 | /** | 498 | /** |
499 | * Store all information associated with the tox instance to a byte array. | 499 | * Store all information associated with the tox instance to a byte array. |
@@ -502,7 +502,7 @@ size_t tox_save_size(Tox const *tox); | |||
502 | * Call tox_save_size to find the number of bytes required. If this parameter | 502 | * Call tox_save_size to find the number of bytes required. If this parameter |
503 | * is NULL, this function has no effect. | 503 | * is NULL, this function has no effect. |
504 | */ | 504 | */ |
505 | void tox_save(Tox const *tox, uint8_t *data); | 505 | void tox_save(const Tox *tox, uint8_t *data); |
506 | 506 | ||
507 | 507 | ||
508 | /******************************************************************************* | 508 | /******************************************************************************* |
@@ -546,7 +546,7 @@ typedef uint8_t TOX_ERR_BOOTSTRAP; | |||
546 | * (TOX_PUBLIC_KEY_SIZE bytes). | 546 | * (TOX_PUBLIC_KEY_SIZE bytes). |
547 | * @return true on success. | 547 | * @return true on success. |
548 | */ | 548 | */ |
549 | bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, TOX_ERR_BOOTSTRAP *error); | 549 | bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error); |
550 | 550 | ||
551 | 551 | ||
552 | /** | 552 | /** |
@@ -562,7 +562,7 @@ bool tox_bootstrap(Tox *tox, char const *address, uint16_t port, uint8_t const * | |||
562 | * (TOX_PUBLIC_KEY_SIZE bytes). | 562 | * (TOX_PUBLIC_KEY_SIZE bytes). |
563 | * @return true on success. | 563 | * @return true on success. |
564 | */ | 564 | */ |
565 | bool tox_add_tcp_relay(Tox *tox, char const *address, uint16_t port, uint8_t const *public_key, | 565 | bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, |
566 | TOX_ERR_BOOTSTRAP *error); | 566 | TOX_ERR_BOOTSTRAP *error); |
567 | 567 | ||
568 | 568 | ||
@@ -592,7 +592,7 @@ typedef uint8_t TOX_CONNECTION; | |||
592 | * 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 |
593 | * last value received through the `connection_status` callback. | 593 | * last value received through the `connection_status` callback. |
594 | */ | 594 | */ |
595 | TOX_CONNECTION tox_get_connection_status(Tox const *tox); | 595 | TOX_CONNECTION tox_get_connection_status(const Tox *tox); |
596 | 596 | ||
597 | /** | 597 | /** |
598 | * The function type for the `connection_status` callback. | 598 | * The function type for the `connection_status` callback. |
@@ -620,7 +620,7 @@ void tox_callback_connection_status(Tox *tox, tox_connection_status_cb *function | |||
620 | * Return the time in milliseconds before tox_iteration() should be called again | 620 | * Return the time in milliseconds before tox_iteration() should be called again |
621 | * for optimal performance. | 621 | * for optimal performance. |
622 | */ | 622 | */ |
623 | uint32_t tox_iteration_interval(Tox const *tox); | 623 | uint32_t tox_iteration_interval(const Tox *tox); |
624 | 624 | ||
625 | 625 | ||
626 | /** | 626 | /** |
@@ -646,7 +646,7 @@ void tox_iteration(Tox *tox); | |||
646 | * parameter is NULL, this function has no effect. | 646 | * parameter is NULL, this function has no effect. |
647 | * @see TOX_ADDRESS_SIZE for the address format. | 647 | * @see TOX_ADDRESS_SIZE for the address format. |
648 | */ | 648 | */ |
649 | void tox_self_get_address(Tox const *tox, uint8_t *address); | 649 | void tox_self_get_address(const Tox *tox, uint8_t *address); |
650 | 650 | ||
651 | 651 | ||
652 | /** | 652 | /** |
@@ -659,7 +659,7 @@ void tox_self_set_nospam(Tox *tox, uint32_t nospam); | |||
659 | /** | 659 | /** |
660 | * Get the 4-byte nospam part of the address. | 660 | * Get the 4-byte nospam part of the address. |
661 | */ | 661 | */ |
662 | uint32_t tox_self_get_nospam(Tox const *tox); | 662 | uint32_t tox_self_get_nospam(const Tox *tox); |
663 | 663 | ||
664 | /** | 664 | /** |
665 | * Copy the Tox Public Key (long term public key) from the Tox object. | 665 | * Copy the Tox Public Key (long term public key) from the Tox object. |
@@ -667,7 +667,7 @@ uint32_t tox_self_get_nospam(Tox const *tox); | |||
667 | * @param public_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If | 667 | * @param public_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If |
668 | * this parameter is NULL, this function has no effect. | 668 | * this parameter is NULL, this function has no effect. |
669 | */ | 669 | */ |
670 | void tox_self_get_public_key(Tox const *tox, uint8_t *public_key); | 670 | void tox_self_get_public_key(const Tox *tox, uint8_t *public_key); |
671 | 671 | ||
672 | /** | 672 | /** |
673 | * Copy the private key from the Tox object. | 673 | * Copy the private key from the Tox object. |
@@ -675,7 +675,7 @@ void tox_self_get_public_key(Tox const *tox, uint8_t *public_key); | |||
675 | * @param private_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If | 675 | * @param private_key A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If |
676 | * this parameter is NULL, this function has no effect. | 676 | * this parameter is NULL, this function has no effect. |
677 | */ | 677 | */ |
678 | void tox_self_get_private_key(Tox const *tox, uint8_t *private_key); | 678 | void tox_self_get_private_key(const Tox *tox, uint8_t *private_key); |
679 | 679 | ||
680 | 680 | ||
681 | /******************************************************************************* | 681 | /******************************************************************************* |
@@ -710,7 +710,7 @@ typedef uint8_t TOX_ERR_SET_INFO; | |||
710 | * | 710 | * |
711 | * @return true on success. | 711 | * @return true on success. |
712 | */ | 712 | */ |
713 | bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET_INFO *error); | 713 | bool tox_self_set_name(Tox *tox, const uint8_t *name, size_t length, TOX_ERR_SET_INFO *error); |
714 | 714 | ||
715 | /** | 715 | /** |
716 | * Return the length of the current nickname as passed to tox_self_set_name. | 716 | * Return the length of the current nickname as passed to tox_self_set_name. |
@@ -720,7 +720,7 @@ bool tox_self_set_name(Tox *tox, uint8_t const *name, size_t length, TOX_ERR_SET | |||
720 | * | 720 | * |
721 | * @see threading for concurrency implications. | 721 | * @see threading for concurrency implications. |
722 | */ | 722 | */ |
723 | size_t tox_self_get_name_size(Tox const *tox); | 723 | size_t tox_self_get_name_size(const Tox *tox); |
724 | 724 | ||
725 | /** | 725 | /** |
726 | * Write the nickname set by tox_self_set_name to a byte array. | 726 | * Write the nickname set by tox_self_set_name to a byte array. |
@@ -734,7 +734,7 @@ size_t tox_self_get_name_size(Tox const *tox); | |||
734 | * @param name A valid memory location large enough to hold the nickname. | 734 | * @param name A valid memory location large enough to hold the nickname. |
735 | * If this parameter is NULL, the function has no effect. | 735 | * If this parameter is NULL, the function has no effect. |
736 | */ | 736 | */ |
737 | void tox_self_get_name(Tox const *tox, uint8_t *name); | 737 | void tox_self_get_name(const Tox *tox, uint8_t *name); |
738 | 738 | ||
739 | /** | 739 | /** |
740 | * Set the client's status message. | 740 | * Set the client's status message. |
@@ -743,7 +743,7 @@ void tox_self_get_name(Tox const *tox, uint8_t *name); | |||
743 | * length is 0, the status parameter is ignored (it can be NULL), and the | 743 | * length is 0, the status parameter is ignored (it can be NULL), and the |
744 | * user status is set back to empty. | 744 | * user status is set back to empty. |
745 | */ | 745 | */ |
746 | bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length, TOX_ERR_SET_INFO *error); | 746 | bool tox_self_set_status_message(Tox *tox, const uint8_t *status, size_t length, TOX_ERR_SET_INFO *error); |
747 | 747 | ||
748 | /** | 748 | /** |
749 | * Return the length of the current status message as passed to | 749 | * Return the length of the current status message as passed to |
@@ -754,7 +754,7 @@ bool tox_self_set_status_message(Tox *tox, uint8_t const *status, size_t length, | |||
754 | * | 754 | * |
755 | * @see threading for concurrency implications. | 755 | * @see threading for concurrency implications. |
756 | */ | 756 | */ |
757 | size_t tox_self_get_status_message_size(Tox const *tox); | 757 | size_t tox_self_get_status_message_size(const Tox *tox); |
758 | 758 | ||
759 | /** | 759 | /** |
760 | * Write the status message set by tox_self_set_status_message to a byte array. | 760 | * Write the status message set by tox_self_set_status_message to a byte array. |
@@ -768,7 +768,7 @@ size_t tox_self_get_status_message_size(Tox const *tox); | |||
768 | * @param status A valid memory location large enough to hold the status message. | 768 | * @param status A valid memory location large enough to hold the status message. |
769 | * If this parameter is NULL, the function has no effect. | 769 | * If this parameter is NULL, the function has no effect. |
770 | */ | 770 | */ |
771 | void tox_self_get_status_message(Tox const *tox, uint8_t *status); | 771 | void tox_self_get_status_message(const Tox *tox, uint8_t *status); |
772 | 772 | ||
773 | 773 | ||
774 | /** | 774 | /** |
@@ -781,7 +781,7 @@ void tox_self_set_status(Tox *tox, TOX_STATUS user_status); | |||
781 | /** | 781 | /** |
782 | * Returns the client's user status. | 782 | * Returns the client's user status. |
783 | */ | 783 | */ |
784 | TOX_STATUS tox_self_get_status(Tox const *tox); | 784 | TOX_STATUS tox_self_get_status(const Tox *tox); |
785 | 785 | ||
786 | 786 | ||
787 | /******************************************************************************* | 787 | /******************************************************************************* |
@@ -850,7 +850,7 @@ typedef uint8_t TOX_ERR_FRIEND_ADD; | |||
850 | * | 850 | * |
851 | * @return the friend number on success, UINT32_MAX on failure. | 851 | * @return the friend number on success, UINT32_MAX on failure. |
852 | */ | 852 | */ |
853 | uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message, size_t length, | 853 | uint32_t tox_friend_add(Tox *tox, const uint8_t *address, const uint8_t *message, size_t length, |
854 | TOX_ERR_FRIEND_ADD *error); | 854 | TOX_ERR_FRIEND_ADD *error); |
855 | 855 | ||
856 | 856 | ||
@@ -872,7 +872,7 @@ uint32_t tox_friend_add(Tox *tox, uint8_t const *address, uint8_t const *message | |||
872 | * @return the friend number on success, UINT32_MAX on failure. | 872 | * @return the friend number on success, UINT32_MAX on failure. |
873 | * @see tox_friend_add for a more detailed description of friend numbers. | 873 | * @see tox_friend_add for a more detailed description of friend numbers. |
874 | */ | 874 | */ |
875 | uint32_t tox_friend_add_norequest(Tox *tox, uint8_t const *public_key, TOX_ERR_FRIEND_ADD *error); | 875 | uint32_t tox_friend_add_norequest(Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_ADD *error); |
876 | 876 | ||
877 | 877 | ||
878 | enum TOX_ERR_FRIEND_DELETE { | 878 | enum TOX_ERR_FRIEND_DELETE { |
@@ -921,7 +921,7 @@ typedef uint8_t TOX_ERR_FRIEND_BY_PUBLIC_KEY; | |||
921 | * @return the friend number on success, UINT32_MAX on failure. | 921 | * @return the friend number on success, UINT32_MAX on failure. |
922 | * @param public_key A byte array containing the Public Key. | 922 | * @param public_key A byte array containing the Public Key. |
923 | */ | 923 | */ |
924 | uint32_t tox_friend_by_public_key(Tox const *tox, uint8_t const *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); | 924 | uint32_t tox_friend_by_public_key(const Tox *tox, const uint8_t *public_key, TOX_ERR_FRIEND_BY_PUBLIC_KEY *error); |
925 | 925 | ||
926 | 926 | ||
927 | enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { | 927 | enum TOX_ERR_FRIEND_GET_PUBLIC_KEY { |
@@ -943,7 +943,7 @@ typedef uint8_t TOX_ERR_FRIEND_GET_PUBLIC_KEY; | |||
943 | * | 943 | * |
944 | * @return true on success. | 944 | * @return true on success. |
945 | */ | 945 | */ |
946 | bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t *public_key, | 946 | bool tox_friend_get_public_key(const Tox *tox, uint32_t friend_number, uint8_t *public_key, |
947 | TOX_ERR_FRIEND_GET_PUBLIC_KEY *error); | 947 | TOX_ERR_FRIEND_GET_PUBLIC_KEY *error); |
948 | 948 | ||
949 | 949 | ||
@@ -951,7 +951,7 @@ bool tox_friend_get_public_key(Tox const *tox, uint32_t friend_number, uint8_t * | |||
951 | * Checks if a friend with the given friend number exists and returns true if | 951 | * Checks if a friend with the given friend number exists and returns true if |
952 | * it does. | 952 | * it does. |
953 | */ | 953 | */ |
954 | bool tox_friend_exists(Tox const *tox, uint32_t friend_number); | 954 | bool tox_friend_exists(const Tox *tox, uint32_t friend_number); |
955 | 955 | ||
956 | 956 | ||
957 | /** | 957 | /** |
@@ -960,7 +960,7 @@ bool tox_friend_exists(Tox const *tox, uint32_t friend_number); | |||
960 | * This function can be used to determine how much memory to allocate for | 960 | * This function can be used to determine how much memory to allocate for |
961 | * tox_friend_list. | 961 | * tox_friend_list. |
962 | */ | 962 | */ |
963 | size_t tox_friend_list_size(Tox const *tox); | 963 | size_t tox_friend_list_size(const Tox *tox); |
964 | 964 | ||
965 | 965 | ||
966 | /** | 966 | /** |
@@ -971,7 +971,7 @@ size_t tox_friend_list_size(Tox const *tox); | |||
971 | * @param list A memory region with enough space to hold the friend list. If | 971 | * @param list A memory region with enough space to hold the friend list. If |
972 | * this parameter is NULL, this function has no effect. | 972 | * this parameter is NULL, this function has no effect. |
973 | */ | 973 | */ |
974 | void tox_friend_list(Tox const *tox, uint32_t *list); | 974 | void tox_friend_list(const Tox *tox, uint32_t *list); |
975 | 975 | ||
976 | 976 | ||
977 | 977 | ||
@@ -1007,7 +1007,7 @@ typedef uint8_t TOX_ERR_FRIEND_QUERY; | |||
1007 | * The return value is equal to the `length` argument received by the last | 1007 | * The return value is equal to the `length` argument received by the last |
1008 | * `friend_name` callback. | 1008 | * `friend_name` callback. |
1009 | */ | 1009 | */ |
1010 | size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1010 | size_t tox_friend_get_name_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1011 | 1011 | ||
1012 | /** | 1012 | /** |
1013 | * Write the name of the friend designated by the given friend number to a byte | 1013 | * Write the name of the friend designated by the given friend number to a byte |
@@ -1023,7 +1023,7 @@ size_t tox_friend_get_name_size(Tox const *tox, uint32_t friend_number, TOX_ERR_ | |||
1023 | * | 1023 | * |
1024 | * @return true on success. | 1024 | * @return true on success. |
1025 | */ | 1025 | */ |
1026 | bool tox_friend_get_name(Tox const *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error); | 1026 | bool tox_friend_get_name(const Tox *tox, uint32_t friend_number, uint8_t *name, TOX_ERR_FRIEND_QUERY *error); |
1027 | 1027 | ||
1028 | /** | 1028 | /** |
1029 | * The function type for the `friend_name` callback. | 1029 | * The function type for the `friend_name` callback. |
@@ -1034,7 +1034,7 @@ bool tox_friend_get_name(Tox const *tox, uint32_t friend_number, uint8_t *name, | |||
1034 | * @param length A value equal to the return value of | 1034 | * @param length A value equal to the return value of |
1035 | * tox_friend_get_name_size. | 1035 | * tox_friend_get_name_size. |
1036 | */ | 1036 | */ |
1037 | typedef void tox_friend_name_cb(Tox *tox, uint32_t friend_number, uint8_t const *name, size_t length, void *user_data); | 1037 | typedef void tox_friend_name_cb(Tox *tox, uint32_t friend_number, const uint8_t *name, size_t length, void *user_data); |
1038 | 1038 | ||
1039 | /** | 1039 | /** |
1040 | * Set the callback for the `friend_name` event. Pass NULL to unset. | 1040 | * Set the callback for the `friend_name` event. Pass NULL to unset. |
@@ -1048,7 +1048,7 @@ void tox_callback_friend_name(Tox *tox, tox_friend_name_cb *function, void *user | |||
1048 | * Return the length of the friend's status message. If the friend number is | 1048 | * Return the length of the friend's status message. If the friend number is |
1049 | * invalid, the return value is SIZE_MAX. | 1049 | * invalid, the return value is SIZE_MAX. |
1050 | */ | 1050 | */ |
1051 | size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1051 | size_t tox_friend_get_status_message_size(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1052 | 1052 | ||
1053 | /** | 1053 | /** |
1054 | * Write the name of the friend designated by the given friend number to a byte | 1054 | * Write the name of the friend designated by the given friend number to a byte |
@@ -1062,7 +1062,7 @@ size_t tox_friend_get_status_message_size(Tox const *tox, uint32_t friend_number | |||
1062 | * | 1062 | * |
1063 | * @param name A valid memory region large enough to store the friend's name. | 1063 | * @param name A valid memory region large enough to store the friend's name. |
1064 | */ | 1064 | */ |
1065 | bool tox_friend_get_status_message(Tox const *tox, uint32_t friend_number, uint8_t *message, | 1065 | bool tox_friend_get_status_message(const Tox *tox, uint32_t friend_number, uint8_t *message, |
1066 | TOX_ERR_FRIEND_QUERY *error); | 1066 | TOX_ERR_FRIEND_QUERY *error); |
1067 | 1067 | ||
1068 | /** | 1068 | /** |
@@ -1075,7 +1075,7 @@ bool tox_friend_get_status_message(Tox const *tox, uint32_t friend_number, uint8 | |||
1075 | * @param length A value equal to the return value of | 1075 | * @param length A value equal to the return value of |
1076 | * tox_friend_get_status_message_size. | 1076 | * tox_friend_get_status_message_size. |
1077 | */ | 1077 | */ |
1078 | typedef void tox_friend_status_message_cb(Tox *tox, uint32_t friend_number, uint8_t const *message, size_t length, | 1078 | typedef void tox_friend_status_message_cb(Tox *tox, uint32_t friend_number, const uint8_t *message, size_t length, |
1079 | void *user_data); | 1079 | void *user_data); |
1080 | 1080 | ||
1081 | /** | 1081 | /** |
@@ -1093,7 +1093,7 @@ void tox_callback_friend_status_message(Tox *tox, tox_friend_status_message_cb * | |||
1093 | * The status returned is equal to the last status received through the | 1093 | * The status returned is equal to the last status received through the |
1094 | * `friend_status` callback. | 1094 | * `friend_status` callback. |
1095 | */ | 1095 | */ |
1096 | TOX_STATUS tox_friend_get_status(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1096 | TOX_STATUS tox_friend_get_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1097 | 1097 | ||
1098 | /** | 1098 | /** |
1099 | * The function type for the `friend_status` callback. | 1099 | * The function type for the `friend_status` callback. |
@@ -1124,7 +1124,7 @@ void tox_callback_friend_status(Tox *tox, tox_friend_status_cb *function, void * | |||
1124 | * @return the friend's connection status as it was received through the | 1124 | * @return the friend's connection status as it was received through the |
1125 | * `friend_connection_status` event. | 1125 | * `friend_connection_status` event. |
1126 | */ | 1126 | */ |
1127 | TOX_CONNECTION tox_friend_get_connection_status(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1127 | TOX_CONNECTION tox_friend_get_connection_status(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1128 | 1128 | ||
1129 | /** | 1129 | /** |
1130 | * The function type for the `friend_connection_status` callback. | 1130 | * The function type for the `friend_connection_status` callback. |
@@ -1159,7 +1159,7 @@ void tox_callback_friend_connection_status(Tox *tox, tox_friend_connection_statu | |||
1159 | * @return false if the friend is not typing, or the friend number was | 1159 | * @return false if the friend is not typing, or the friend number was |
1160 | * invalid. Inspect the error code to determine which case it is. | 1160 | * invalid. Inspect the error code to determine which case it is. |
1161 | */ | 1161 | */ |
1162 | bool tox_friend_get_typing(Tox const *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); | 1162 | bool tox_friend_get_typing(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error); |
1163 | 1163 | ||
1164 | /** | 1164 | /** |
1165 | * The function type for the `friend_typing` callback. | 1165 | * The function type for the `friend_typing` callback. |
@@ -1251,7 +1251,7 @@ typedef uint8_t TOX_ERR_SEND_MESSAGE; | |||
1251 | * incremented by 1 each time a message is sent. If UINT32_MAX messages were | 1251 | * incremented by 1 each time a message is sent. If UINT32_MAX messages were |
1252 | * sent, the next message ID is 0. | 1252 | * sent, the next message ID is 0. |
1253 | */ | 1253 | */ |
1254 | uint32_t tox_send_message(Tox *tox, uint32_t friend_number, uint8_t const *message, size_t length, | 1254 | uint32_t tox_send_message(Tox *tox, uint32_t friend_number, const uint8_t *message, size_t length, |
1255 | TOX_ERR_SEND_MESSAGE *error); | 1255 | TOX_ERR_SEND_MESSAGE *error); |
1256 | 1256 | ||
1257 | 1257 | ||
@@ -1266,7 +1266,7 @@ uint32_t tox_send_message(Tox *tox, uint32_t friend_number, uint8_t const *messa | |||
1266 | * | 1266 | * |
1267 | * @see tox_send_message for more details. | 1267 | * @see tox_send_message for more details. |
1268 | */ | 1268 | */ |
1269 | uint32_t tox_send_action(Tox *tox, uint32_t friend_number, uint8_t const *action, size_t length, | 1269 | uint32_t tox_send_action(Tox *tox, uint32_t friend_number, const uint8_t *action, size_t length, |
1270 | TOX_ERR_SEND_MESSAGE *error); | 1270 | TOX_ERR_SEND_MESSAGE *error); |
1271 | 1271 | ||
1272 | 1272 | ||
@@ -1310,7 +1310,7 @@ void tox_callback_read_receipt(Tox *tox, tox_read_receipt_cb *function, void *us | |||
1310 | * @param message The message they sent along with the request. | 1310 | * @param message The message they sent along with the request. |
1311 | * @param length The size of the message byte array. | 1311 | * @param length The size of the message byte array. |
1312 | */ | 1312 | */ |
1313 | typedef void tox_friend_request_cb(Tox *tox, uint8_t const *public_key, /*uint32_t time_delta, */uint8_t const *message, | 1313 | typedef void tox_friend_request_cb(Tox *tox, const uint8_t *public_key, /*uint32_t time_delta, */const uint8_t *message, |
1314 | size_t length, void *user_data); | 1314 | size_t length, void *user_data); |
1315 | 1315 | ||
1316 | /** | 1316 | /** |
@@ -1331,7 +1331,7 @@ void tox_callback_friend_request(Tox *tox, tox_friend_request_cb *function, void | |||
1331 | * | 1331 | * |
1332 | * @see tox_friend_request_cb for more information on time_delta. | 1332 | * @see tox_friend_request_cb for more information on time_delta. |
1333 | */ | 1333 | */ |
1334 | typedef void tox_friend_message_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */uint8_t const *message, | 1334 | typedef void tox_friend_message_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */const uint8_t *message, |
1335 | size_t length, void *user_data); | 1335 | size_t length, void *user_data); |
1336 | 1336 | ||
1337 | /** | 1337 | /** |
@@ -1352,7 +1352,7 @@ void tox_callback_friend_message(Tox *tox, tox_friend_message_cb *function, void | |||
1352 | * | 1352 | * |
1353 | * @see tox_friend_request_cb for more information on time_delta. | 1353 | * @see tox_friend_request_cb for more information on time_delta. |
1354 | */ | 1354 | */ |
1355 | typedef void tox_friend_action_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */uint8_t const *action, | 1355 | typedef void tox_friend_action_cb(Tox *tox, uint32_t friend_number, /*uint32_t time_delta, */const uint8_t *action, |
1356 | size_t length, void *user_data); | 1356 | size_t length, void *user_data); |
1357 | 1357 | ||
1358 | /** | 1358 | /** |
@@ -1416,7 +1416,7 @@ typedef uint8_t TOX_FILE_KIND; | |||
1416 | * | 1416 | * |
1417 | * @return true if hash was not NULL. | 1417 | * @return true if hash was not NULL. |
1418 | */ | 1418 | */ |
1419 | bool tox_hash(uint8_t *hash, uint8_t const *data, size_t length); | 1419 | bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length); |
1420 | 1420 | ||
1421 | 1421 | ||
1422 | enum TOX_FILE_CONTROL { | 1422 | enum TOX_FILE_CONTROL { |
@@ -1597,7 +1597,7 @@ typedef uint8_t TOX_ERR_FILE_SEND; | |||
1597 | * number is per friend. File numbers are reused after a transfer terminates. | 1597 | * number is per friend. File numbers are reused after a transfer terminates. |
1598 | */ | 1598 | */ |
1599 | uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uint64_t file_size, | 1599 | uint32_t tox_file_send(Tox *tox, uint32_t friend_number, TOX_FILE_KIND kind, uint64_t file_size, |
1600 | uint8_t const *filename, size_t filename_length, TOX_ERR_FILE_SEND *error); | 1600 | const uint8_t *filename, size_t filename_length, TOX_ERR_FILE_SEND *error); |
1601 | 1601 | ||
1602 | 1602 | ||
1603 | enum TOX_ERR_FILE_SEND_CHUNK { | 1603 | enum TOX_ERR_FILE_SEND_CHUNK { |
@@ -1640,7 +1640,7 @@ typedef uint8_t TOX_ERR_FILE_SEND_CHUNK; | |||
1640 | * | 1640 | * |
1641 | * @return true on success. | 1641 | * @return true on success. |
1642 | */ | 1642 | */ |
1643 | bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number, uint8_t const *data, size_t length, | 1643 | bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number, const uint8_t *data, size_t length, |
1644 | TOX_ERR_FILE_SEND_CHUNK *error); | 1644 | TOX_ERR_FILE_SEND_CHUNK *error); |
1645 | 1645 | ||
1646 | 1646 | ||
@@ -1702,7 +1702,7 @@ void tox_callback_file_request_chunk(Tox *tox, tox_file_request_chunk_cb *functi | |||
1702 | * associated with. | 1702 | * associated with. |
1703 | */ | 1703 | */ |
1704 | typedef void tox_file_receive_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_KIND kind, | 1704 | typedef void tox_file_receive_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_KIND kind, |
1705 | uint64_t file_size, uint8_t const *filename, size_t filename_length, void *user_data); | 1705 | uint64_t file_size, const uint8_t *filename, size_t filename_length, void *user_data); |
1706 | 1706 | ||
1707 | /** | 1707 | /** |
1708 | * Set the callback for the `file_receive` event. Pass NULL to unset. | 1708 | * Set the callback for the `file_receive` event. Pass NULL to unset. |
@@ -1734,7 +1734,7 @@ void tox_callback_file_receive(Tox *tox, tox_file_receive_cb *function, void *us | |||
1734 | * @param length The length of the received chunk. | 1734 | * @param length The length of the received chunk. |
1735 | */ | 1735 | */ |
1736 | typedef void tox_file_receive_chunk_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position, | 1736 | typedef void tox_file_receive_chunk_cb(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position, |
1737 | uint8_t const *data, size_t length, void *user_data); | 1737 | const uint8_t *data, size_t length, void *user_data); |
1738 | 1738 | ||
1739 | /** | 1739 | /** |
1740 | * Set the callback for the `file_receive_chunk` event. Pass NULL to unset. | 1740 | * Set the callback for the `file_receive_chunk` event. Pass NULL to unset. |
@@ -1814,7 +1814,7 @@ typedef uint8_t TOX_ERR_SEND_CUSTOM_PACKET; | |||
1814 | * | 1814 | * |
1815 | * @return true on success. | 1815 | * @return true on success. |
1816 | */ | 1816 | */ |
1817 | bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, | 1817 | bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length, |
1818 | TOX_ERR_SEND_CUSTOM_PACKET *error); | 1818 | TOX_ERR_SEND_CUSTOM_PACKET *error); |
1819 | 1819 | ||
1820 | /** | 1820 | /** |
@@ -1824,7 +1824,7 @@ bool tox_send_lossy_packet(Tox *tox, uint32_t friend_number, uint8_t const *data | |||
1824 | * @param data A byte array containing the received packet data. | 1824 | * @param data A byte array containing the received packet data. |
1825 | * @param length The length of the packet data byte array. | 1825 | * @param length The length of the packet data byte array. |
1826 | */ | 1826 | */ |
1827 | typedef void tox_friend_lossy_packet_cb(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, | 1827 | typedef void tox_friend_lossy_packet_cb(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length, |
1828 | void *user_data); | 1828 | void *user_data); |
1829 | 1829 | ||
1830 | /** | 1830 | /** |
@@ -1849,7 +1849,7 @@ void tox_callback_friend_lossy_packet(Tox *tox, tox_friend_lossy_packet_cb *func | |||
1849 | * | 1849 | * |
1850 | * @return true on success. | 1850 | * @return true on success. |
1851 | */ | 1851 | */ |
1852 | bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, | 1852 | bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length, |
1853 | TOX_ERR_SEND_CUSTOM_PACKET *error); | 1853 | TOX_ERR_SEND_CUSTOM_PACKET *error); |
1854 | 1854 | ||
1855 | /** | 1855 | /** |
@@ -1859,7 +1859,7 @@ bool tox_send_lossless_packet(Tox *tox, uint32_t friend_number, uint8_t const *d | |||
1859 | * @param data A byte array containing the received packet data. | 1859 | * @param data A byte array containing the received packet data. |
1860 | * @param length The length of the packet data byte array. | 1860 | * @param length The length of the packet data byte array. |
1861 | */ | 1861 | */ |
1862 | typedef void tox_friend_lossless_packet_cb(Tox *tox, uint32_t friend_number, uint8_t const *data, size_t length, | 1862 | typedef void tox_friend_lossless_packet_cb(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length, |
1863 | void *user_data); | 1863 | void *user_data); |
1864 | 1864 | ||
1865 | /** | 1865 | /** |
@@ -1888,7 +1888,7 @@ void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb | |||
1888 | * @param dht_id A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If this | 1888 | * @param dht_id A memory region of at least TOX_PUBLIC_KEY_SIZE bytes. If this |
1889 | * parameter is NULL, this function has no effect. | 1889 | * parameter is NULL, this function has no effect. |
1890 | */ | 1890 | */ |
1891 | void tox_get_dht_id(Tox const *tox, uint8_t *dht_id); | 1891 | void tox_get_dht_id(const Tox *tox, uint8_t *dht_id); |
1892 | 1892 | ||
1893 | 1893 | ||
1894 | enum TOX_ERR_GET_PORT { | 1894 | enum TOX_ERR_GET_PORT { |
@@ -1903,13 +1903,13 @@ typedef uint8_t TOX_ERR_GET_PORT; | |||
1903 | /** | 1903 | /** |
1904 | * Return the UDP port this Tox instance is bound to. | 1904 | * Return the UDP port this Tox instance is bound to. |
1905 | */ | 1905 | */ |
1906 | uint16_t tox_get_udp_port(Tox const *tox, TOX_ERR_GET_PORT *error); | 1906 | uint16_t tox_get_udp_port(const Tox *tox, TOX_ERR_GET_PORT *error); |
1907 | 1907 | ||
1908 | /** | 1908 | /** |
1909 | * Return the TCP port this Tox instance is bound to. This is only relevant if | 1909 | * Return the TCP port this Tox instance is bound to. This is only relevant if |
1910 | * the instance is acting as a TCP relay. | 1910 | * the instance is acting as a TCP relay. |
1911 | */ | 1911 | */ |
1912 | uint16_t tox_get_tcp_port(Tox const *tox, TOX_ERR_GET_PORT *error); | 1912 | uint16_t tox_get_tcp_port(const Tox *tox, TOX_ERR_GET_PORT *error); |
1913 | 1913 | ||
1914 | 1914 | ||
1915 | #ifdef __cplusplus | 1915 | #ifdef __cplusplus |