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