YAZ 5.37.0
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 <yaz/snprintf.h>
#include "ztest.h"
#include <stdlib.h>

Go to the source code of this file.

Macros

#define NO_MARC_RECORDS   23
#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)

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

◆ NO_MARC_RECORDS

#define NO_MARC_RECORDS   23

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

Referenced by dummy_marc_record().

◆ PZ_BEGIN

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

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

Referenced by dummy_pz2_record().

◆ PZ_CBEGIN

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

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

Referenced by dummy_pz2_record().

◆ PZ_CEND

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

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

Referenced by dummy_pz2_record().

◆ PZ_END

#define PZ_END   "</record>\n"

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

Referenced by dummy_pz2_record().

◆ PZ_METADATA

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

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

Referenced by dummy_pz2_record().

Function Documentation

◆ dummy_json_record()

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

◆ dummy_marc_record()

char * dummy_marc_record ( int num,
ODR odr )

◆ dummy_pz2_record()

char * dummy_pz2_record ( int num,
ODR odr )
static

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

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

Referenced by dummy_xml_record().

◆ dummy_xml_record()

Variable Documentation

◆ marc_record0

char* marc_record0
static
Initial value:
=
"00366nam a220016"
"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-\xC3\x98" "x" "\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 1510 of file read-marc.c.

Referenced by dummy_marc_record().

◆ marc_records

char* marc_records[NO_MARC_RECORDS]

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

Referenced by dummy_marc_record().