summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-08 14:28:38 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-08 19:13:23 +0000
commit465c9380ea6e18463998fb967a34917a984a5ee8 (patch)
treeb99953dcd7eec490cfd236e27aa3f399bb62aa03 /toxcore
parent2b49f803959cf47f81d1b49032f7c6f30ccc37f7 (diff)
Clarify the intent of "file kinds" in the API.
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/tox.api.h10
-rw-r--r--toxcore/tox.h10
2 files changed, 18 insertions, 2 deletions
diff --git a/toxcore/tox.api.h b/toxcore/tox.api.h
index f2c210e1..f3286bc5 100644
--- a/toxcore/tox.api.h
+++ b/toxcore/tox.api.h
@@ -1647,6 +1647,14 @@ static bool hash(uint8_t[HASH_LENGTH] hash, const uint8_t[length] data);
1647 1647
1648namespace file { 1648namespace file {
1649 1649
1650 /**
1651 * A list of pre-defined file kinds. Toxcore itself does not behave
1652 * differently for different file kinds. These are a hint to the client
1653 * telling it what use the sender intended for the file. The `kind` parameter
1654 * in the send function and recv callback are `uint32_t`, not $KIND, because
1655 * clients can invent their own file kind. Unknown file kinds should be
1656 * treated as ${KIND.DATA}.
1657 */
1650 enum KIND { 1658 enum KIND {
1651 /** 1659 /**
1652 * Arbitrary file data. Clients can choose to handle it based on the file name 1660 * Arbitrary file data. Clients can choose to handle it based on the file name
@@ -2031,7 +2039,7 @@ namespace file {
2031 * transfer request. 2039 * transfer request.
2032 * @param file_number The friend-specific file number the data received is 2040 * @param file_number The friend-specific file number the data received is
2033 * associated with. 2041 * associated with.
2034 * @param kind The meaning of the file to be sent. 2042 * @param kind The meaning of the file that was sent.
2035 * @param file_size Size in bytes of the file the client wants to send, 2043 * @param file_size Size in bytes of the file the client wants to send,
2036 * UINT64_MAX if unknown or streaming. 2044 * UINT64_MAX if unknown or streaming.
2037 * @param filename Name of the file. Does not need to be the actual name. This 2045 * @param filename Name of the file. Does not need to be the actual name. This
diff --git a/toxcore/tox.h b/toxcore/tox.h
index faf4e559..a5e79d63 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -1833,6 +1833,14 @@ void tox_callback_friend_message(Tox *tox, tox_friend_message_cb *callback);
1833 */ 1833 */
1834bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length); 1834bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length);
1835 1835
1836/**
1837 * A list of pre-defined file kinds. Toxcore itself does not behave
1838 * differently for different file kinds. These are a hint to the client
1839 * telling it what use the sender intended for the file. The `kind` parameter
1840 * in the send function and recv callback are `uint32_t`, not TOX_FILE_KIND, because
1841 * clients can invent their own file kind. Unknown file kinds should be
1842 * treated as TOX_FILE_KIND_DATA.
1843 */
1836enum TOX_FILE_KIND { 1844enum TOX_FILE_KIND {
1837 1845
1838 /** 1846 /**
@@ -2295,7 +2303,7 @@ void tox_callback_file_chunk_request(Tox *tox, tox_file_chunk_request_cb *callba
2295 * transfer request. 2303 * transfer request.
2296 * @param file_number The friend-specific file number the data received is 2304 * @param file_number The friend-specific file number the data received is
2297 * associated with. 2305 * associated with.
2298 * @param kind The meaning of the file to be sent. 2306 * @param kind The meaning of the file that was sent.
2299 * @param file_size Size in bytes of the file the client wants to send, 2307 * @param file_size Size in bytes of the file the client wants to send,
2300 * UINT64_MAX if unknown or streaming. 2308 * UINT64_MAX if unknown or streaming.
2301 * @param filename Name of the file. Does not need to be the actual name. This 2309 * @param filename Name of the file. Does not need to be the actual name. This