2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1995-05-15 11:56:56 quinn
8 * Debuggng & adjustments.
10 * Revision 1.1 1995/04/10 10:28:47 quinn
11 * Added copy of CCL and MARC display
28 int main (int argc, char **argv)
37 fprintf (stderr, "usage\n%s <file>\n", *argv);
40 inf = fopen (argv[1], "r");
43 fprintf (stderr, "%s: cannot open %s:%s\n",
44 *argv, argv[1], strerror (errno));
47 if (fseek (inf, 0L, SEEK_END))
49 fprintf (stderr, "%s: cannot seek in %s:%s\n",
50 *argv, argv[1], strerror (errno));
53 file_size = ftell (inf);
54 if (fseek (inf, 0L, SEEK_SET))
56 fprintf (stderr, "%s: cannot seek in %s:%s\n",
57 *argv, argv[1], strerror (errno));
60 buf = malloc (file_size);
63 fprintf (stderr, "%s: cannot malloc: %s\n",
64 *argv, strerror (errno));
67 if (fread (buf, 1, file_size, inf) != file_size)
69 fprintf (stderr, "%s: cannot read %s: %s\n",
70 *argv, argv[1], strerror (errno));
73 while ((r = marc_display (buf, stdout)) > 0)