X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fzebraapi.c;h=2a43bc90edcf26aeaa919fa390ae57a6916ff281;hb=ff239404c4969d04388c7af260c5c7c11e82fd67;hp=01c6433d4d5b58a1ded9d918914e1c13a3ec45ad;hpb=52551bf774d771a0422a401946fd0c5ee3788f34;p=idzebra-moved-to-github.git diff --git a/index/zebraapi.c b/index/zebraapi.c index 01c6433..2a43bc9 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.93 2003-03-13 04:25:17 pop Exp $ +/* $Id: zebraapi.c,v 1.95 2003-03-26 00:02:05 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps @@ -1389,7 +1389,7 @@ void zebra_repository_show (ZebraHandle zh) repositoryShow (zh); } -int zebra_commit (ZebraHandle zh) +static int zebra_commit_ex (ZebraHandle zh, int clean_only) { int seqno; char val; @@ -1422,13 +1422,18 @@ int zebra_commit (ZebraHandle zh) bf_cache (bfs, rval); if (bf_commitExists (bfs)) { - zebra_set_state (zh, 'c', seqno); - - logf (LOG_LOG, "commit start"); - bf_commitExec (bfs); + if (clean_only) + zebra_set_state (zh, 'd', seqno); + else + { + zebra_set_state (zh, 'c', seqno); + + logf (LOG_LOG, "commit start"); + bf_commitExec (bfs); #ifndef WIN32 - sync (); + sync (); #endif + } logf (LOG_LOG, "commit clean"); bf_commitClean (bfs, rval); seqno++; @@ -1445,6 +1450,16 @@ int zebra_commit (ZebraHandle zh) return 0; } +int zebra_clean (ZebraHandle zh) +{ + return zebra_commit_ex(zh, 1); +} + +int zebra_commit (ZebraHandle zh) +{ + return zebra_commit_ex(zh, 0); +} + int zebra_init (ZebraHandle zh) { const char *rval;