1 #ifndef SELF_H
2 #define SELF_H
3 
4 #include <tox/tox.h>
5 #include "native/image.h"
6 
7 typedef struct avatar AVATAR;
8 
9 #define TOX_ADDRESS_STR_SIZE TOX_ADDRESS_SIZE * 2
10 extern struct utox_self {
11     uint8_t status;
12     char    name[TOX_MAX_NAME_LENGTH];
13     char    statusmsg[TOX_MAX_STATUS_MESSAGE_LENGTH];
14     size_t  name_length, statusmsg_length;
15 
16     size_t friend_list_count;
17     size_t friend_list_size;
18 
19     size_t groups_list_count;
20     size_t groups_list_size;
21 
22     size_t device_list_count;
23     size_t device_list_size;
24 
25     char   id_str[TOX_ADDRESS_SIZE * 2];
26     size_t id_str_length;
27 
28     NATIVE_IMAGE *qr_image;
29     int qr_image_size;
30 
31     uint8_t *qr_data;
32     int qr_data_size;
33 
34     uint8_t id_binary[TOX_ADDRESS_SIZE];
35 
36     uint32_t nospam;
37     uint32_t old_nospam;
38     char nospam_str[(sizeof(uint32_t) * 2) + 1];
39 
40     AVATAR *avatar;
41     uint8_t *png_data;
42     size_t png_size;
43 } self;
44 
45 void init_self(Tox *tox);
46 
47 #endif
48