YAZ  5.23.1
Macros | Functions | Variables
read-marc.c File Reference

Little toy-thing to read MARC records from a fixed array. More...

#include <yaz/wrbuf.h>
#include <yaz/marcdisp.h>
#include <yaz/odr.h>
#include <yaz/log.h>
#include "ztest.h"
#include <stdlib.h>

Go to the source code of this file.

Macros

#define NO_MARC_RECORDS   24
 
#define PZ_CBEGIN   "<pz:cluster xmlns:pz=\"http://www.indexdata.com/pazpar2/1.0\">\n"
 
#define PZ_CEND   "</pz:cluster>\n"
 
#define PZ_BEGIN   "<record xmlns=\"http://www.indexdata.com/pazpar2/1.0\">\n"
 
#define PZ_END   "</record>\n"
 
#define PZ_METADATA(x, y)   " <metadata type=\"" #x "\">" y "</metadata>\n"
 

Functions

char * dummy_marc_record (int num, ODR odr)
 
static char * dummy_pz2_record (int num, ODR odr)
 
char * dummy_xml_record (int num, ODR odr, const char *esn)
 
char * dummy_json_record (int num, ODR odr, const char *esn)
 

Variables

char * marc_records [NO_MARC_RECORDS]
 
static char * marc_record0
 

Detailed Description

Little toy-thing to read MARC records from a fixed array.

Definition in file read-marc.c.

Macro Definition Documentation

#define NO_MARC_RECORDS   24

Definition at line 34 of file read-marc.c.

Referenced by dummy_marc_record().

#define PZ_BEGIN   "<record xmlns=\"http://www.indexdata.com/pazpar2/1.0\">\n"

Definition at line 1601 of file read-marc.c.

Referenced by dummy_pz2_record().

#define PZ_CBEGIN   "<pz:cluster xmlns:pz=\"http://www.indexdata.com/pazpar2/1.0\">\n"

Definition at line 1599 of file read-marc.c.

Referenced by dummy_pz2_record().

#define PZ_CEND   "</pz:cluster>\n"

Definition at line 1600 of file read-marc.c.

Referenced by dummy_pz2_record().

#define PZ_END   "</record>\n"

Definition at line 1602 of file read-marc.c.

Referenced by dummy_pz2_record().

#define PZ_METADATA (   x,
  y 
)    " <metadata type=\"" #x "\">" y "</metadata>\n"

Definition at line 1603 of file read-marc.c.

Referenced by dummy_pz2_record().

Function Documentation

char* dummy_json_record ( int  num,
ODR  odr,
const char *  esn 
)
char* dummy_marc_record ( int  num,
ODR  odr 
)

Definition at line 1582 of file read-marc.c.

References marc_record0, marc_records, NO_MARC_RECORDS, and odr_strdup().

Referenced by dummy_json_record(), dummy_xml_record(), and ztest_fetch().

static char* dummy_pz2_record ( int  num,
ODR  odr 
)
static

Definition at line 1605 of file read-marc.c.

References odr_strdup(), PZ_BEGIN, PZ_CBEGIN, PZ_CEND, PZ_END, and PZ_METADATA.

Referenced by dummy_xml_record().

char* dummy_xml_record ( int  num,
ODR  odr,
const char *  esn 
)

Variable Documentation

char* marc_record0
static
Initial value:
=
"00366nam 220016"
"98a 450000100130"
"0000003000400013"
"0050017000170080"
"0410003401000170"
"0179040001300075"
"0500012000881000"
"0170010024500300"
"0117260001200147"
"2630009001593000"
"01100168" "\x1E" " 1122"
"4466 " "\x1E" "DLC" "\x1E" "000000"
"00000000.0" "\x1E" "91071"
"0c19910701nju "
" 00010 en"
"g " "\x1E" " " "\x1F" "aDLC" "\x1F" "cDLC"
"" "\x1E" "00" "\x1F" "a123-xyz" "\x1E" "10" "\x1F" ""
"aJack Collins" "\x1E" "10"
"" "\x1F" "aHow to program"
" a computer" "\x1E" "1 " "\x1F" "a"
"Penguin" "\x1E" " " "\x1F" "a8710"
"" "\x1E" " " "\x1F" "ap. cm." "\x1E" " " "\x1F" "a"
" 11224466 " "\x1E" "" "\x1D" ""

Definition at line 1555 of file read-marc.c.

Referenced by dummy_marc_record().

char* marc_records[NO_MARC_RECORDS]

Definition at line 36 of file read-marc.c.

Referenced by dummy_marc_record().