mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Renamed tox_file_send_control to tox_file_control.
Renamed tox_file_send_seek to tox_file_seek.
This commit is contained in:
parent
8c2347222a
commit
b0983104d5
|
@ -151,30 +151,30 @@ void tox_file_receive(Tox *tox, uint32_t friend_number, uint32_t file_number, ui
|
|||
|
||||
TOX_ERR_FILE_SEEK err_s;
|
||||
|
||||
if (!tox_file_send_seek(tox, friend_number, file_number, 1337, &err_s)) {
|
||||
ck_abort_msg("tox_file_send_seek error");
|
||||
if (!tox_file_seek(tox, friend_number, file_number, 1337, &err_s)) {
|
||||
ck_abort_msg("tox_file_seek error");
|
||||
}
|
||||
|
||||
ck_assert_msg(err_s == TOX_ERR_FILE_SEEK_OK, "tox_file_send_seek wrong error");
|
||||
ck_assert_msg(err_s == TOX_ERR_FILE_SEEK_OK, "tox_file_seek wrong error");
|
||||
} else {
|
||||
sending_pos = size_recv = 0;
|
||||
}
|
||||
|
||||
TOX_ERR_FILE_CONTROL error;
|
||||
|
||||
if (tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, &error)) {
|
||||
if (tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, &error)) {
|
||||
++file_accepted;
|
||||
} else {
|
||||
ck_abort_msg("tox_file_send_control failed. %i", error);
|
||||
ck_abort_msg("tox_file_control failed. %i", error);
|
||||
}
|
||||
|
||||
TOX_ERR_FILE_SEEK err_s;
|
||||
|
||||
if (tox_file_send_seek(tox, friend_number, file_number, 1234, &err_s)) {
|
||||
ck_abort_msg("tox_file_send_seek no error");
|
||||
if (tox_file_seek(tox, friend_number, file_number, 1234, &err_s)) {
|
||||
ck_abort_msg("tox_file_seek no error");
|
||||
}
|
||||
|
||||
ck_assert_msg(err_s == TOX_ERR_FILE_SEEK_DENIED, "tox_file_send_seek wrong error");
|
||||
ck_assert_msg(err_s == TOX_ERR_FILE_SEEK_DENIED, "tox_file_seek wrong error");
|
||||
}
|
||||
|
||||
uint32_t sendf_ok;
|
||||
|
|
|
@ -1133,7 +1133,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
|
|||
{
|
||||
if (type != TOX_FILE_KIND_DATA) {
|
||||
new_lines("Refused invalid file type.");
|
||||
tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1141,7 +1141,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
|
|||
sprintf(msg, "[t] %u is sending us: %s of size %llu", friend_number, filename, (long long unsigned int)file_size);
|
||||
new_lines(msg);
|
||||
|
||||
if (tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) {
|
||||
if (tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) {
|
||||
sprintf(msg, "Accepted file transfer. (saving file as: %u.%u.bin)", friend_number, file_number);
|
||||
new_lines(msg);
|
||||
} else
|
||||
|
|
|
@ -129,7 +129,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
|
|||
{
|
||||
if (type != TOX_FILE_KIND_DATA) {
|
||||
printf("Refused invalid file type.");
|
||||
tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -151,7 +151,7 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
|
|||
|
||||
if (tempfile != 0) {
|
||||
fclose(tempfile);
|
||||
tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -159,11 +159,11 @@ void file_request_accept(Tox *tox, uint32_t friend_number, uint32_t file_number,
|
|||
file_recv[file_index].file = fopen(fullpath, "wb");
|
||||
|
||||
if (file_recv[file_index].file == 0) {
|
||||
tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_CANCEL, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tox_file_send_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) {
|
||||
if (tox_file_control(tox, friend_number, file_number, TOX_FILE_CONTROL_RESUME, 0)) {
|
||||
printf("Accepted file transfer. (file: %s)\n", fullpath);
|
||||
}
|
||||
|
||||
|
|
|
@ -845,8 +845,8 @@ bool tox_hash(uint8_t *hash, const uint8_t *data, size_t length)
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool tox_file_send_control(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_CONTROL control,
|
||||
TOX_ERR_FILE_CONTROL *error)
|
||||
bool tox_file_control(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_CONTROL control,
|
||||
TOX_ERR_FILE_CONTROL *error)
|
||||
{
|
||||
Messenger *m = tox;
|
||||
int ret = file_control(m, friend_number, file_number, control);
|
||||
|
@ -894,8 +894,8 @@ bool tox_file_send_control(Tox *tox, uint32_t friend_number, uint32_t file_numbe
|
|||
return 0;
|
||||
}
|
||||
|
||||
bool tox_file_send_seek(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
||||
TOX_ERR_FILE_SEEK *error)
|
||||
bool tox_file_seek(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
||||
TOX_ERR_FILE_SEEK *error)
|
||||
{
|
||||
Messenger *m = tox;
|
||||
int ret = file_seek(m, friend_number, file_number, position);
|
||||
|
|
|
@ -1489,8 +1489,8 @@ typedef enum TOX_ERR_FILE_CONTROL {
|
|||
*
|
||||
* @return true on success.
|
||||
*/
|
||||
bool tox_file_send_control(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_CONTROL control,
|
||||
TOX_ERR_FILE_CONTROL *error);
|
||||
bool tox_file_control(Tox *tox, uint32_t friend_number, uint32_t file_number, TOX_FILE_CONTROL control,
|
||||
TOX_ERR_FILE_CONTROL *error);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -1555,8 +1555,8 @@ typedef enum TOX_ERR_FILE_SEEK {
|
|||
* @param file_number The friend-specific identifier for the file transfer.
|
||||
* @param position The position that the file should be seeked to.
|
||||
*/
|
||||
bool tox_file_send_seek(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
||||
TOX_ERR_FILE_SEEK *error);
|
||||
bool tox_file_seek(Tox *tox, uint32_t friend_number, uint32_t file_number, uint64_t position,
|
||||
TOX_ERR_FILE_SEEK *error);
|
||||
|
||||
typedef enum TOX_ERR_FILE_GET {
|
||||
TOX_ERR_FILE_GET_OK,
|
||||
|
|
Loading…
Reference in New Issue
Block a user