1 /* $Id: dictext.c,v 1.11 2005-01-15 19:38:21 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
35 int main (int argc, char **argv)
40 char *inputfile = NULL;
45 while ((ret = options ("8vh", argv, argc, &arg)) != -2)
53 yaz_log (YLOG_FATAL, "too many files specified\n");
59 yaz_log_init (yaz_log_mask_str(arg), prog, NULL);
63 fprintf (stderr, "usage:\n"
64 " %s [-8] [-h] [-v n] [file]\n", prog);
71 yaz_log (YLOG_FATAL, "Unknown option '-%s'", arg);
77 ipf = fopen (inputfile, "r");
80 yaz_log (YLOG_FATAL|YLOG_ERRNO, "cannot open '%s'", inputfile);
84 while (fgets (ipf_buf, 1023, ipf))
86 char *ipf_ptr = ipf_buf;
87 for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++)
89 if ((use8 && *ipf_ptr<0)
90 || (*ipf_ptr > 0 && isalpha(*ipf_ptr))
94 while (ipf_ptr[i] && ((use8 && ipf_ptr[i] < 0)
95 || (ipf_ptr[i]>0 && isalnum(ipf_ptr[i]))
96 || ipf_ptr[i] == '_'))
100 printf ("%s\n", ipf_ptr);