-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtypes.h
46 lines (37 loc) · 838 Bytes
/
qtypes.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
#ifndef __QLIC_TYPES_H
#define __QLIC_TYPES_H
#include <stddef.h>
#include <qstr.h>
#include <time.h>
typedef size_t (*qlic_response_callback)(char*, size_t, size_t, void*);
// 128 so it aligns properly
// TODO make the struct packed
/* attribute(__packed__) */
typedef struct qlicstate {
char grant_token[128];
char access_token[128];
char refresh_token[128];
time_t time_generated;
} qlicstate_t;
typedef struct qlicconfig {
qstr client_id;
qstr client_secret;
} qlicconfig_t;
typedef enum QlicErrorCode {
QLIC_ERROR = 0,
QLIC_OK
} QlicErrorCode;
struct QlicCliqAction {
char* request_url;
size_t request_url_len;
qlic_response_callback callback;
};
/**
* Holds network information for the current request
*/
typedef struct qliccontext {
/* cURL ctx */
void* context;
qstr request_url;
} qliccontext_t;
#endif