2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1994-10-04 17:46:54 adam
8 * Function options now returns arg with error option.
10 * Revision 1.2 1994/09/28 13:07:08 adam
11 * Use log_mask_str now.
13 * Revision 1.1 1994/09/16 15:39:11 adam
14 * Initial code of lookup - not tested yet.
28 int main (int argc, char **argv)
32 char *inputfile = NULL;
37 while ((ret = options ("vh", argv, argc, &arg)) != -2)
45 log (LOG_FATAL, "too many files specified\n");
51 log_init (log_mask_str(arg), prog, NULL);
55 fprintf (stderr, "usage:\n"
56 " %s [-h] [-v n] [file]\n", prog);
61 log (LOG_FATAL, "Unknown option '-%s'", arg);
67 ipf = fopen (inputfile, "r");
70 log (LOG_FATAL|LOG_ERRNO, "cannot open '%s'", inputfile);
74 while (fgets (ipf_buf, 1023, ipf))
76 char *ipf_ptr = ipf_buf;
77 for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++)
79 if (isalpha(*ipf_ptr) || *ipf_ptr == '_')
82 while (ipf_ptr[i] && (isalnum(ipf_ptr[i]) ||
87 printf ("%s\n", ipf_ptr);