/* This file is part of the Zebra server.
- Copyright (C) 1995-2008 Index Data
+ Copyright (C) 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>
int before = 10;
int after = 1000;
char term[1000];
-
+
strcpy(term, "0");
dict_scan(dict, term, &before, &after, 0, dump_file_dict_func);
}
sprintf(tmppath, "%s%s", base, dst->path);
zebra_extract_file(zh, &dst->sysno, tmppath, action_delete);
strcpy(tmppath, dst->path);
- dst = dirs_read(di);
+ dst = dirs_read(di);
dirs_del(di, tmppath);
break;
case dirs_dir:
static void file_update_r(ZebraHandle zh,
struct dirs_info *di, struct dirs_entry *dst,
- const char *base, char *src,
+ const char *base, char *src,
int level)
{
struct dir_entry *e_src;
src[src_len] = '/';
src[++src_len] = '\0';
}
- dst = dirs_read(di);
+ dst = dirs_read(di);
}
dir_sort(e_src);
{
strcpy(src + src_len, e_src[i_src].name);
sprintf(tmppath, "%s%s", base, src);
-
+
switch(e_src[i_src].kind)
{
case dirs_file:
yaz_log(YLOG_DEBUG, "last is %s", dst ? dst->path : "null");
break;
default:
- dst = dirs_read(di);
+ dst = dirs_read(di);
}
i_src++;
}
{
case dirs_file:
if (zebra_extract_file(zh, &sysno, tmppath, action_update) == ZEBRA_OK)
- dirs_add(di, src, sysno, e_src[i_src].mtime);
+ dirs_add(di, src, sysno, e_src[i_src].mtime);
break;
case dirs_dir:
file_update_r(zh, di, dst, base, src, level+1);
if (ret == -1)
{
yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
- }
+ }
else if (S_ISREG(sbuf.st_mode))
{
struct dirs_entry *e_dst;
ZEBRA_RES zebra_remove_file_match(ZebraHandle zh)
{
Dict dict;
-
+
if (zebra_open_fmatch(zh, &dict) != ZEBRA_OK)
return ZEBRA_FAIL;
}
if (zebra_open_fmatch(zh, &dict) != ZEBRA_OK)
return ZEBRA_FAIL;
-
+
if (!strcmp(path, "") || !strcmp(path, "-"))
{
char src[1024];
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab