YAZ  5.23.1
Data Structures | Functions
zoom-record-cache.c File Reference

Implements ZOOM record caching. More...

#include <assert.h>
#include <string.h>
#include <errno.h>
#include "zoom-p.h"
#include <yaz/diagbib1.h>
#include <yaz/record_render.h>
#include <yaz/shptr.h>

Go to the source code of this file.

Data Structures

struct  ZOOM_record_p
 
struct  ZOOM_record_cache_p
 

Functions

static size_t record_hash (int pos)
 
static ZOOM_record record_cache_add (ZOOM_resultset r, Z_NamePlusRecord *npr, int pos, const char *syntax, const char *elementSetName, const char *schema, Z_SRW_diagnostic *diag)
 
void ZOOM_record_cache_add (ZOOM_resultset r, Z_NamePlusRecord *npr, int pos, const char *syntax, const char *elementSetName, const char *schema, Z_SRW_diagnostic *diag)
 
ZOOM_record ZOOM_record_cache_lookup_i (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema)
 
ZOOM_record ZOOM_record_cache_lookup (ZOOM_resultset r, int pos, const char *syntax, const char *elementSetName, const char *schema)
 
 ZOOM_record_clone (ZOOM_record srec)
 
static void ZOOM_record_release (ZOOM_record rec)
 
 ZOOM_resultset_cache_reset (ZOOM_resultset r)
 
 ZOOM_record_get (ZOOM_record rec, const char *type_spec, int *len)
 
 ZOOM_record_error (ZOOM_record rec, const char **cp, const char **addinfo, const char **diagset)
 
 ZOOM_record_destroy (ZOOM_record rec)
 

Detailed Description

Implements ZOOM record caching.

Definition in file zoom-record-cache.c.

Function Documentation

static ZOOM_record record_cache_add ( ZOOM_resultset  r,
Z_NamePlusRecord npr,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema,
Z_SRW_diagnostic diag 
)
static
static size_t record_hash ( int  pos)
static

Definition at line 52 of file zoom-record-cache.c.

References RECORD_HASH_SIZE.

Referenced by record_cache_add(), and ZOOM_record_cache_lookup_i().

void ZOOM_record_cache_add ( ZOOM_resultset  r,
Z_NamePlusRecord npr,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema,
Z_SRW_diagnostic diag 
)

Definition at line 124 of file zoom-record-cache.c.

References record_cache_add(), and ZOOM_memcached_add().

Referenced by handle_srw_response(), and handle_Z3950_records().

ZOOM_record ZOOM_record_cache_lookup ( ZOOM_resultset  r,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema 
)
ZOOM_record ZOOM_record_cache_lookup_i ( ZOOM_resultset  r,
int  pos,
const char *  syntax,
const char *  elementSetName,
const char *  schema 
)
ZOOM_record_clone ( ZOOM_record  srec)
ZOOM_record_destroy ( ZOOM_record  rec)

Definition at line 330 of file zoom-record-cache.c.

References xfree, and ZOOM_record_release().

ZOOM_record_error ( ZOOM_record  rec,
const char **  cp,
const char **  addinfo,
const char **  diagset 
)
ZOOM_record_get ( ZOOM_record  rec,
const char *  type_spec,
int *  len 
)

Definition at line 244 of file zoom-record-cache.c.

References wrbuf_alloc(), yaz_record_render(), YAZ_SHPTR_INIT, and ZOOM_API.

static void ZOOM_record_release ( ZOOM_record  rec)
static
ZOOM_resultset_cache_reset ( ZOOM_resultset  r)