2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.9 1995-09-14 07:48:24 adam
8 * Record control management.
10 * Revision 1.8 1995/09/06 16:11:18 adam
11 * Option: only one word key per file.
13 * Revision 1.7 1995/09/05 15:28:39 adam
14 * More work on search engine.
16 * Revision 1.6 1995/09/04 12:33:43 adam
17 * Various cleanup. YAZ util used instead.
19 * Revision 1.5 1995/09/04 09:10:39 adam
20 * More work on index add/del/update.
21 * Merge sort implemented.
22 * Initial work on z39 server.
24 * Revision 1.4 1995/09/01 14:06:36 adam
25 * Split of work into more files.
27 * Revision 1.3 1995/09/01 10:57:07 adam
30 * Revision 1.2 1995/09/01 10:30:24 adam
31 * More work on indexing. Not working yet.
33 * Revision 1.1 1995/08/31 14:50:24 adam
34 * New simple file index tool.
46 int main (int argc, char **argv)
51 char *base_name = NULL;
52 char *base_path = NULL;
55 while ((ret = options ("r:v:", argv, argc, &arg)) != -2)
63 common_resource = res_open (base_name);
66 logf (LOG_FATAL, "Cannot open resource `%s'", base_name);
70 else if(cmd == 0) /* command */
72 if (!strcmp (arg, "add"))
76 else if (!strcmp (arg, "del"))
82 logf (LOG_FATAL, "Unknown command: %s", arg);
89 key_open ("keys.tmp");
90 repository (cmd, arg, base_path);
96 log_init (log_mask_str(arg), prog, NULL);
104 logf (LOG_FATAL, "Unknown option '-%s'", arg);
110 fprintf (stderr, "index [-v log] [-r repository] "
111 "base cmd1 dir1 cmd2 dir2 ...\n");
116 logf (LOG_LOG, "Sorting");
117 if (!key_sort ("keys.tmp", 3000000))
119 logf (LOG_LOG, "Input");
120 key_input (FNAME_WORD_DICT, FNAME_WORD_ISAM, "keys.tmp", 60);