X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fisam.h;h=c667175c4d53241b5ec7e6f56905dc13c8f94c7d;hb=85a2a0b28cb516d28ac70b7824f2b7d4b07e56ae;hp=dd70f69be0d8234de131e6c33967264f7a82d50f;hpb=c6c40893444f2288cdea91d30dd92df0f285e67d;p=idzebra-moved-to-github.git diff --git a/include/isam.h b/include/isam.h index dd70f69..c667175 100644 --- a/include/isam.h +++ b/include/isam.h @@ -1,10 +1,42 @@ /* - * Copyright (C) 1994, Index Data I/S + * Copyright (C) 1994-1997, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: isam.h,v $ - * Revision 1.3 1994-09-26 16:08:42 quinn + * Revision 1.13 1997-09-17 12:19:09 adam + * Zebra version corresponds to YAZ version 1.4. + * Changed Zebra server so that it doesn't depend on global common_resource. + * + * Revision 1.12 1997/09/05 15:30:00 adam + * Changed prototype for chr_map_input - added const. + * Added support for C++, headers uses extern "C" for public definitions. + * + * Revision 1.11 1996/10/29 13:43:44 adam + * Removed definition of SYSNO. + * + * Revision 1.10 1995/09/06 16:10:57 adam + * More work on boolean sets. + * + * Revision 1.9 1994/09/28 16:58:26 quinn + * Small mod. + * + * Revision 1.8 1994/09/28 12:56:09 quinn + * Added access functions (ISPT) + * + * Revision 1.7 1994/09/28 11:56:13 quinn + * Removed const from input to is_merge + * + * Revision 1.6 1994/09/28 11:29:28 quinn + * Added cmp parameter. + * + * Revision 1.5 1994/09/27 20:03:36 quinn + * Seems relatively bug-free. + * + * Revision 1.4 1994/09/26 17:05:54 quinn + * Trivial. + * + * Revision 1.3 1994/09/26 16:08:42 quinn * Most of the functionality in place. * * Revision 1.2 1994/09/14 13:10:35 quinn @@ -18,16 +50,20 @@ #ifndef ISAM_H #define ISAM_H +#include #include -#include + +#include "../isam/memory.h" +#include "../isam/physical.h" + +#ifdef __cplusplus +extern "C" { +#endif #define IS_MAX_BLOCKTYPES 4 #define IS_MAX_RECORD 512 #define IS_DEF_REPACK_PERCENT "30" /* how much relative change before repack */ -typedef unsigned int SYSNO; /* should be somewhere else */ -typedef unsigned int ISAM_P; - /* * Description of a blocktype (part of an isam file) */ @@ -40,7 +76,7 @@ typedef struct isam_blocktype int max_keys_block0; /* max num of keys in first block */ int nice_keys_block; /* nice number of keys per block */ int max_keys; /* max number of keys per table */ - int freelist; /* fist free block */ + int freelist; /* first free block */ int top; /* first unused block */ int index; /* placeholder. Always 0. */ char *dbuf; /* buffer for use in I/O operations */ @@ -57,13 +93,11 @@ typedef struct isam_struct int keysize; /* size of the keys (records) used */ int repack; /* how many percent to grow before repack */ int (*cmp)(const void *k1, const void *k2); /* compare function */ -} isam_struct, *ISAM; +} isam_struct; typedef struct ispt_struct { - ISAM is; /* which file do we belong to? */ - int ptr; /* current key offset */ - + struct is_mtable tab; struct ispt_struct *next; /* freelist */ } ispt_struct, *ISPT; @@ -80,7 +114,9 @@ typedef struct ispt_struct /* * Open isam file. */ -ISAM is_open(const char *name, int writeflag); +ISAM is_open(BFiles bfs, const char *name, + int (*cmp)(const void *p1, const void *p2), + int writeflag, int keysize, Res res); /* * Close isam file. @@ -105,6 +141,14 @@ int is_readkey(ISPT ip, void *buf); int is_writekey(ISPT ip, const void *buf); -ISAM_P is_merge(ISAM is, ISAM_P pos, int num, const char *data); +int is_numkeys(ISPT ip); + +void is_rewind(ISPT ip); + +ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data); + +#ifdef __cplusplus +} +#endif #endif