-char *marc_read(FILE *inf, ODR odr)
-{
- char length_str[5];
- size_t size;
- char *buf;
-
- if (fread (length_str, 1, 5, inf) != 5)
- return NULL;
- size = atoin (length_str, 5);
- if (size <= 6)
- return NULL;
- if (!(buf = (char*) odr_malloc (odr, size+1)))
- return NULL;
- if (fread (buf+5, 1, size-5, inf) != (size-5))
- {
- xfree (buf);
- return NULL;
- }
- memcpy (buf, length_str, 5);
- buf[size] = '\0';
- return buf;
-}
-
-static char *dummy_database_record (int num, ODR odr)
-{
- FILE *inf = fopen ("dummy-records", "r");
- char *buf = 0;
-
- if (!inf)
- return NULL;
- if (num == 98)
- { /* this will generate a very bad MARC record (testing only) */
- buf = (char*) odr_malloc(odr, 2101);
- memset(buf, '7', 2100);
- buf[2100] = '\0';
- }
- else
- {
- /* OK, try to get proper MARC records from the file */
- while (--num >= 0)
- {
- buf = marc_read (inf, odr);
- if (!buf)
- break;
- }
- }
- fclose(inf);
- return buf;
-}
-
-static Z_GenericRecord *dummy_grs_record (int num, ODR o)