X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fisamd.h;h=f6994483f6f146ea9ac4f419b2d557d41fd5d0c7;hb=79176bd8a477e1c64ac3ec03b50405ed5ed85a3f;hp=cf3c0ccf7434cf9ed47c338a031be1f8497e3ef2;hpb=e8f4cf34c75ffdc7bbfaf3fa232f29cc1384b60c;p=idzebra-moved-to-github.git diff --git a/include/isamd.h b/include/isamd.h index cf3c0cc..f699448 100644 --- a/include/isamd.h +++ b/include/isamd.h @@ -1,25 +1,33 @@ -/* - * Copyright (c) 1995-1997, Index Data. - * See the file LICENSE for details. - * - * IsamH is a simple ISAM that can only append to the end of the list. - * It will need a clean-up process occasionally... Code stolen from - * isamc... - * - * Heikki Levanto - * - * Detailed log at the end of the file - * - */ +/* $Id$ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 + Index Data Aps + +This file is part of the Zebra server. + +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 +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with Zebra; see the file LICENSE.zebra. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +*/ + + #ifndef ISAMD_H #define ISAMD_H #include -#ifdef __cplusplus -extern "C" { -#endif +YAZ_BEGIN_CDECL typedef struct ISAMD_s *ISAMD; typedef int ISAMD_P; @@ -55,13 +63,22 @@ ISAMD_M isamd_getmethod (ISAMD_M me); ISAMD isamd_open (BFiles bfs, const char *name, int writeflag, ISAMD_M method); int isamd_close (ISAMD is); -ISAMD_P isamd_append (ISAMD is, ISAMD_P pos, ISAMD_I data); - /* corresponds to isc_merge */ +/*ISAMD_P isamd_append (ISAMD is, ISAMD_P pos, ISAMD_I data);*/ +int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data); + -ISAMD_PP isamd_pp_open (ISAMD is, ISAMD_P pos); +/* Shortcut: If the isam is relatively short, we store the */ +/* whole thing in the dictionary, and allocate no blocks at all! */ +#define ISAMD_MAX_DICT_LEN 16 + +/*ISAMD_PP isamd_pp_open (ISAMD is, const char *dictbuf);*/ +ISAMD_PP isamd_pp_open (ISAMD is, const char *dictbuf, int dictlen); +ISAMD_PP isamd_pp_create (ISAMD is, int cat); + void isamd_pp_close (ISAMD_PP pp); int isamd_read_item (ISAMD_PP pp, char **dst); +int isamd_read_main_item (ISAMD_PP pp, char **dst); int isamd_pp_read (ISAMD_PP pp, void *buf); int isamd_pp_num (ISAMD_PP pp); @@ -76,15 +93,19 @@ int isamd_block_size (ISAMD is, int type); void isamd_buildfirstblock(ISAMD_PP pp); void isamd_buildlaterblock(ISAMD_PP pp); -#ifdef __cplusplus -} -#endif +YAZ_END_CDECL #endif /* ISAMD_H */ /* * $Log: isamd.h,v $ + * Revision 1.3 1999/08/18 08:33:41 heikki + * Fixes + * + * Revision 1.2 1999/07/14 13:21:34 heikki + * Added isam-d files. Compiles (almost) clean. Doesn't work at all + * * Revision 1.1 1999/07/14 12:34:43 heikki * Copied from isamh, starting to change things... *