forked from notsecure/uTox
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.h
88 lines (76 loc) · 2.06 KB
/
tox.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* todo: proper system for posting messages to the toxcore thread, comments, better names (?), proper cleanup of a/v and a/v thread*/
/* -proper unpause/pause file transfers, resuming file transfers + what if new file transfer with same id gets created before the main thread receives the message for the old one?
>= GiB file sizes with FILE_*_PROGRESS on 32bit */
/* details about messages and their (param1, param2, data) values are in the message handlers in tox.c*/
/* toxcore thread messages (send from the client thread)
*/
enum {
TOX_KILL,
TOX_SETNAME,
TOX_SETSTATUSMSG,
TOX_SETSTATUS,
TOX_ADDFRIEND,
TOX_DELFRIEND,
TOX_ACCEPTFRIEND,
TOX_SENDMESSAGE,
TOX_SENDMESSAGEGROUP,
TOX_CALL,
TOX_ACCEPTCALL,
TOX_HANGUP,
TOX_NEWGROUP,
TOX_LEAVEGROUP,
TOX_GROUPINVITE,
TOX_SENDFILES,
TOX_ACCEPTFILE,
TOX_FILE_IN_CANCEL,
TOX_FILE_OUT_CANCEL,
TOX_FILE_IN_PAUSE,
TOX_FILE_OUT_PAUSE,
TOX_FILE_IN_RESUME,
TOX_FILE_OUT_RESUME,
};
/* client thread messages (recieved by the client thread)
*/
enum {
/* general messages */
TOX_DONE,
DHT_CONNECTED,
DNS_RESULT,
/* friend related */
FRIEND_REQUEST,
FRIEND_ACCEPT,
FRIEND_ADD,
FRIEND_MESSAGE,
FRIEND_NAME,
FRIEND_STATUS_MESSAGE,
FRIEND_STATUS,
FRIEND_TYPING,
FRIEND_ONLINE,
/* friend a/v */
FRIEND_CALL_INVITE,
FRIEND_CALL_START,
FRIEND_CALL_RING,
FRIEND_CALL_END,
/* friend file */
FRIEND_FILE_IN_NEW,
FRIEND_FILE_OUT_NEW,
FRIEND_FILE_IN_STATUS,
FRIEND_FILE_OUT_STATUS,
FRIEND_FILE_IN_PROGRESS,
FRIEND_FILE_OUT_PROGRESS,
/* group */
GROUP_ADD,
GROUP_MESSAGE,
GROUP_PEER_ADD,
GROUP_PEER_DEL,
GROUP_PEER_NAME,
};
/* toxcore thread
*/
void tox_thread(void *args);
/* send a message to the toxcore thread
*/
void tox_postmessage(uint8_t msg, uint16_t param1, uint16_t param2, void *data);
/* read a message sent from the toxcore thread (sent with postmessage())
*/
void tox_message(uint8_t msg, uint16_t param1, uint16_t param2, void *data);