1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2010 Index Data
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #include <idzebra/util.h>
29 #include <yaz/yaz-util.h>
33 int main(int argc, char **argv)
38 char *inputfile = NULL;
43 while ((ret = options("8vh", argv, argc, &arg)) != -2)
51 yaz_log(YLOG_FATAL, "too many files specified\n");
57 yaz_log_init(yaz_log_mask_str(arg), prog, NULL);
61 fprintf(stderr, "usage:\n"
62 " %s [-8] [-h] [-v n] [file]\n", prog);
69 yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
75 ipf = fopen(inputfile, "r");
78 yaz_log(YLOG_FATAL|YLOG_ERRNO, "cannot open '%s'", inputfile);
82 while (fgets(ipf_buf, 1023, ipf))
84 char *ipf_ptr = ipf_buf;
85 for (;*ipf_ptr && *ipf_ptr != '\n';ipf_ptr++)
87 if ((use8 && *ipf_ptr<0)
88 || (*ipf_ptr > 0 && isalpha(*ipf_ptr))
92 while (ipf_ptr[i] && ((use8 && ipf_ptr[i] < 0)
93 || (ipf_ptr[i]>0 && isalnum(ipf_ptr[i]))
94 || ipf_ptr[i] == '_'))
98 printf("%s\n", ipf_ptr);
111 * c-file-style: "Stroustrup"
112 * indent-tabs-mode: nil
114 * vim: shiftwidth=4 tabstop=8 expandtab