diff options
author | irungentoo <irungentoo@gmail.com> | 2013-10-08 18:55:35 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-10-08 18:55:35 -0400 |
commit | 4aa507b664a457e323011b2f37657c8327057366 (patch) | |
tree | db7160349ad5380e0e81f239db0f6327d4ed2d95 /toxcore/tox.h | |
parent | 3658c372a4b23489e70299361b35af86a41b94ce (diff) |
Added function to get the piece size for sending files.
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index 3594b1c1..db4e6b57 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -435,7 +435,7 @@ int tox_group_message_send(Tox *tox, int groupnumber, uint8_t *message, uint32_t | |||
435 | * HOW TO SEND FILES CORRECTLY: | 435 | * HOW TO SEND FILES CORRECTLY: |
436 | * 1. Use tox_new_filesender(...) to create a new file sender. | 436 | * 1. Use tox_new_filesender(...) to create a new file sender. |
437 | * 2. Wait for the callback set with tox_callback_file_control(...) to be called with receive_send == 1 and control_type == TOX_FILECONTROL_ACCEPT | 437 | * 2. Wait for the callback set with tox_callback_file_control(...) to be called with receive_send == 1 and control_type == TOX_FILECONTROL_ACCEPT |
438 | * 3. Send the data with tox_file_senddata(...) | 438 | * 3. Send the data with tox_file_senddata(...) with chunk size tox_filedata_size(...) |
439 | * 4. When sending is done, send a tox_file_sendcontrol(...) with send_receive = 0 and message_id = TOX_FILECONTROL_FINISHED | 439 | * 4. When sending is done, send a tox_file_sendcontrol(...) with send_receive = 0 and message_id = TOX_FILECONTROL_FINISHED |
440 | * | 440 | * |
441 | * HOW TO RECEIVE FILES CORRECTLY: | 441 | * HOW TO RECEIVE FILES CORRECTLY: |
@@ -508,6 +508,13 @@ int tox_file_sendcontrol(Tox *tox, int friendnumber, uint8_t send_receive, uint8 | |||
508 | */ | 508 | */ |
509 | int tox_file_senddata(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length); | 509 | int tox_file_senddata(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t *data, uint16_t length); |
510 | 510 | ||
511 | /* Returns the recommended/maximum size of the filedata you send with tox_file_senddata() | ||
512 | * | ||
513 | * return size on success | ||
514 | * return 0 on failure (currently will never return 0) | ||
515 | */ | ||
516 | int tox_filedata_size(Tox *tox, int friendnumber); | ||
517 | |||
511 | /* Give the number of bytes left to be sent/received. | 518 | /* Give the number of bytes left to be sent/received. |
512 | * | 519 | * |
513 | * send_receive is 0 if we want the sending files, 1 if we want the receiving. | 520 | * send_receive is 0 if we want the sending files, 1 if we want the receiving. |