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