X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzebraapi.c;h=dda541fecff86a358034c63228440113a5abc4ef;hp=1cb58e657c8b7382f4a0c94411c93203fccda716;hb=4097bac1dce126e79ce1550fad8b2034a311ff80;hpb=0f22e8ea0099e3fbf082ebd37095000be7ff0c45 diff --git a/index/zebraapi.c b/index/zebraapi.c index 1cb58e6..dda541f 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.268 2007-12-18 13:55:28 adam Exp $ +/* $Id: zebraapi.c,v 1.269 2007-12-20 11:15:42 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -1929,22 +1929,33 @@ ZEBRA_RES zebra_end_transaction(ZebraHandle zh, ZebraTransactionStatus *status) ZEBRA_RES zebra_repository_update(ZebraHandle zh, const char *path) { - ASSERTZH; - assert(path); - yaz_log(log_level, "updating %s", path); - - if (zh->m_record_id && !strcmp(zh->m_record_id, "file")) - return zebra_update_file_match(zh, path); - else - return zebra_update_from_path(zh, path); + return zebra_repository_index(zh, path, action_update); } ZEBRA_RES zebra_repository_delete(ZebraHandle zh, const char *path) { + return zebra_repository_index(zh, path, action_delete); +} + +ZEBRA_RES zebra_repository_index(ZebraHandle zh, const char *path, + enum zebra_recctrl_action_t action) +{ ASSERTZH; assert(path); - yaz_log(log_level, "deleting %s", path); - return zebra_delete_from_path(zh, path); + + if (action == action_update) + yaz_log(log_level, "updating %s", path); + else if (action == action_delete) + yaz_log(log_level, "deleting %s", path); + else if (action == action_a_delete) + yaz_log(log_level, "attempt deleting %s", path); + else + yaz_log(log_level, "update action=%d", (int) action); + + if (zh->m_record_id && !strcmp(zh->m_record_id, "file")) + return zebra_update_file_match(zh, path); + else + return zebra_update_from_path(zh, path, action); } ZEBRA_RES zebra_repository_show(ZebraHandle zh, const char *path)