diff options
author | default <nobody@localhost> | 2022-10-16 18:03:28 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-10-16 18:03:28 +0200 |
commit | d9a15b8af7da2bc27d4d55ee745242f5b4e39071 (patch) | |
tree | f890fe2b2f0a327f08da31404fd267c675fac690 /data.c | |
parent | 0d79e465e6f01e51c5ddf26b40096e608b506d9b (diff) |
Attachments are now starting to get real.
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -805,14 +805,14 @@ int actor_get(snac *snac, char *actor, d_char **data) } -d_char *_static_fn(snac *snac, char *id) +d_char *_static_fn(snac *snac, const char *id) /* gets the filename for a static file */ { return xs_fmt("%s/static/%s", snac->basedir, id); } -int static_get(snac *snac, char *id, d_char **data, int *size) +int static_get(snac *snac, const char *id, d_char **data, int *size) /* returns static content */ { xs *fn = _static_fn(snac, id); @@ -830,6 +830,19 @@ int static_get(snac *snac, char *id, d_char **data, int *size) } +void static_put(snac *snac, const char *id, const char *data, int size) +/* writes status content */ +{ + xs *fn = _static_fn(snac, id); + FILE *f; + + if ((f = fopen(fn, "wb")) != NULL) { + fwrite(data, size, 1, f); + fclose(f); + } +} + + d_char *_history_fn(snac *snac, char *id) /* gets the filename for the history */ { |