ref: 6c7016b5b7119d833af543fe5ad707b1b0db5c7e
dir: /masto9.h/
#define Contenttype "contenttype application/json" typedef struct Attachment { char *type; char *url; } Attachment; typedef struct Notification { char *id; char *type; char *handle; char *display_name; char *content; } Notification; typedef struct Toot { char *id; char *content; char *handle; char *display_name; char *avatar_url; char *in_reply_to_account_id; int reblogged; char *reblogged_handle; Attachment media_attachments[10]; int attachments_count; } Toot; typedef struct { char *s1; char *s2; } Str2; #pragma varargck type "E" Str2 enum { TOOTBUFSIZE = 8192, TLBUFSIZE = 512000, MAXURL = 1024, TOOTSCOUNT = 20, NOTIFSCOUNT = 40 }; JSON *mastodonget(char *token, char *host, char *endpoint); char *tootauthor(char *token, char *host, char *id); /* http */ char *httpget(char *token, char *url); char *httppost(char *token, char *url, char *text); /* utils */ char *concat(char *s1, char *s2); void *emalloc(ulong); char *estrdup(char*); char *estrjoin(char **strings, char *sep); char *esmprint(char*, ...); char *fslurp(int, int*); u32int strhash(char *); void removesubstring(char *, char *); void removetag(char *, char *); JSON *getjsonkey(JSON *, char *);