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