2 * Copyright (c) 1995, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.5 1997-09-24 13:29:40 adam
8 * Added verbose option -v to marcdump utility.
10 * Revision 1.4 1995/11/01 13:55:05 quinn
13 * Revision 1.3 1995/05/16 08:51:12 quinn
14 * License, documentation, and memory fixes
16 * Revision 1.2 1995/05/15 11:56:56 quinn
17 * Debuggng & adjustments.
19 * Revision 1.1 1995/04/10 10:28:47 quinn
20 * Added copy of CCL and MARC display
38 int main (int argc, char **argv)
50 while ((ret = options("v", argv, argc, &arg)) != -2)
56 inf = fopen (arg, "r");
59 fprintf (stderr, "%s: cannot open %s:%s\n",
60 prog, arg, strerror (errno));
63 if (fseek (inf, 0L, SEEK_END))
65 fprintf (stderr, "%s: cannot seek in %s:%s\n",
66 prog, arg, strerror (errno));
69 file_size = ftell (inf);
70 if (fseek (inf, 0L, SEEK_SET))
72 fprintf (stderr, "%s: cannot seek in %s:%s\n",
73 prog, arg, strerror (errno));
76 buf = xmalloc (file_size);
79 fprintf (stderr, "%s: cannot xmalloc: %s\n",
80 prog, strerror (errno));
83 if (fread (buf, 1, file_size, inf) != file_size)
85 fprintf (stderr, "%s: cannot read %s: %s\n",
86 prog, arg, strerror (errno));
89 while ((ret = marc_display_ex (buf, stdout, verbose)) > 0)
101 fprintf (stderr, "Usage: %s [-v] file...\n", prog);
107 fprintf (stderr, "Usage: %s [-v] file...\n", prog);