2 * Copyright (c) 1995, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.4 1995-11-01 13:55:05 quinn
10 * Revision 1.3 1995/05/16 08:51:12 quinn
11 * License, documentation, and memory fixes
13 * Revision 1.2 1995/05/15 11:56:56 quinn
14 * Debuggng & adjustments.
16 * Revision 1.1 1995/04/10 10:28:47 quinn
17 * Added copy of CCL and MARC display
34 int main (int argc, char **argv)
43 fprintf (stderr, "usage\n%s <file>\n", *argv);
46 inf = fopen (argv[1], "r");
49 fprintf (stderr, "%s: cannot open %s:%s\n",
50 *argv, argv[1], strerror (errno));
53 if (fseek (inf, 0L, SEEK_END))
55 fprintf (stderr, "%s: cannot seek in %s:%s\n",
56 *argv, argv[1], strerror (errno));
59 file_size = ftell (inf);
60 if (fseek (inf, 0L, SEEK_SET))
62 fprintf (stderr, "%s: cannot seek in %s:%s\n",
63 *argv, argv[1], strerror (errno));
66 buf = xmalloc (file_size);
69 fprintf (stderr, "%s: cannot xmalloc: %s\n",
70 *argv, strerror (errno));
73 if (fread (buf, 1, file_size, inf) != file_size)
75 fprintf (stderr, "%s: cannot read %s: %s\n",
76 *argv, argv[1], strerror (errno));
79 while ((r = marc_display (buf, stdout)) > 0)