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