2 * Copyright (C) 1994-1999, Index Data
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.8 2000-09-05 14:04:05 adam
8 * Updates for prefix 'yaz_' for YAZ log functions.
10 * Revision 1.7 1999/02/02 14:50:18 adam
11 * Updated WIN32 code specific sections. Changed header.
13 * Revision 1.6 1996/10/29 14:00:02 adam
14 * Page size given by DICT_DEFAULT_PAGESIZE in dict.h.
16 * Revision 1.5 1996/01/31 21:03:59 adam
19 * Revision 1.4 1995/09/04 12:33:31 adam
20 * Various cleanup. YAZ util used instead.
22 * Revision 1.3 1994/10/04 17:46:54 adam
23 * Function options now returns arg with error option.
25 * Revision 1.2 1994/09/28 13:07:08 adam
26 * Use log_mask_str now.
28 * Revision 1.1 1994/09/16 15:39:11 adam
29 * Initial code of lookup - not tested yet.
43 int main (int argc, char **argv)
48 char *inputfile = NULL;
53 while ((ret = options ("8vh", argv, argc, &arg)) != -2)
61 logf (LOG_FATAL, "too many files specified\n");
67 yaz_log_init (yaz_log_mask_str(arg), prog, NULL);
71 fprintf (stderr, "usage:\n"
72 " %s [-8] [-h] [-v n] [file]\n", prog);
79 logf (LOG_FATAL, "Unknown option '-%s'", arg);
85 ipf = fopen (inputfile, "r");
88 logf (LOG_FATAL|LOG_ERRNO, "cannot open '%s'", inputfile);
92 while (fgets (ipf_buf, 1023, ipf))
94 char *ipf_ptr = ipf_buf;
95 for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++)
97 if ((use8 && *ipf_ptr<0)
98 || (*ipf_ptr > 0 && isalpha(*ipf_ptr))
102 while (ipf_ptr[i] && ((use8 && ipf_ptr[i] < 0)
103 || (ipf_ptr[i]>0 && isalnum(ipf_ptr[i]))
104 || ipf_ptr[i] == '_'))
108 printf ("%s\n", ipf_ptr);