-/* $Id: zebraidx.c,v 1.8 2007-10-23 12:39:48 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) 1995-2008 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
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
#ifdef WIN32
#else
sprintf(nbuf, "%.40s(%ld)", *argv, (long) getpid());
#ifdef WIN32
#else
sprintf(nbuf, "%.40s(%ld)", *argv, (long) getpid());
"Commands:\n"
" update <dir> Update index with files below <dir>.\n"
" If <dir> is empty filenames are read from stdin.\n"
"Commands:\n"
" update <dir> Update index with files below <dir>.\n"
" If <dir> is empty filenames are read from stdin.\n"
" -f <n> Display information for the first <n> records.\n"
" -V Show version.\n", *argv
);
" -f <n> Display information for the first <n> records.\n"
" -V Show version.\n", *argv
);
}
res_set(default_res, "profilePath", DEFAULT_PROFILE_PATH);
res_set(default_res, "modulePath", DEFAULT_MODULE_PATH);
}
res_set(default_res, "profilePath", DEFAULT_PROFILE_PATH);
res_set(default_res, "modulePath", DEFAULT_MODULE_PATH);
- zh = zebra_open (zs, 0);
- zebra_shadow_enable (zh, enable_commit);
+ zh = zebra_open(zs, 0);
+ zebra_shadow_enable(zh, enable_commit);
{
yaz_log(YLOG_FATAL, "Could not select database %s "
"errCode=%d",
database, zebra_errCode(zh) );
{
yaz_log(YLOG_FATAL, "Could not select database %s "
"errCode=%d",
database, zebra_errCode(zh) );
- else if (!strcmp (arg, "init"))
+ else if (!strcmp(arg, "adelete"))
+ cmd = 'a';
+ else if (!strcmp(arg, "init"))
- res = zebra_repository_delete (zh, arg);
+ res = zebra_repository_index(zh, arg, action_delete);
+ break;
+ case 'a':
+ res = zebra_repository_index(zh, arg, action_a_delete);
- if (zebra_end_trans (zh) != ZEBRA_OK)
- yaz_log (YLOG_WARN, "zebra_end_trans failed");
+ if (zebra_end_trans(zh) != ZEBRA_OK)
+ yaz_log(YLOG_WARN, "zebra_end_trans failed");
printf("Configured as: %s\n", sys_str);
if (strcmp(version_str, ZEBRAVER))
printf("zebraidx compiled version %s\n", ZEBRAVER);
printf("Configured as: %s\n", sys_str);
if (strcmp(version_str, ZEBRAVER))
printf("zebraidx compiled version %s\n", ZEBRAVER);
- if (zebra_end_trans (zh) != ZEBRA_OK)
- yaz_log (YLOG_WARN, "zebra_end_trans failed");
+ if (zebra_end_trans(zh) != ZEBRA_OK)
+ yaz_log(YLOG_WARN, "zebra_end_trans failed");