00001
00002
00003
00004
00005
00010 #include <ctype.h>
00011 #include <yaz/wrbuf.h>
00012 #include <yaz/marcdisp.h>
00013 #include <yaz/odr.h>
00014
00015 #include "ztest.h"
00016
00017 Z_OPACRecord *dummy_opac(int num, ODR odr, const char *marc_input)
00018 {
00019 Z_OPACRecord *rec;
00020 int i;
00021 rec = (Z_OPACRecord *) odr_malloc(odr, sizeof(*rec));
00022 rec->bibliographicRecord =
00023 z_ext_record_usmarc(odr, marc_input, strlen(marc_input));
00024 rec->num_holdingsData = 1;
00025 rec->holdingsData = (Z_HoldingsRecord **)
00026 odr_malloc(odr, sizeof(*rec->holdingsData));
00027 for (i = 0; i < rec->num_holdingsData; i++)
00028 {
00029 Z_HoldingsRecord *hr = (Z_HoldingsRecord *)
00030 odr_malloc(odr, sizeof(*hr));
00031 Z_HoldingsAndCircData *hc = (Z_HoldingsAndCircData *)
00032 odr_malloc(odr, sizeof(*hc));
00033
00034 rec->holdingsData[i] = hr;
00035 hr->which = Z_HoldingsRecord_holdingsAndCirc;
00036 hr->u.holdingsAndCirc = hc;
00037
00038 hc->typeOfRecord = "u";
00039
00040 hc->encodingLevel = "u";
00041
00042 hc->format = 0;
00043 hc->receiptAcqStatus = "0";
00044 hc->generalRetention = 0;
00045 hc->completeness = 0;
00046 hc->dateOfReport = "000000";
00047 hc->nucCode = "s-FM/GC";
00048 hc->localLocation =
00049 "Main or Science/Business Reading Rms - STORED OFFSITE";
00050 hc->shelvingLocation = 0;
00051 hc->callNumber = "MLCM 89/00602 (N)";
00052 hc->shelvingData = "FT MEADE";
00053 hc->copyNumber = "Copy 1";
00054 hc->publicNote = 0;
00055 hc->reproductionNote = 0;
00056 hc->termsUseRepro = 0;
00057 hc->enumAndChron = 0;
00058
00059 hc->num_volumes = 0;
00060 hc->volumes = 0;
00061
00062 hc->num_circulationData = 1;
00063 hc->circulationData = (Z_CircRecord **)
00064 odr_malloc(odr, sizeof(*hc->circulationData));
00065 hc->circulationData[0] = (Z_CircRecord *)
00066 odr_malloc(odr, sizeof(**hc->circulationData));
00067
00068 hc->circulationData[0]->availableNow = odr_intdup(odr, 1);
00069 hc->circulationData[0]->availablityDate = 0;
00070 hc->circulationData[0]->availableThru = 0;
00071 hc->circulationData[0]->restrictions = 0;
00072 hc->circulationData[0]->itemId = "1226176";
00073 hc->circulationData[0]->renewable = odr_intdup(odr, 0);
00074 hc->circulationData[0]->onHold = odr_intdup(odr, 0);
00075 hc->circulationData[0]->enumAndChron = 0;
00076 hc->circulationData[0]->midspine = 0;
00077 hc->circulationData[0]->temporaryLocation = 0;
00078 }
00079 return rec;
00080 }
00081
00082
00083
00084
00085
00086
00087
00088