YAZ  5.34.0
Functions
record_render.c File Reference

Render Z39.50 records (NamePlusRecord) More...

#include <assert.h>
#include <string.h>
#include <errno.h>
#include <yaz/marcdisp.h>
#include <yaz/record_render.h>
#include <yaz/yaz-iconv.h>
#include <yaz/proto.h>
#include <yaz/oid_db.h>
#include <yaz/nmem_xml.h>
#include <yaz/base64.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>

Go to the source code of this file.

Functions

static yaz_iconv_t iconv_create_charset (const char *record_charset, yaz_iconv_t *cd2, const char *marc_buf, int sz)
 
static const char * return_marc_record (WRBUF wrbuf, int marc_type, int *len, const char *buf, int sz, const char *record_charset)
 
static const char * return_opac_record (WRBUF wrbuf, int marc_type, int *len, Z_OPACRecord *opac_rec, const char *record_charset)
 
static const char * return_string_record (WRBUF wrbuf, int *len, const char *buf, int sz, const char *record_charset)
 
static const char * return_record_wrbuf (WRBUF wrbuf, int *len, Z_NamePlusRecord *npr, int marctype, const char *charset)
 
static const char * get_record_format (WRBUF wrbuf, int *len, Z_NamePlusRecord *npr, int marctype, const char *charset, const char *format)
 
static int replace_node (NMEM nmem, xmlNode *ptr, const char *type_spec, char *record_buf)
 
static const char * base64_render (NMEM nmem, WRBUF wrbuf, const char *buf, int *len, const char *expr, const char *type_spec)
 
const char * yaz_record_render (Z_NamePlusRecord *npr, const char *schema, WRBUF wrbuf, const char *type_spec, int *len)
 render records (ZOOM style) More...
 

Detailed Description

Render Z39.50 records (NamePlusRecord)

Definition in file record_render.c.

Function Documentation

◆ base64_render()

static const char* base64_render ( NMEM  nmem,
WRBUF  wrbuf,
const char *  buf,
int *  len,
const char *  expr,
const char *  type_spec 
)
static

◆ get_record_format()

static const char* get_record_format ( WRBUF  wrbuf,
int *  len,
Z_NamePlusRecord npr,
int  marctype,
const char *  charset,
const char *  format 
)
static

Definition at line 220 of file record_render.c.

References return_record_wrbuf(), wrbuf_cstr(), wrbuf_len, wrbuf_rewind(), and wrbuf_write().

Referenced by yaz_record_render().

◆ iconv_create_charset()

static yaz_iconv_t iconv_create_charset ( const char *  record_charset,
yaz_iconv_t cd2,
const char *  marc_buf,
int  sz 
)
static

◆ replace_node()

static int replace_node ( NMEM  nmem,
xmlNode *  ptr,
const char *  type_spec,
char *  record_buf 
)
static

◆ return_marc_record()

static const char* return_marc_record ( WRBUF  wrbuf,
int  marc_type,
int *  len,
const char *  buf,
int  sz,
const char *  record_charset 
)
static

◆ return_opac_record()

static const char* return_opac_record ( WRBUF  wrbuf,
int  marc_type,
int *  len,
Z_OPACRecord opac_rec,
const char *  record_charset 
)
static

◆ return_record_wrbuf()

static const char* return_record_wrbuf ( WRBUF  wrbuf,
int *  len,
Z_NamePlusRecord npr,
int  marctype,
const char *  charset 
)
static

◆ return_string_record()

static const char* return_string_record ( WRBUF  wrbuf,
int *  len,
const char *  buf,
int  sz,
const char *  record_charset 
)
static

◆ yaz_record_render()

const char* yaz_record_render ( Z_NamePlusRecord npr,
const char *  schema,
WRBUF  wrbuf,
const char *  type_spec,
int *  len 
)

render records (ZOOM style)

Parameters
nprrecord structure to be rendered (Z39.50)
schemafor record (if known)
wrbufWorking WRBUF
type_specformat spec
lenlength of returned buffer
Return values
!=0buffer
=0record could not be rendered

txml; charset=marc-8 xml; charset=utf-8 txml; charset=marc-8; base64=/rec/my/text()

Definition at line 355 of file record_render.c.

References base64_render(), Z_NamePlusRecord::databaseName, Z_NamePlusRecord::databaseRecord, Z_External::direct_reference, get_record_format(), nmem_create(), nmem_destroy(), nmem_malloc(), nmem_strdupn(), type, Z_NamePlusRecord::u, Z_External::which, Z_NamePlusRecord::which, YAZ_MARC_ISO2709, YAZ_MARC_JSON, YAZ_MARC_LINE, YAZ_MARC_MARCXML, YAZ_MARC_TURBOMARC, yaz_oid_std(), yaz_oid_to_string(), Z_External_OPAC, and Z_NamePlusRecord_databaseRecord.

Referenced by replace_node(), and ZOOM_record_get().