summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
diff options
context:
space:
mode:
authormichael bishop <cleverca22@gmail.com>2016-09-09 10:30:35 -0300
committermichael bishop <cleverca22@gmail.com>2016-09-10 01:09:37 -0300
commit05f474b4df8171412237f46c943822edd202b4a9 (patch)
tree7cf886de28682fe5d4c40de034c9ebfae75d3eae /toxcore/tox.c
parent406d292107f66a06f8db695645345b13ae8acc8b (diff)
make the majority of the callbacks stateless and add some status to a testcase
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r--toxcore/tox.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c
index 5a1103df..40746656 100644
--- a/toxcore/tox.c
+++ b/toxcore/tox.c
@@ -871,10 +871,10 @@ TOX_CONNECTION tox_friend_get_connection_status(const Tox *tox, uint32_t friend_
871 return ret; 871 return ret;
872} 872}
873 873
874void tox_callback_friend_connection_status(Tox *tox, tox_friend_connection_status_cb *callback, void *user_data) 874void tox_callback_friend_connection_status(Tox *tox, tox_friend_connection_status_cb *callback)
875{ 875{
876 Messenger *m = tox; 876 Messenger *m = tox;
877 m_callback_connectionstatus(m, callback, user_data); 877 m_callback_connectionstatus(m, callback);
878} 878}
879 879
880bool tox_friend_get_typing(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error) 880bool tox_friend_get_typing(const Tox *tox, uint32_t friend_number, TOX_ERR_FRIEND_QUERY *error)
@@ -1077,10 +1077,10 @@ bool tox_file_seek(Tox *tox, uint32_t friend_number, uint32_t file_number, uint6
1077 return 0; 1077 return 0;
1078} 1078}
1079 1079
1080void tox_callback_file_recv_control(Tox *tox, tox_file_recv_control_cb *callback, void *user_data) 1080void tox_callback_file_recv_control(Tox *tox, tox_file_recv_control_cb *callback)
1081{ 1081{
1082 Messenger *m = tox; 1082 Messenger *m = tox;
1083 callback_file_control(m, callback, user_data); 1083 callback_file_control(m, callback);
1084} 1084}
1085 1085
1086bool tox_file_get_file_id(const Tox *tox, uint32_t friend_number, uint32_t file_number, uint8_t *file_id, 1086bool tox_file_get_file_id(const Tox *tox, uint32_t friend_number, uint32_t file_number, uint8_t *file_id,
@@ -1199,22 +1199,22 @@ bool tox_file_send_chunk(Tox *tox, uint32_t friend_number, uint32_t file_number,
1199 return 0; 1199 return 0;
1200} 1200}
1201 1201
1202void tox_callback_file_chunk_request(Tox *tox, tox_file_chunk_request_cb *callback, void *user_data) 1202void tox_callback_file_chunk_request(Tox *tox, tox_file_chunk_request_cb *callback)
1203{ 1203{
1204 Messenger *m = tox; 1204 Messenger *m = tox;
1205 callback_file_reqchunk(m, callback, user_data); 1205 callback_file_reqchunk(m, callback);
1206} 1206}
1207 1207
1208void tox_callback_file_recv(Tox *tox, tox_file_recv_cb *callback, void *user_data) 1208void tox_callback_file_recv(Tox *tox, tox_file_recv_cb *callback)
1209{ 1209{
1210 Messenger *m = tox; 1210 Messenger *m = tox;
1211 callback_file_sendrequest(m, callback, user_data); 1211 callback_file_sendrequest(m, callback);
1212} 1212}
1213 1213
1214void tox_callback_file_recv_chunk(Tox *tox, tox_file_recv_chunk_cb *callback, void *user_data) 1214void tox_callback_file_recv_chunk(Tox *tox, tox_file_recv_chunk_cb *callback)
1215{ 1215{
1216 Messenger *m = tox; 1216 Messenger *m = tox;
1217 callback_file_data(m, callback, user_data); 1217 callback_file_data(m, callback);
1218} 1218}
1219 1219
1220static void set_custom_packet_error(int ret, TOX_ERR_FRIEND_CUSTOM_PACKET *error) 1220static void set_custom_packet_error(int ret, TOX_ERR_FRIEND_CUSTOM_PACKET *error)
@@ -1277,10 +1277,10 @@ bool tox_friend_send_lossy_packet(Tox *tox, uint32_t friend_number, const uint8_
1277 return 0; 1277 return 0;
1278} 1278}
1279 1279
1280void tox_callback_friend_lossy_packet(Tox *tox, tox_friend_lossy_packet_cb *callback, void *user_data) 1280void tox_callback_friend_lossy_packet(Tox *tox, tox_friend_lossy_packet_cb *callback)
1281{ 1281{
1282 Messenger *m = tox; 1282 Messenger *m = tox;
1283 custom_lossy_packet_registerhandler(m, callback, user_data); 1283 custom_lossy_packet_registerhandler(m, callback);
1284} 1284}
1285 1285
1286bool tox_friend_send_lossless_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length, 1286bool tox_friend_send_lossless_packet(Tox *tox, uint32_t friend_number, const uint8_t *data, size_t length,
@@ -1309,10 +1309,10 @@ bool tox_friend_send_lossless_packet(Tox *tox, uint32_t friend_number, const uin
1309 return 0; 1309 return 0;
1310} 1310}
1311 1311
1312void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb *callback, void *user_data) 1312void tox_callback_friend_lossless_packet(Tox *tox, tox_friend_lossless_packet_cb *callback)
1313{ 1313{
1314 Messenger *m = tox; 1314 Messenger *m = tox;
1315 custom_lossless_packet_registerhandler(m, callback, user_data); 1315 custom_lossless_packet_registerhandler(m, callback);
1316} 1316}
1317 1317
1318void tox_self_get_dht_id(const Tox *tox, uint8_t *dht_id) 1318void tox_self_get_dht_id(const Tox *tox, uint8_t *dht_id)