1 /* $Id: dictext.c,v 1.15 2006-08-14 10:40:09 adam Exp $
2 Copyright (C) 1995-2006
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 this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
31 #include <idzebra/util.h>
32 #include <yaz/yaz-util.h>
36 int main (int argc, char **argv)
41 char *inputfile = NULL;
46 while ((ret = options("8vh", argv, argc, &arg)) != -2)
54 yaz_log (YLOG_FATAL, "too many files specified\n");
60 yaz_log_init (yaz_log_mask_str(arg), prog, NULL);
64 fprintf (stderr, "usage:\n"
65 " %s [-8] [-h] [-v n] [file]\n", prog);
72 yaz_log (YLOG_FATAL, "Unknown option '-%s'", arg);
78 ipf = fopen (inputfile, "r");
81 yaz_log (YLOG_FATAL|YLOG_ERRNO, "cannot open '%s'", inputfile);
85 while (fgets (ipf_buf, 1023, ipf))
87 char *ipf_ptr = ipf_buf;
88 for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++)
90 if ((use8 && *ipf_ptr<0)
91 || (*ipf_ptr > 0 && isalpha(*ipf_ptr))
95 while (ipf_ptr[i] && ((use8 && ipf_ptr[i] < 0)
96 || (ipf_ptr[i]>0 && isalnum(ipf_ptr[i]))
97 || ipf_ptr[i] == '_'))
101 printf ("%s\n", ipf_ptr);
114 * indent-tabs-mode: nil
116 * vim: shiftwidth=4 tabstop=8 expandtab