-/* $Id: update_file.c,v 1.6 2007-10-29 09:25:41 adam Exp $
- Copyright (C) 1995-2007
- Index Data ApS
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
{
case dirs_file:
sprintf(tmppath, "%s%s", base, dst->path);
- zebra_extract_file(zh, &dst->sysno, tmppath, 1);
-
+ zebra_extract_file(zh, &dst->sysno, tmppath, action_delete);
strcpy(tmppath, dst->path);
dst = dirs_read(di);
dirs_del(di, tmppath);
case dirs_file:
if (e_src[i_src].mtime > dst->mtime)
{
- if (zebra_extract_file(zh, &dst->sysno, tmppath, 0) == ZEBRA_OK)
+ if (zebra_extract_file(zh, &dst->sysno, tmppath, action_update) == ZEBRA_OK)
{
dirs_add(di, src, dst->sysno, e_src[i_src].mtime);
}
switch (e_src[i_src].kind)
{
case dirs_file:
- if (zebra_extract_file(zh, &sysno, tmppath, 0) == ZEBRA_OK)
+ if (zebra_extract_file(zh, &sysno, tmppath, action_update) == ZEBRA_OK)
dirs_add(di, src, sysno, e_src[i_src].mtime);
break;
case dirs_dir:
switch (dst->kind)
{
case dirs_file:
- zebra_extract_file(zh, &dst->sysno, tmppath, 1);
+ zebra_extract_file(zh, &dst->sysno, tmppath, action_delete);
dirs_del(di, dst->path);
dst = dirs_read(di);
break;
if (e_dst)
{
if (sbuf.st_mtime > e_dst->mtime)
- if (zebra_extract_file(zh, &e_dst->sysno, src, 0) == ZEBRA_OK)
+ if (zebra_extract_file(zh, &e_dst->sysno, src, action_update) == ZEBRA_OK)
dirs_add(di, src, e_dst->sysno, sbuf.st_mtime);
}
else
{
zint sysno = 0;
- if (zebra_extract_file(zh, &sysno, src, 0) == ZEBRA_OK)
+ if (zebra_extract_file(zh, &sysno, src, action_update) == ZEBRA_OK)
dirs_add(di, src, sysno, sbuf.st_mtime);
}
dirs_free(&di);
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab