summaryrefslogtreecommitdiff
path: root/testing/misc_tools.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-16 22:46:02 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-21 20:44:26 +0000
commit7245ac11ef9be2420c8356c12acc79f93ea211bb (patch)
treee971c5c6e10c2310afe4b2cd80212feac9839f2a /testing/misc_tools.h
parent7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (diff)
Avoid implementations in .h files or #including .c files.
Also, avoid the need for putting `_XOPEN_SOURCE` in every test file.
Diffstat (limited to 'testing/misc_tools.h')
-rw-r--r--testing/misc_tools.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/testing/misc_tools.h b/testing/misc_tools.h
new file mode 100644
index 00000000..deaa177d
--- /dev/null
+++ b/testing/misc_tools.h
@@ -0,0 +1,29 @@
1#ifndef C_TOXCORE_TESTING_MISC_TOOLS_H
2#define C_TOXCORE_TESTING_MISC_TOOLS_H
3
4#include "../toxcore/tox.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10// Amount of time in milliseconds to wait between tox_iterate calls.
11#define ITERATION_INTERVAL 200
12
13void c_sleep(uint32_t x);
14
15uint8_t *hex_string_to_bin(const char *hex_string);
16int tox_strncasecmp(const char *s1, const char *s2, size_t n);
17int cmdline_parsefor_ipv46(int argc, char **argv, uint8_t *ipv6enabled);
18
19void print_debug_log(Tox *m, TOX_LOG_LEVEL level, const char *file, uint32_t line, const char *func,
20 const char *message, void *user_data);
21
22Tox *tox_new_log(struct Tox_Options *options, TOX_ERR_NEW *err, void *log_user_data);
23Tox *tox_new_log_lan(struct Tox_Options *options, TOX_ERR_NEW *err, void *log_user_data, bool lan_discovery);
24
25#ifdef __cplusplus
26}
27#endif
28
29#endif