2 * Copyright (C) 1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.5 1995-09-04 09:10:39 adam
8 * More work on index add/del/update.
9 * Merge sort implemented.
10 * Initial work on z39 server.
12 * Revision 1.4 1995/09/01 14:06:36 adam
13 * Split of work into more files.
15 * Revision 1.3 1995/09/01 10:57:07 adam
18 * Revision 1.2 1995/09/01 10:30:24 adam
19 * More work on indexing. Not working yet.
21 * Revision 1.1 1995/08/31 14:50:24 adam
22 * New simple file index tool.
34 int main (int argc, char **argv)
39 char *base_name = NULL;
40 char *base_path = NULL;
43 while ((ret = options ("r:v:", argv, argc, &arg)) != -2)
51 common_resource = res_open (base_name);
54 log (LOG_FATAL, "Cannot open resource `%s'", base_name);
58 else if(cmd == 0) /* command */
60 if (!strcmp (arg, "add"))
64 else if (!strcmp (arg, "del"))
70 log (LOG_FATAL, "Unknown command: %s", arg);
77 key_open ("keys.tmp");
78 repository (cmd, arg, base_path);
84 log_init (log_mask_str(arg), prog, NULL);
92 log (LOG_FATAL, "Unknown option '-%s'", arg);
98 fprintf (stderr, "index [-v log] [-r repository] "
99 "base cmd1 dir1 cmd2 dir2 ...\n");
105 log (LOG_DEBUG, "Sorting");
106 if (!key_sort ("keys.tmp", 1000000))
108 log (LOG_DEBUG, "Input");
109 key_input ("dictinv", "isaminv", "keys.tmp", 50);