From d43e8671acc5709c192e159e0d91626f0677cdf1 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 15 May 2023 18:47:59 +0200 Subject: Initial commit. Rudimentary readme, mockup examples without actual implementation, Makefile, Olm submodule --- src/matrix.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/matrix.h (limited to 'src/matrix.h') diff --git a/src/matrix.h b/src/matrix.h new file mode 100644 index 0000000..d61c59b --- /dev/null +++ b/src/matrix.h @@ -0,0 +1,50 @@ +#ifndef MATRIX__H +#define MATRIX__H + +#include +#include + +#include + + + + + +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 -- cgit v1.2.3