2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.1 1995-04-10 10:28:47 quinn
8 * Added copy of CCL and MARC display
24 int main (int argc, char **argv)
33 fprintf (stderr, "usage\n%s <file>\n", *argv);
36 inf = fopen (argv[1], "r");
39 fprintf (stderr, "%s: cannot open %s:%s\n",
40 *argv, argv[1], strerror (errno));
43 if (fseek (inf, 0L, SEEK_END))
45 fprintf (stderr, "%s: cannot seek in %s:%s\n",
46 *argv, argv[1], strerror (errno));
49 file_size = ftell (inf);
50 if (fseek (inf, 0L, SEEK_SET))
52 fprintf (stderr, "%s: cannot seek in %s:%s\n",
53 *argv, argv[1], strerror (errno));
56 buf = malloc (file_size);
59 fprintf (stderr, "%s: cannot malloc: %s\n",
60 *argv, strerror (errno));
63 if (fread (buf, 1, file_size, inf) != file_size)
65 fprintf (stderr, "%s: cannot read %s: %s\n",
66 *argv, argv[1], strerror (errno));
69 while ((r = marc_display (buf, stdout)) > 0)