diff options
Diffstat (limited to 'snac.h')
| -rw-r--r-- | snac.h | 30 |
1 files changed, 22 insertions, 8 deletions
| @@ -24,7 +24,7 @@ double ftime(void); | |||
| 24 | void srv_debug(int level, d_char *str); | 24 | void srv_debug(int level, d_char *str); |
| 25 | #define srv_log(str) srv_debug(0, str) | 25 | #define srv_log(str) srv_debug(0, str) |
| 26 | 26 | ||
| 27 | int srv_open(char *basedir); | 27 | int srv_open(char *basedir, int auto_upgrade); |
| 28 | void srv_free(void); | 28 | void srv_free(void); |
| 29 | 29 | ||
| 30 | typedef struct _snac { | 30 | typedef struct _snac { |
| @@ -50,11 +50,21 @@ int check_password(char *uid, char *passwd, char *hash); | |||
| 50 | void srv_archive(char *direction, char *req, char *payload, int p_size, | 50 | void srv_archive(char *direction, char *req, char *payload, int p_size, |
| 51 | int status, char *headers, char *body, int b_size); | 51 | int status, char *headers, char *body, int b_size); |
| 52 | 52 | ||
| 53 | double mtime(char *fn); | 53 | double mtime_nl(const char *fn, int *n_link); |
| 54 | #define mtime(fn) mtime_nl(fn, NULL) | ||
| 54 | 55 | ||
| 55 | int follower_add(snac *snac, char *actor, char *msg); | 56 | int index_add(const char *fn, const char *md5); |
| 56 | int follower_del(snac *snac, char *actor); | 57 | int index_del(const char *fn, const char *md5); |
| 57 | int follower_check(snac *snac, char *actor); | 58 | int index_first(const char *fn, char *buf, int size); |
| 59 | d_char *index_list(const char *fn, int max); | ||
| 60 | d_char *index_list_desc(const char *fn, int max); | ||
| 61 | |||
| 62 | int object_del(const char *id); | ||
| 63 | int object_del_if_unref(const char *id); | ||
| 64 | |||
| 65 | int follower_add(snac *snac, const char *actor); | ||
| 66 | int follower_del(snac *snac, const char *actor); | ||
| 67 | int follower_check(snac *snac, const char *actor); | ||
| 58 | d_char *follower_list(snac *snac); | 68 | d_char *follower_list(snac *snac); |
| 59 | 69 | ||
| 60 | double timeline_mtime(snac *snac); | 70 | double timeline_mtime(snac *snac); |
| @@ -66,7 +76,8 @@ d_char *timeline_get(snac *snac, char *fn); | |||
| 66 | d_char *timeline_list(snac *snac, int max); | 76 | d_char *timeline_list(snac *snac, int max); |
| 67 | int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer); | 77 | int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer); |
| 68 | void timeline_admire(snac *snac, char *id, char *admirer, int like); | 78 | void timeline_admire(snac *snac, char *id, char *admirer, int like); |
| 69 | int timeline_hide(snac *snac, char *id, int hide); | 79 | |
| 80 | d_char *timeline_top_level(snac *snac, d_char *list); | ||
| 70 | 81 | ||
| 71 | d_char *local_list(snac *snac, int max); | 82 | d_char *local_list(snac *snac, int max); |
| 72 | 83 | ||
| @@ -80,8 +91,11 @@ void mute(snac *snac, char *actor); | |||
| 80 | void unmute(snac *snac, char *actor); | 91 | void unmute(snac *snac, char *actor); |
| 81 | int is_muted(snac *snac, char *actor); | 92 | int is_muted(snac *snac, char *actor); |
| 82 | 93 | ||
| 83 | int actor_add(snac *snac, char *actor, char *msg); | 94 | void hide(snac *snac, const char *id); |
| 84 | int actor_get(snac *snac, char *actor, d_char **data); | 95 | int is_hidden(snac *snac, const char *id); |
| 96 | |||
| 97 | int actor_add(snac *snac, const char *actor, d_char *msg); | ||
| 98 | int actor_get(snac *snac, const char *actor, d_char **data); | ||
| 85 | 99 | ||
| 86 | int static_get(snac *snac, const char *id, d_char **data, int *size); | 100 | int static_get(snac *snac, const char *id, d_char **data, int *size); |
| 87 | void static_put(snac *snac, const char *id, const char *data, int size); | 101 | void static_put(snac *snac, const char *id, const char *data, int size); |