Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
memcpy(&ent, (const char *)b + sizeof(sys) + 1, len);
yaz_log(YLOG_LOG, "%s " ZINT_FORMAT " next=" ZINT_FORMAT " sz=%d", txt, sys,
ent.next, ent.size);
memcpy(&ent, (const char *)b + sizeof(sys) + 1, len);
yaz_log(YLOG_LOG, "%s " ZINT_FORMAT " next=" ZINT_FORMAT " sz=%d", txt, sys,
ent.next, ent.size);
}
else
yaz_log(YLOG_LOG, "%s " ZINT_FORMAT, txt, sys);
}
else
yaz_log(YLOG_LOG, "%s " ZINT_FORMAT, txt, sys);
p->index_fname = "reci";
p->index_BFile = bf_open(bfs, p->index_fname, RIDX_CHUNK, rw);
if (p->index_BFile == NULL)
p->index_fname = "reci";
p->index_BFile = bf_open(bfs, p->index_fname, RIDX_CHUNK, rw);
if (p->index_BFile == NULL)
r = bf_write(p->index_BFile, 0, 0, len, buf);
if (r)
{
r = bf_write(p->index_BFile, 0, 0, len, buf);
if (r)
{
-int recindex_read_indx(recindex_t p, zint sysno, void *buf, int itemsize,
+int recindex_read_indx(recindex_t p, zint sysno, void *buf, int itemsize,
memcpy(untilbuf, &sysno, sizeof(sysno));
untilbuf[sizeof(sysno)] = 0;
r = isamb_pp_forward(isam_pp, st, untilbuf);
memcpy(untilbuf, &sysno, sizeof(sysno));
untilbuf[sizeof(sysno)] = 0;
r = isamb_pp_forward(isam_pp, st, untilbuf);
if (item[sizeof(sysno)] != itemsize)
{
yaz_log(YLOG_WARN, "unexpected entry size %d != %d",
if (item[sizeof(sysno)] != itemsize)
{
yaz_log(YLOG_WARN, "unexpected entry size %d != %d",
zint pos = (sysno-1)*itemsize;
int off = CAST_ZINT_TO_INT(pos%RIDX_CHUNK);
int sz1 = RIDX_CHUNK - off; /* sz1 is size of buffer to read.. */
zint pos = (sysno-1)*itemsize;
int off = CAST_ZINT_TO_INT(pos%RIDX_CHUNK);
int sz1 = RIDX_CHUNK - off; /* sz1 is size of buffer to read.. */
r = bf_read(p->index_BFile, 1+pos/RIDX_CHUNK, off, sz1, buf);
if (r == 1 && sz1 < itemsize) /* boundary? - must read second part */
r = bf_read(p->index_BFile, 2+pos/RIDX_CHUNK, 0, itemsize - sz1,
r = bf_read(p->index_BFile, 1+pos/RIDX_CHUNK, off, sz1, buf);
if (r == 1 && sz1 < itemsize) /* boundary? - must read second part */
r = bf_read(p->index_BFile, 2+pos/RIDX_CHUNK, 0, itemsize - sz1,
" sz=%d", r, sysno, ep->next, ep->size);
}
#endif
" sz=%d", r, sysno, ep->next, ep->size);
}
#endif
int bt_code_read(void *vp, char **dst, int *insertMode)
{
struct code_read_data *s = (struct code_read_data *) vp;
int bt_code_read(void *vp, char **dst, int *insertMode)
{
struct code_read_data *s = (struct code_read_data *) vp;
zint pos = (sysno-1)*itemsize;
int off = CAST_ZINT_TO_INT(pos%RIDX_CHUNK);
int sz1 = RIDX_CHUNK - off; /* sz1 is size of buffer to read.. */
zint pos = (sysno-1)*itemsize;
int off = CAST_ZINT_TO_INT(pos%RIDX_CHUNK);
int sz1 = RIDX_CHUNK - off; /* sz1 is size of buffer to read.. */
bf_write(p->index_BFile, 1+pos/RIDX_CHUNK, off, sz1, buf);
if (sz1 < itemsize) /* boundary? must write second part */
bf_write(p->index_BFile, 2+pos/RIDX_CHUNK, 0, itemsize - sz1,
bf_write(p->index_BFile, 1+pos/RIDX_CHUNK, off, sz1, buf);
if (sz1 < itemsize) /* boundary? must write second part */
bf_write(p->index_BFile, 2+pos/RIDX_CHUNK, 0, itemsize - sz1,