IDZEBRA  2.1.3
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


#define RIDX_CHUNK   128


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)


struct record_index_entry ent

Macro Definition Documentation

#define RIDX_CHUNK   128

Definition at line 32 of file recindex.c.

Referenced by recindex_open(), recindex_read_indx(), and recindex_write_indx().

Function Documentation

int bt_code_read ( void *  vp,
char **  dst,
int *  insertMode 
static void log_pr ( const char *  txt)

Definition at line 176 of file recindex.c.

Referenced by recindex_close().

void recindex_close ( recindex_t  p)

closes record index handle

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().

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_t recindex_open ( BFiles  bfs,
int  rw,
int  use_isamb 

opens record index handle

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().

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().

int recindex_read_indx ( recindex_t  p,
zint  sysno,
void *  buf,
int  itemsize,
int  ignoreError 
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().

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

Definition at line 125 of file recindex.c.

Referenced by recindex_open().

void* rect_code_start ( void  )

Definition at line 82 of file recindex.c.

Referenced by recindex_open().

void rect_code_stop ( void *  p)

Definition at line 129 of file recindex.c.

Referenced by recindex_open().

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

Definition at line 68 of file recindex.c.

Referenced by recindex_open().

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().

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().

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

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

struct record_index_entry ent