diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2017-04-16 05:57:21 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2017-04-22 15:31:25 -0400 |
commit | c7f63737ebfff2d1948ec9d6d92295a75d75cae5 (patch) | |
tree | ffaa46d8aecb53041ed61f6be73a4743fae6d4b1 /toxcore/tox.h | |
parent | 5ed37e543825c023163adba95b99ea81d3337196 (diff) |
Revert "Implement tox_loop"
This reverts commit 5ff099763b1f56414572e1c12eb2f003117db5a0.
Diffstat (limited to 'toxcore/tox.h')
-rw-r--r-- | toxcore/tox.h | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h index ab4ae7b1..0be019cd 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h | |||
@@ -991,42 +991,9 @@ uint32_t tox_iteration_interval(const Tox *tox); | |||
991 | void tox_iterate(Tox *tox, void *user_data); | 991 | void tox_iterate(Tox *tox, void *user_data); |
992 | 992 | ||
993 | /** | 993 | /** |
994 | * Error codes for tox_loop(). | 994 | * Run tox_iterate() any time a packet arrives, only returns after tox_loop_stop(). |
995 | */ | 995 | */ |
996 | typedef enum TOX_ERR_LOOP { | 996 | uint32_t tox_loop(Tox *tox, void *user_data); |
997 | |||
998 | /** | ||
999 | * The function returned successfully. | ||
1000 | */ | ||
1001 | TOX_ERR_LOOP_OK, | ||
1002 | |||
1003 | /** | ||
1004 | * Invalid arguments passed. | ||
1005 | */ | ||
1006 | TOX_ERR_LOOP_NULL, | ||
1007 | |||
1008 | /** | ||
1009 | * Failed running events dispatcher. | ||
1010 | */ | ||
1011 | TOX_ERR_LOOP_BREAK, | ||
1012 | |||
1013 | /** | ||
1014 | * Failed running select(). | ||
1015 | */ | ||
1016 | TOX_ERR_LOOP_SELECT, | ||
1017 | |||
1018 | /** | ||
1019 | * Failed getting sockets file descriptors. | ||
1020 | */ | ||
1021 | TOX_ERR_LOOP_GET_FDS, | ||
1022 | |||
1023 | } TOX_ERR_LOOP; | ||
1024 | |||
1025 | |||
1026 | /** | ||
1027 | * Run tox_iterate() any time a packet arrives, returns after tox_loop_stop() or tox_kill(). | ||
1028 | */ | ||
1029 | bool tox_loop(Tox *tox, void *user_data, TOX_ERR_LOOP *error); | ||
1030 | 997 | ||
1031 | /** | 998 | /** |
1032 | * Tell tox_loop() to return. | 999 | * Tell tox_loop() to return. |
@@ -1042,7 +1009,7 @@ typedef void tox_loop_begin_cb(Tox *tox, void *user_data); | |||
1042 | /** | 1009 | /** |
1043 | * Set the callback for the `loop_begin` event. Pass NULL to unset. | 1010 | * Set the callback for the `loop_begin` event. Pass NULL to unset. |
1044 | * | 1011 | * |
1045 | * This callback is invoked when tox_loop() calls into tox_iterate(), the client can lock a mutex here. | 1012 | * Callback ran when tox_loop() calls into tox_iterate(), the client can lock a mutex here. |
1046 | */ | 1013 | */ |
1047 | void tox_callback_loop_begin(Tox *tox, tox_loop_begin_cb *callback); | 1014 | void tox_callback_loop_begin(Tox *tox, tox_loop_begin_cb *callback); |
1048 | 1015 | ||
@@ -1055,7 +1022,7 @@ typedef void tox_loop_end_cb(Tox *tox, void *user_data); | |||
1055 | /** | 1022 | /** |
1056 | * Set the callback for the `loop_end` event. Pass NULL to unset. | 1023 | * Set the callback for the `loop_end` event. Pass NULL to unset. |
1057 | * | 1024 | * |
1058 | * This callback is invoked when tox_loop() is finished with tox_iterate(), the client can unlock the mutex here. | 1025 | * Callback ran when tox_loop() is finished with tox_iterate(), the client can unlock the mutex here. |
1059 | */ | 1026 | */ |
1060 | void tox_callback_loop_end(Tox *tox, tox_loop_end_cb *callback); | 1027 | void tox_callback_loop_end(Tox *tox, tox_loop_end_cb *callback); |
1061 | 1028 | ||