1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 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 = 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 = odr_malloc(odr, sizeof(*rec->holdingsData));
26 for (i = 0; i < rec->num_holdingsData; i++)
28 Z_HoldingsRecord *hr = odr_malloc(odr, sizeof(*hr));
29 Z_HoldingsAndCircData *hc = odr_malloc(odr, sizeof(*hc));
31 rec->holdingsData[i] = hr;
32 hr->which = Z_HoldingsRecord_holdingsAndCirc;
33 hr->u.holdingsAndCirc = hc;
35 hc->typeOfRecord = "u";
37 hc->encodingLevel = "u";
39 hc->format = 0; /* OPT */
40 hc->receiptAcqStatus = "0";
41 hc->generalRetention = 0; /* OPT */
42 hc->completeness = 0; /* OPT */
43 hc->dateOfReport = "000000";
44 hc->nucCode = "s-FM/GC";
46 "Main or Science/Business Reading Rms - STORED OFFSITE";
47 hc->shelvingLocation = 0; /* OPT */
48 hc->callNumber = "MLCM 89/00602 (N)";
49 hc->shelvingData = "FT MEADE";
50 hc->copyNumber = "Copy 1";
51 hc->publicNote = 0; /* OPT */
52 hc->reproductionNote = 0; /* OPT */
53 hc->termsUseRepro = 0; /* OPT */
54 hc->enumAndChron = 0; /* OPT */
59 hc->num_circulationData = 1;
60 hc->circulationData = odr_malloc(odr,
61 sizeof(*hc->circulationData));
62 hc->circulationData[0] = odr_malloc(odr,
63 sizeof(**hc->circulationData));
65 hc->circulationData[0]->availableNow = odr_intdup(odr, 1);
66 hc->circulationData[0]->availablityDate = 0;
67 hc->circulationData[0]->availableThru = 0;
68 hc->circulationData[0]->restrictions = 0;
69 hc->circulationData[0]->itemId = "1226176";
70 hc->circulationData[0]->renewable = odr_intdup(odr, 0);
71 hc->circulationData[0]->onHold = odr_intdup(odr, 0);
72 hc->circulationData[0]->enumAndChron = 0;
73 hc->circulationData[0]->midspine = 0;
74 hc->circulationData[0]->temporaryLocation = 0;
81 * indent-tabs-mode: nil
83 * vim: shiftwidth=4 tabstop=8 expandtab