2 * Copyright (c) 1995-1997, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.8 1999-05-26 07:49:35 adam
10 * Revision 1.7 1998/02/11 11:53:36 adam
11 * Changed code so that it compiles as C++.
13 * Revision 1.6 1997/12/12 06:32:33 adam
14 * Added include of string.h.
16 * Revision 1.5 1997/09/24 13:29:40 adam
17 * Added verbose option -v to marcdump utility.
19 * Revision 1.4 1995/11/01 13:55:05 quinn
22 * Revision 1.3 1995/05/16 08:51:12 quinn
23 * License, documentation, and memory fixes
25 * Revision 1.2 1995/05/15 11:56:56 quinn
26 * Debuggng & adjustments.
28 * Revision 1.1 1995/04/10 10:28:47 quinn
29 * Added copy of CCL and MARC display
48 int main (int argc, char **argv)
60 while ((ret = options("v", argv, argc, &arg)) != -2)
66 inf = fopen (arg, "r");
69 fprintf (stderr, "%s: cannot open %s:%s\n",
70 prog, arg, strerror (errno));
73 if (fseek (inf, 0L, SEEK_END))
75 fprintf (stderr, "%s: cannot seek in %s:%s\n",
76 prog, arg, strerror (errno));
79 file_size = ftell (inf);
80 if (fseek (inf, 0L, SEEK_SET))
82 fprintf (stderr, "%s: cannot seek in %s:%s\n",
83 prog, arg, strerror (errno));
86 buf = (char *)xmalloc (file_size);
89 fprintf (stderr, "%s: cannot xmalloc: %s\n",
90 prog, strerror (errno));
93 if ((long) fread (buf, 1, file_size, inf) != file_size)
95 fprintf (stderr, "%s: cannot read %s: %s\n",
96 prog, arg, strerror (errno));
99 while ((ret = marc_display_ex (buf, stdout, verbose)) > 0)
111 fprintf (stderr, "Usage: %s [-v] file...\n", prog);
117 fprintf (stderr, "Usage: %s [-v] file...\n", prog);