1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2009 Index Data
3 * See the file LICENSE for details.
7 * \brief Little toy-thing to genearate an OPAC record with some values
11 #include <yaz/wrbuf.h>
12 #include <yaz/marcdisp.h>
17 Z_OPACRecord *dummy_opac(int num, ODR odr, const char *marc_input)
21 rec = (Z_OPACRecord *) odr_malloc(odr, sizeof(*rec));
22 rec->bibliographicRecord =
23 z_ext_record_usmarc(odr, marc_input, strlen(marc_input));
24 rec->num_holdingsData = 1;
25 rec->holdingsData = (Z_HoldingsRecord **)
26 odr_malloc(odr, sizeof(*rec->holdingsData));
27 for (i = 0; i < rec->num_holdingsData; i++)
29 Z_HoldingsRecord *hr = (Z_HoldingsRecord *)
30 odr_malloc(odr, sizeof(*hr));
31 Z_HoldingsAndCircData *hc = (Z_HoldingsAndCircData *)
32 odr_malloc(odr, sizeof(*hc));
34 rec->holdingsData[i] = hr;
35 hr->which = Z_HoldingsRecord_holdingsAndCirc;
36 hr->u.holdingsAndCirc = hc;
38 hc->typeOfRecord = "u";
40 hc->encodingLevel = "u";
42 hc->format = 0; /* OPT */
43 hc->receiptAcqStatus = "0";
44 hc->generalRetention = 0; /* OPT */
45 hc->completeness = 0; /* OPT */
46 hc->dateOfReport = "000000";
47 hc->nucCode = "s-FM/GC";
49 "Main or Science/Business Reading Rms - STORED OFFSITE";
50 hc->shelvingLocation = 0; /* OPT */
51 hc->callNumber = "MLCM 89/00602 (N)";
52 hc->shelvingData = "FT MEADE";
53 hc->copyNumber = "Copy 1";
54 hc->publicNote = 0; /* OPT */
55 hc->reproductionNote = 0; /* OPT */
56 hc->termsUseRepro = 0; /* OPT */
57 hc->enumAndChron = 0; /* OPT */
62 hc->num_circulationData = 1;
63 hc->circulationData = (Z_CircRecord **)
64 odr_malloc(odr, sizeof(*hc->circulationData));
65 hc->circulationData[0] = (Z_CircRecord *)
66 odr_malloc(odr, sizeof(**hc->circulationData));
68 hc->circulationData[0]->availableNow = odr_intdup(odr, 1);
69 hc->circulationData[0]->availablityDate = 0;
70 hc->circulationData[0]->availableThru = 0;
71 hc->circulationData[0]->restrictions = 0;
72 hc->circulationData[0]->itemId = "1226176";
73 hc->circulationData[0]->renewable = odr_intdup(odr, 0);
74 hc->circulationData[0]->onHold = odr_intdup(odr, 0);
75 hc->circulationData[0]->enumAndChron = 0;
76 hc->circulationData[0]->midspine = 0;
77 hc->circulationData[0]->temporaryLocation = 0;
84 * indent-tabs-mode: nil
86 * vim: shiftwidth=4 tabstop=8 expandtab