X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=include%2Fidzebra%2Fdict.h;h=9b6f9d4eeeba3885fb02be9bc6c6f86733f7278f;hp=f4be95ed3967f82d01b1f415bd95440b472e0cba;hb=a5c8c78e8671af863fc61b2ad8b24f92f827f7b2;hpb=861a4414a4a0d1d1076f97fe8105b0a3a3ab4a31 diff --git a/include/idzebra/dict.h b/include/idzebra/dict.h index f4be95e..9b6f9d4 100644 --- a/include/idzebra/dict.h +++ b/include/idzebra/dict.h @@ -1,8 +1,5 @@ -/* $Id: dict.h,v 1.9 2006-08-29 13:36:26 adam Exp $ - Copyright (C) 1995-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1994-2011 Index Data 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 @@ -133,7 +130,7 @@ int dict_lookup_ec(Dict dict, char *p, int range, int (*f)(char *name)); \param max_pos on return holds maximum number of chars that match (prefix) \param init_pos number of leading non-error corrected chars. \param f function be called for each match - \retval 0 Operation complete. + \retval 0 Operation complete. Function f returned zero value always \retval >0 Operation incomplete. Function f returned a non-zero value \retval -1 error (such as bad regular expression) @@ -153,9 +150,12 @@ int dict_lookup_grep(Dict dict, const char *p, int range, void *client, \param after number of terms to be visited following str \param client client data pointer to be passed to match function f \param f function be called for each matching term - \retval 0 OK, and no terms visited - \retval 1 OK, and some terms have been visited + \retval 0 Successful \retval -1 error + + If the callback function f returns 0 the scan operation visits + all terms in range (before to after); if the function returns non-zero + the scan operation is cancelled. */ YAZ_EXPORT int dict_scan(Dict dict, char *str, @@ -184,13 +184,42 @@ void dict_grep_cmap(Dict dict, void *vp, YAZ_EXPORT int dict_copy_compact(BFiles bfs, const char *from, const char *to); +/** \brief reset Dictionary (makes it empty) + \param dict dictionary handle +*/ +YAZ_EXPORT +void dict_clean(Dict dict); + +/** \brief get number of lookup operations, since dict_open + \param dict dictionary handle + \returns number of operatons +*/ +YAZ_EXPORT +zint dict_get_no_lookup(Dict dict); + +/** \brief get number of insert operations, since dict_open + \param dict dictionary handle + \returns number of operatons +*/ +YAZ_EXPORT +zint dict_get_no_insert(Dict dict); + +/** \brief get number of page split operations, since dict_open + \param dict dictionary handle + \returns number of operatons +*/ +YAZ_EXPORT +zint dict_get_no_split(Dict dict); + YAZ_END_CDECL #endif /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ +