snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 5046531d43525cfd1ce16aeae840d8a33d2fb9c7
parent 93008cfc3e60b09e12fc3e1220602cab3a40b652
Author: default <nobody@localhost>
Date:   Wed, 12 Apr 2023 09:46:42 +0200

New functions object_ctime() and object_ctime_by_md5().

Diffstat:
Mdata.c | 14++++++++++++++
Msnac.h | 2++
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/data.c b/data.c @@ -658,6 +658,20 @@ int object_del_if_unref(const char *id) } +double object_ctime_by_md5(const char *md5) +{ + xs *fn = _object_fn_by_md5(md5); + return f_ctime(fn); +} + + +double object_ctime(const char *id) +{ + xs *md5 = xs_md5_hex(id, strlen(id)); + return object_ctime_by_md5(md5); +} + + d_char *_object_index_fn(const char *id, const char *idxsfx) /* returns the filename of an object's index */ { diff --git a/snac.h b/snac.h @@ -77,6 +77,8 @@ int object_get_by_md5(const char *md5, xs_dict **obj); int object_get(const char *id, xs_dict **obj); int object_del(const char *id); int object_del_if_unref(const char *id); +double object_ctime_by_md5(const char *md5); +double object_ctime(const char *id); int object_admire(const char *id, const char *actor, int like); int object_likes_len(const char *id);