Skip to content

Commit 5c8aa65

Browse files
committed
docs: Update user data API explanation
There is no APIDSL so it shouldn't be mentioned, nor are there old style callbacks that take user data when registering them.
1 parent ad4921d commit 5c8aa65

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

toxcore/tox.h

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* SPDX-License-Identifier: GPL-3.0-or-later
2-
* Copyright © 2016-2018 The TokTok team.
2+
* Copyright © 2016-2024 The TokTok team.
33
* Copyright © 2013 Tox project.
44
*/
55

@@ -52,17 +52,9 @@
5252
* event listeners, it needs to implement the dispatch functionality itself.
5353
*
5454
* The last argument to a callback is the user data pointer. It is passed from
55-
* tox_iterate to each callback in sequence.
56-
*
57-
* The user data pointer is never stored or dereferenced by any library code, so
58-
* can be any pointer, including NULL. Callbacks must all operate on the same
59-
* object type. In the apidsl code (tox.in.h), this is denoted with `any`. The
60-
* `any` in tox_iterate must be the same `any` as in all callbacks. In C,
61-
* lacking parametric polymorphism, this is a pointer to void.
62-
*
63-
* Old style callbacks that are registered together with a user data pointer
64-
* receive that pointer as argument when they are called. They can each have
65-
* their own user data pointer of their own type.
55+
* tox_iterate to each callback in sequence. The user data pointer is never
56+
* stored or dereferenced by any library code, so can be any pointer, including
57+
* NULL.
6658
*
6759
* @section threading Threading implications
6860
*
@@ -1071,8 +1063,10 @@ void tox_callback_self_connection_status(Tox *tox, tox_self_connection_status_cb
10711063
uint32_t tox_iteration_interval(const Tox *tox);
10721064

10731065
/**
1074-
* @brief The main loop that needs to be run in intervals of `tox_iteration_interval()`
1075-
* milliseconds.
1066+
* @brief The main loop that needs to be run in intervals of
1067+
* `tox_iteration_interval()` milliseconds.
1068+
* @param user_data Any pointer a client wishes the Tox instance to pass into
1069+
* the event callbacks, including NULL.
10761070
*/
10771071
void tox_iterate(Tox *tox, void *user_data);
10781072

0 commit comments

Comments
 (0)