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