-/* $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
repositoryShow (zh);
}
-int zebra_commit (ZebraHandle zh)
+static int zebra_commit_ex (ZebraHandle zh, int clean_only)
{
int seqno;
char val;
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++;
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;