diff options
| -rw-r--r-- | data.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -203,7 +203,7 @@ d_char *_object_fn_by_md5(const char *md5) | |||
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | d_char *_object_fn_by_id(const char *id) | 206 | d_char *_object_fn(const char *id) |
| 207 | { | 207 | { |
| 208 | xs *md5 = xs_md5_hex(id, strlen(id)); | 208 | xs *md5 = xs_md5_hex(id, strlen(id)); |
| 209 | 209 | ||
| @@ -215,7 +215,7 @@ int object_get(const char *id, d_char **obj, const char *type) | |||
| 215 | /* returns a loaded object, optionally of the requested type */ | 215 | /* returns a loaded object, optionally of the requested type */ |
| 216 | { | 216 | { |
| 217 | int status = 404; | 217 | int status = 404; |
| 218 | xs *fn = _object_fn_by_id(id); | 218 | xs *fn = _object_fn(id); |
| 219 | FILE *f; | 219 | FILE *f; |
| 220 | 220 | ||
| 221 | if ((f = fopen(fn, "r")) != NULL) { | 221 | if ((f = fopen(fn, "r")) != NULL) { |
| @@ -253,7 +253,7 @@ int object_add(const char *id, d_char *obj) | |||
| 253 | /* stores an object */ | 253 | /* stores an object */ |
| 254 | { | 254 | { |
| 255 | int status = 201; /* Created */ | 255 | int status = 201; /* Created */ |
| 256 | xs *fn = _object_fn_by_id(id); | 256 | xs *fn = _object_fn(id); |
| 257 | FILE *f; | 257 | FILE *f; |
| 258 | 258 | ||
| 259 | if ((f = fopen(fn, "w")) != NULL) { | 259 | if ((f = fopen(fn, "w")) != NULL) { |
| @@ -277,7 +277,7 @@ int object_del(const char *id) | |||
| 277 | /* deletes an object */ | 277 | /* deletes an object */ |
| 278 | { | 278 | { |
| 279 | int status = 404; | 279 | int status = 404; |
| 280 | xs *fn = _object_fn_by_id(id); | 280 | xs *fn = _object_fn(id); |
| 281 | 281 | ||
| 282 | if (fn != NULL && unlink(fn) != -1) | 282 | if (fn != NULL && unlink(fn) != -1) |
| 283 | status = 200; | 283 | status = 200; |
| @@ -996,7 +996,7 @@ int actor_get(snac *snac, const char *actor, d_char **data) | |||
| 996 | if (data) | 996 | if (data) |
| 997 | *data = d; | 997 | *data = d; |
| 998 | 998 | ||
| 999 | xs *fn = _object_fn_by_id(actor); | 999 | xs *fn = _object_fn(actor); |
| 1000 | double max_time; | 1000 | double max_time; |
| 1001 | 1001 | ||
| 1002 | /* maximum time for the actor data to be considered stale */ | 1002 | /* maximum time for the actor data to be considered stale */ |