diff --git a/data.c b/data.c index eeda333..9f79c13 100644 --- a/data.c +++ b/data.c @@ -241,7 +241,7 @@ int index_add(const char *fn, const char *id) } -int index_del(const char *fn, const char *md5) +int index_del_md5(const char *fn, const char *md5) /* deletes an md5 from an index */ { int status = 404; @@ -279,6 +279,14 @@ int index_del(const char *fn, const char *md5) } +int index_del(const char *fn, const char *id) +/* deletes an id from an index */ +{ + xs *md5 = xs_md5_hex(id, strlen(id)); + return index_del_md5(fn, md5); +} + + int index_in_md5(const char *fn, const char *md5) /* checks if the md5 is already in the index */ {