[ADD] Add basic Matrix ID parser

This commit is contained in:
LDA 2024-08-22 00:04:50 +02:00
commit 8042ccc0cc
8 changed files with 70 additions and 15 deletions

View file

@ -3,6 +3,21 @@
#include <Cytoplasm/Json.h>
/* A simple representation of everything. It is not as complex as
* Telodendria's CommonID parser, simply because Parsee does not
* need such complexity. */
typedef struct UserID {
/* We're being extra leinent. */
char localpart[256];
char server[256];
} UserID;
/** Parses a Matrix user ID, with no attention to detail.
* -----------
* Returns: a valid user ID[HEAP] | NULL
* Thrasher: Free */
extern UserID * MatrixParseID(char *user);
/* Creates an error message JSON, with the specified code and message. */
extern HashMap * MatrixCreateError(char *err, char *msg);