From: Heikki Levanto Date: Tue, 16 Jan 2001 19:05:11 +0000 (+0000) Subject: Started to add isamg X-Git-Tag: ZEBRA.1.1~39 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=b1cc92fc80e32020fb2a91c6577b33ca2cef354a Started to add isamg --- diff --git a/include/Makefile.in b/include/Makefile.in index e7cfb8a..0399b15 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -67,11 +67,6 @@ RANLIB = @RANLIB@ TCL_INCLUDE = @TCL_INCLUDE@ TCL_LIB = @TCL_LIB@ VERSION = @VERSION@ -YAZINC = @YAZINC@ -YAZLALIB = @YAZLALIB@ -YAZLIB = @YAZLIB@ -YAZVERSION = @YAZVERSION@ -yazconfig = @yazconfig@ noinst_HEADERS = bfile.h bset.h charmap.h dfa.h dict.h direntz.h isam.h isamc.h isamd.h isams.h mfile.h passwddb.h recctrl.h res.h rsbool.h rset.h rsisam.h rsisamc.h rsisams.h rsm_or.h rsnull.h rstemp.h set.h sortidx.h str.h zebra-lock.h zebramap.h zebrautl.h zebraver.h isamb.h diff --git a/include/isamg.h b/include/isamg.h new file mode 100644 index 0000000..eeb04e0 --- /dev/null +++ b/include/isamg.h @@ -0,0 +1,110 @@ +/* + * Copyright (c) 1995-2000, Index Data. + * See the file LICENSE for details. + * + * ISAM-G - Generic interface to all our ISAM types + * + * Heikki Levanto + * + * Detailed log at the end of the file + * + */ + +#ifndef ISAMG_H +#define ISAMG_H + +/* #include */ + +YAZ_BEGIN_CDECL + +typedef struct ISAMG_s *ISAMG; +typedef int ISAMG_P; +typedef struct ISAMG_PP_s *ISAMG_PP; + +#ifdef SKIPTHIS +/* File categories etc are no business of users of ISAM-G (or what?) */ +typedef struct ISAMG_filecat_s { /* filecategories, mostly block sizes */ + int bsize; /* block size */ + int mblocks; /* maximum keys before switching to larger sizes */ +} *ISAMG_filecat; +#endif + + +#ifdef SKIPTHIS +/* The (delta?)encoding will be encapsulated so deep in the isams that */ +/* nobody needs to see it here... If different encodings needed, make */ +/* new isam types! */ + +typedef struct ISAMG_M_s { + ISAMG_filecat filecat; + + int (*compare_item)(const void *a, const void *b); + +#define ISAMG_DECODE 0 +#define ISAMG_ENCODE 1 + void *(*code_start)(int mode); + void (*code_stop)(int mode, void *p); + void (*code_item)(int mode, void *p, char **dst, char **src); + void (*code_reset)(void *p); + + int max_blocks_mem; + int debug; +} *ISAMG_M; +#endif + +#ifdef SKIPTHIS +/* Is this needed? Shouldn't they all be using the same encapsulation */ + +typedef struct ISAMG_I_s { /* encapsulation of input data */ + int (*read_item)(void *clientData, char **dst, int *insertMode); + void *clientData; +} *ISAMG_I; +#endif + +#ifdef SKIPTHIS +ISAMG_M isamg_getmethod (ISAMG_M me); +/* Does anyone really need this method thing ?? */ +#endif + +ISAMG isamg_open (BFiles bfs, int writeflag, char *isam_type_name, Res res); + +int isamg_close (ISAMG is); + +ISAMG_P isamg_append (ISAMG is, ISAMG_P pos, ISAMG_I data); +/* This may be difficult to generalize! */ + + +ISAMG_PP isamg_pp_open (ISAMG is, ISAMG_P pos); +void isamg_pp_close (ISAMG_PP pp); +/* int isamg_read_item (ISAMG_PP pp, char **dst); */ +/* int isamg_read_main_item (ISAMG_PP pp, char **dst); */ +int isamg_pp_read (ISAMG_PP pp, void *buf); +int isamg_pp_num (ISAMG_PP pp); + +#ifdef SKIPTHIS +/* all internal stuff */ +int isamg_block_used (ISAMG is, int type); +int isamg_block_size (ISAMG is, int type); + + +#define isamg_type(x) ((x) & 7) +#define isamg_block(x) ((x) >> 3) +#define isamg_addr(blk,typ) (((blk)<<3)+(typ)) + +void isamg_buildfirstblock(ISAMG_PP pp); +void isamg_buildlaterblock(ISAMG_PP pp); +#endif + +YAZ_END_CDECL + +#endif /* ISAMG_H */ + + +/* + * $Log: isamg.h,v $ + * Revision 1.1 2001-01-16 19:05:11 heikki + * Started to add isamg + * + * + * + */