diff options
author | default <nobody@localhost> | 2023-08-19 09:31:13 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-08-19 09:31:13 +0200 |
commit | 5de1a9ce0cbdda0ded72a51660130327636eb699 (patch) | |
tree | 59265f2e9dc5fb8abb43e45a8a23ef3f5dfeaa4e /data.c | |
parent | 46cfc37f2bfe03baa4d6feadf7155483c8797459 (diff) |
Rewritten history_get() prototype to match static_get().
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1681,18 +1681,23 @@ void history_add(snac *snac, const char *id, const char *content, int size) } -xs_str *history_get(snac *snac, const char *id) +int history_get(snac *snac, const char *id, xs_str **content, int *size, + const char *inm, xs_str **etag) { - xs_str *content = NULL; xs *fn = _history_fn(snac, id); FILE *f; + int status = 404; if (fn && (f = fopen(fn, "r")) != NULL) { - content = xs_readall(f); + *content = xs_readall(f); fclose(f); + + *size = strlen(*content); + + status = 200; } - return content; + return status; } |