IDZEBRA  2.1.2
Macros | Typedefs | Functions
sortidx.h File Reference
#include <yaz/yconfig.h>
#include <idzebra/bfile.h>
#include <yaz/wrbuf.h>

Go to the source code of this file.

Macros

#define SORT_IDX_ENTRYSIZE   64
 
#define ZEBRA_SORT_TYPE_FLAT   1
 
#define ZEBRA_SORT_TYPE_ISAMB   2
 
#define ZEBRA_SORT_TYPE_MULTI   3
 

Typedefs

typedef struct zebra_sort_indexzebra_sort_index_t
 sort index handle More...
 

Functions

zebra_sort_index_t zebra_sort_open (BFiles bfs, int write_flag, int sort_type)
 creates sort handle More...
 
void zebra_sort_close (zebra_sort_index_t si)
 frees sort handle More...
 
int zebra_sort_type (zebra_sort_index_t si, int type)
 sets type for sort usage More...
 
void zebra_sort_sysno (zebra_sort_index_t si, zint sysno)
 sets sort system number for read / add / delete More...
 
void zebra_sort_add (zebra_sort_index_t si, zint section_id, WRBUF w)
 adds multi-map content to sort file More...
 
void zebra_sort_delete (zebra_sort_index_t si, zint section_id)
 delete sort entry More...
 
int zebra_sort_read (zebra_sort_index_t si, zint *section_id, WRBUF w)
 reads sort entry More...
 

Macro Definition Documentation

#define SORT_IDX_ENTRYSIZE   64
#define ZEBRA_SORT_TYPE_FLAT   1
#define ZEBRA_SORT_TYPE_ISAMB   2
#define ZEBRA_SORT_TYPE_MULTI   3

Typedef Documentation

sort index handle

Definition at line 34 of file sortidx.h.

Function Documentation

void zebra_sort_add ( zebra_sort_index_t  si,
zint  section_id,
WRBUF  w 
)
void zebra_sort_close ( zebra_sort_index_t  si)
void zebra_sort_delete ( zebra_sort_index_t  si,
zint  section_id 
)
zebra_sort_index_t zebra_sort_open ( BFiles  bfs,
int  write_flag,
int  sort_type 
)

creates sort handle

Parameters
bfsblock files handle
write_flag(0=read-only, 1=write and read)
sort_typeone of ZEBRA_SORT_TYPE_..
Returns
sort index handle

Definition at line 196 of file sortidx.c.

References zebra_sort_index::bfs, zebra_sort_index::current_file, zebra_sort_index::entry_buf, zebra_sort_index::files, SORT_IDX_ENTRYSIZE, zebra_sort_index::type, and zebra_sort_index::write_flag.

Referenced by zebra_register_open().

int zebra_sort_read ( zebra_sort_index_t  si,
zint section_id,
WRBUF  w 
)

reads sort entry

Parameters
sisort index handle
section_idoutput section ID (may be NULL and it will not be set)
wresulting buffer
Return values
0could not be read
1could be read (found)

Definition at line 469 of file sortidx.c.

References sortFile::bf, bf_read(), zebra_sort_index::current_file, sortFile::isam_p, sortFile::isam_pp, sortFile::isamb, isamb_pp_forward(), isamb_pp_open(), sort_term::length, sort_term::section_id, SORT_IDX_ENTRYSIZE, sort_term::sysno, zebra_sort_index::sysno, sort_term::term, zebra_sort_index::type, sortFile::u, ZEBRA_SORT_TYPE_FLAT, ZEBRA_SORT_TYPE_ISAMB, and ZEBRA_SORT_TYPE_MULTI.

Referenced by perform_facet_sort(), resultSetInsertSort(), and sort_fetch().

void zebra_sort_sysno ( zebra_sort_index_t  si,
zint  sysno 
)

sets sort system number for read / add / delete

Parameters
sisort index handle
sysnosystem number

Definition at line 339 of file sortidx.c.

References zebra_sort_index::files, sortFile::isam_pp, sortFile::next, sortFile::no_deleted, sortFile::no_inserted, rec_sysno_to_int(), zebra_sort_index::sysno, and zebra_sortf_rewind().

Referenced by extract_flush_sort_keys(), perform_facet_sort(), resultSetInsertSort(), and sort_fetch().

int zebra_sort_type ( zebra_sort_index_t  si,
int  type 
)