IDZEBRA  2.2.7
Data Structures | Macros | Functions | Variables
recindex.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <idzebra/isamb.h>
#include <yaz/yaz-util.h>
#include "recindex.h"

Go to the source code of this file.

Data Structures

struct  recindex
 
struct  record_index_entry
 
struct  code_read_data
 

Macros

#define RIDX_CHUNK   128
 

Functions

static void rect_log_item (int level, const void *b, const char *txt)
 
int rect_compare (const void *a, const void *b)
 
void * rect_code_start (void)
 
void rect_encode (void *p, char **dst, const char **src)
 
void rect_decode (void *p, char **dst, const char **src)
 
void rect_code_reset (void *p)
 
void rect_code_stop (void *p)
 
recindex_t recindex_open (BFiles bfs, int rw, int use_isamb)
 opens record index handle More...
 
static void log_pr (const char *txt)
 
void recindex_close (recindex_t p)
 closes record index handle More...
 
int recindex_read_head (recindex_t p, void *buf)
 
const char * recindex_get_fname (recindex_t p)
 
ZEBRA_RES recindex_write_head (recindex_t p, const void *buf, size_t len)
 
int recindex_read_indx (recindex_t p, zint sysno, void *buf, int itemsize, int ignoreError)
 
int bt_code_read (void *vp, char **dst, int *insertMode)
 
void recindex_write_indx (recindex_t p, zint sysno, void *buf, int itemsize)
 

Variables

struct record_index_entry ent
 

Macro Definition Documentation

◆ RIDX_CHUNK

#define RIDX_CHUNK   128

Definition at line 32 of file recindex.c.

Function Documentation

◆ bt_code_read()

int bt_code_read ( void *  vp,
char **  dst,
int *  insertMode 
)

◆ log_pr()

static void log_pr ( const char *  txt)
static

Definition at line 176 of file recindex.c.

Referenced by recindex_close().

◆ recindex_close()

void recindex_close ( recindex_t  p)

closes record index handle

Parameters
precords handle

Definition at line 182 of file recindex.c.

References bf_close(), recindex::index_BFile, recindex::isam_p, recindex::isamb, isamb_close(), isamb_dump(), isamb_set_root_ptr(), and log_pr().

Referenced by rec_close().

◆ recindex_get_fname()

const char* recindex_get_fname ( recindex_t  p)

Definition at line 203 of file recindex.c.

References recindex::index_fname.

Referenced by rec_open().

◆ recindex_open()

recindex_t recindex_open ( BFiles  bfs,
int  rw,
int  use_isamb 
)

opens record index handle

Parameters
bfsBlock files handle
rw1 for read and write; 0 for read-only
use_isamb1 if ISAMB is to used for record index; 0 for flat (old)

Definition at line 134 of file recindex.c.

References bf_open(), ISAMC_M_s::codec, ISAMC_M_s::compare_item, ISAM_CODEC::decode, ISAM_CODEC::encode, recindex::index_BFile, recindex::index_fname, recindex::isam_p, recindex::isamb, isamb_get_root_ptr(), isamb_open2(), ISAMC_M_s::log_item, rect_code_reset(), rect_code_start(), rect_code_stop(), rect_compare(), rect_decode(), rect_encode(), rect_log_item(), ISAM_CODEC::reset, RIDX_CHUNK, ISAM_CODEC::start, and ISAM_CODEC::stop.

Referenced by rec_open().

◆ recindex_read_head()

int recindex_read_head ( recindex_t  p,
void *  buf 
)

Definition at line 198 of file recindex.c.

References bf_read(), and recindex::index_BFile.

Referenced by rec_open().

◆ recindex_read_indx()

int recindex_read_indx ( recindex_t  p,
zint  sysno,
void *  buf,
int  itemsize,
int  ignoreError 
)

◆ recindex_write_head()

ZEBRA_RES recindex_write_head ( recindex_t  p,
const void *  buf,
size_t  len 
)

Definition at line 208 of file recindex.c.

References bf_write(), recindex::index_BFile, recindex::index_fname, ZEBRA_FAIL, and ZEBRA_OK.

Referenced by rec_close(), and rec_open().

◆ recindex_write_indx()

void recindex_write_indx ( recindex_t  p,
zint  sysno,
void *  buf,
int  itemsize 
)

◆ rect_code_reset()

void rect_code_reset ( void *  p)

Definition at line 125 of file recindex.c.

Referenced by recindex_open().

◆ rect_code_start()

void* rect_code_start ( void  )

Definition at line 82 of file recindex.c.

Referenced by recindex_open().

◆ rect_code_stop()

void rect_code_stop ( void *  p)

Definition at line 129 of file recindex.c.

Referenced by recindex_open().

◆ rect_compare()

int rect_compare ( const void *  a,
const void *  b 
)

Definition at line 68 of file recindex.c.

Referenced by recindex_open().

◆ rect_decode()

void rect_decode ( void *  p,
char **  dst,
const char **  src 
)

Definition at line 106 of file recindex.c.

References zebra_zint_decode().

Referenced by recindex_open().

◆ rect_encode()

void rect_encode ( void *  p,
char **  dst,
const char **  src 
)

Definition at line 87 of file recindex.c.

References zebra_zint_encode().

Referenced by recindex_open().

◆ rect_log_item()

static void rect_log_item ( int  level,
const void *  b,
const char *  txt 
)
static

Definition at line 48 of file recindex.c.

References ent, record_index_entry::next, record_index_entry::size, and ZINT_FORMAT.

Referenced by recindex_open().

Variable Documentation

◆ ent

struct record_index_entry ent