X-Git-Url: https://gitweb.ps.run/matrix_esp_thesis/blobdiff_plain/71b13552379398dafcbc8fa8347d119a8984f448..c1547dd3565f979d08a9e8e9eec8f42956e6901c:/src/matrix.h diff --git a/src/matrix.h b/src/matrix.h index d37474f..cd109ce 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -18,36 +18,49 @@ typedef struct MatrixClient { - void * httpUserData; OlmAccount * olmAccount; OlmSession * olmSession; - char server[SERVER_SIZE]; int serverLen; - char accessTokenBuffer[ACCESS_TOKEN_SIZE]; int accessTokenLen; - char deviceIdBuffer[DEVICE_ID_SIZE]; int deviceIdLen; - char expireMsBuffer[EXPIRE_MS_SIZE]; int expireMsLen; - char refreshTokenBuffer[REFRESH_TOKEN_SIZE]; int refreshTokenLen; + + char server[SERVER_SIZE]; + char accessTokenBuffer[ACCESS_TOKEN_SIZE]; + char deviceIdBuffer[DEVICE_ID_SIZE]; + char expireMsBuffer[EXPIRE_MS_SIZE]; + char refreshTokenBuffer[REFRESH_TOKEN_SIZE]; + + void * httpUserData; } MatrixClient; bool MatrixClientInit( MatrixClient * client, - char * server, int serverLen -); + const char * server); bool MatrixClientLoginPassword( MatrixClient * client, - char * username, int usernameLen, - char * password, int passwordLen, - char * displayName, int displayNameLen -); + const char * username, + const char * password, + const char * displayName); + +bool +MatrixHttpInit( + MatrixClient * client); + +bool +MatrixHttpDeinit( + MatrixClient * client); + +bool +MatrixHttpGet( + MatrixClient * client, + const char * url, + char * outResponseBuffer, int outResponseCap); bool MatrixHttpPost( MatrixClient * client, const char * url, - char * requestBuffer, int requestLen, - char * outResponseBuffer, int outResponseCap, int * outResponseLen -); + const char * requestBuffer, + char * outResponseBuffer, int outResponseCap); #endif