diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -288,6 +288,25 @@ int object_del(const char *id) | |||
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | 290 | ||
| 291 | int list_add_md5(const char *fn, const char *md5) | ||
| 292 | /* adds an md5 to a list */ | ||
| 293 | { | ||
| 294 | int status = 200; | ||
| 295 | FILE *f; | ||
| 296 | |||
| 297 | if ((f = fopen(fn, "a")) != NULL) { | ||
| 298 | flock(fileno(f), LOCK_EX); | ||
| 299 | |||
| 300 | fprintf(f, "%s\n", md5); | ||
| 301 | fclose(f); | ||
| 302 | } | ||
| 303 | else | ||
| 304 | status = 500; | ||
| 305 | |||
| 306 | return status; | ||
| 307 | } | ||
| 308 | |||
| 309 | |||
| 291 | d_char *_follower_fn(snac *snac, char *actor) | 310 | d_char *_follower_fn(snac *snac, char *actor) |
| 292 | { | 311 | { |
| 293 | xs *md5 = xs_md5_hex(actor, strlen(actor)); | 312 | xs *md5 = xs_md5_hex(actor, strlen(actor)); |