snac2/snac.h

52 lines
1.4 KiB
C
Raw Normal View History

2022-09-19 19:13:40 +00:00
/* snac - A simple, minimalistic ActivityPub instance */
2022-09-19 18:47:22 +00:00
/* copyright (c) 2022 grunfink - MIT license */
2022-09-19 19:13:40 +00:00
extern d_char *srv_basedir;
extern d_char *srv_config;
extern d_char *srv_baseurl;
extern int dbglevel;
2022-09-19 19:24:55 +00:00
d_char *xs_time(char *fmt, int local);
#define xs_local_time(fmt) xs_time(fmt, 1)
#define xs_utc_time(fmt) xs_time(fmt, 0)
d_char *tid(void);
2022-09-19 19:30:19 +00:00
void srv_debug(int level, d_char *str);
#define srv_log(str) srv_debug(0, str)
2022-09-19 19:13:40 +00:00
int srv_open(char *basedir);
typedef struct _snac {
d_char *uid; /* uid */
d_char *basedir; /* user base directory */
d_char *config; /* user configuration */
d_char *key; /* keypair */
d_char *actor; /* actor url */
} snac;
2022-09-19 21:03:18 +00:00
int user_open(snac *snac, char *uid);
void user_free(snac *snac);
2022-09-19 21:33:11 +00:00
d_char *user_list(void);
void snac_debug(snac *snac, int level, d_char *str);
#define snac_log(snac, str) snac_debug(snac, 0, str)
2022-09-19 20:41:30 +00:00
int validate_uid(char *uid);
d_char *hash_password(char *uid, char *passwd, char *nonce);
int check_password(char *uid, char *passwd, char *hash);
2022-09-20 07:48:13 +00:00
float mtime(char *fn);
int follower_add(snac *snac, char *actor, char *msg);
int follower_del(snac *snac, char *actor);
int follower_check(snac *snac, char *actor);
d_char *follower_list(snac *snac);
2022-09-20 08:02:00 +00:00
2022-09-20 08:49:24 +00:00
d_char *timeline_find(snac *snac, char *id);
2022-09-20 08:02:00 +00:00
void timeline_del(snac *snac, char *id);
2022-09-20 08:49:24 +00:00
d_char *timeline_get(snac *snac, char *fn);
d_char *timeline_list(snac *snac);