30 #include <yaz/xmalloc.h>
82 memcpy (is->
method, method,
sizeof(*method));
130 yaz_log (YLOG_LOG,
"first_block=%d", first_block);
139 char *tmp_ptr = i_item;
149 const char *i_item_ptr = i_item;
165 memcpy(is->
merge_buf + first_offset, &count,
sizeof(
int));
168 int gap = first_offset +
sizeof(int) - is->
block_size;
169 assert (gap <= (
int)
sizeof(int));
172 if (gap < (
int)
sizeof(int))
173 bf_write(is->
bf, first_block, first_offset,
sizeof(
int)-gap,
175 memcpy (is->
merge_buf, ((
char*)&count)+(
sizeof(
int)-gap), gap);
178 bf_write(is->
bf, first_block, first_offset,
sizeof(
int), &count);
182 bf_write(is->
bf, first_block, first_offset,
sizeof(
int), &count);
184 return first_block * is->
block_size + first_offset;
192 yaz_log (YLOG_LOG,
"isams: isams_pp_open pos=%ld", (
long) pos);
201 yaz_log (YLOG_LOG,
"isams: isams_pp_open off=%d no=%d",
209 yaz_log (YLOG_LOG,
"isams: isams_pp_open numKeys=%d", pp->
numKeys);
int bf_read(BFile bf, zint no, int offset, int nbytes, void *buf)
read from block file (may call exit)
void bf_close(BFile bf)
closes a Block file (may call exit)
BFile bf_open(BFiles bfs, const char *name, int block_size, int wflag)
opens and returns a Block file handle
int bf_write(BFile bf, zint no, int offset, int nbytes, const void *buf)
writes block of bytes to file (may call exit)
int isams_pp_num(ISAMS_PP pp)
unsigned ISAMS_BLOCK_SIZE
int isams_pp_read(ISAMS_PP pp, void *buf)
void isams_getmethod(ISAMS_M *m)
int isams_read_item(ISAMS_PP pp, char **dst)
ISAM_P isams_merge(ISAMS is, ISAMS_I data)
int isams_close(ISAMS is)
void isams_pp_close(ISAMS_PP pp)
ISAMS_PP isams_pp_open(ISAMS is, ISAM_P pos)
ISAMS isams_open(BFiles bfs, const char *name, int writeflag, ISAMS_M *method)
struct ISAMS_PP_s * ISAMS_PP
int(* read_item)(void *clientData, char **dst, int *insertMode)
int(* compare_item)(const void *a, const void *b)
void(* log_item)(int logmask, const void *p, const char *txt)
void(* decode)(void *p, char **dst, const char **src)
void(* encode)(void *p, char **dst, const char **src)