blob: d61c59ba61756be1797241acbcc3d8fb61b5fa17 (
plain)
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
|
#ifndef MATRIX__H
#define MATRIX__H
#include <stdbool.h>
#include <string.h>
#include <olm/olm.h>
typedef struct FixedBuffer {
void * ptr;
int size;
int len;
} FixedBuffer;
FixedBuffer
FixedBuf(const char * str);
#define ACCESS_TOKEN_LEN 20 // TODO: fix
typedef struct MatrixClient {
OlmAccount * olmAcc;
char accessToken[ACCESS_TOKEN_LEN];
} MatrixClient;
bool
MatrixClientInit(
MatrixClient * client,
FixedBuffer server
);
bool
MatrixClientLoginPassword(
MatrixClient * client,
FixedBuffer username,
FixedBuffer password
);
bool
MatrixClientGetAccessToken(
MatrixClient * client,
FixedBuffer * outBuffer
);
#endif
|