X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=include%2Frset.h;h=971029a925ce1b7bb08ba15ff93788108102713d;hp=ccc66ba52aa3a5936d1e8a6add8dbfefe0906640;hb=ca8ea9b7dfba1b20033345d996ade40d1e94159b;hpb=27742a4ea82e9b3494c166203b06d1d7c48da923 diff --git a/include/rset.h b/include/rset.h index ccc66ba..971029a 100644 --- a/include/rset.h +++ b/include/rset.h @@ -1,8 +1,5 @@ -/* $Id: rset.h,v 1.59 2006-06-06 21:01:30 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) 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 @@ -15,9 +12,9 @@ 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. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ #ifndef RSET_H @@ -26,9 +23,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include /* unfortunately we need the isam includes here, for the arguments for */ /* rsisamX_create */ -#include -#include -#include +#include +#include +#include YAZ_BEGIN_CDECL @@ -43,9 +40,10 @@ struct ord_list { struct ord_list *ord_list_create(NMEM nmem); struct ord_list *ord_list_append(NMEM nmem, struct ord_list *list, int ord); struct ord_list *ord_list_dup(NMEM nmem, struct ord_list *list); +void ord_list_print(struct ord_list *list); -/** - * rset_term is all we need to know of a term to do ranking etc. +/** + * rset_term is all we need to know of a term to do ranking etc. * As far as the rsets are concerned, it is just a dummy pointer to * be passed around. */ @@ -66,7 +64,7 @@ struct rset_term { struct ord_list *ol; }; -typedef struct rset_term *TERMID; +typedef struct rset_term *TERMID; TERMID rset_term_create (const char *name, int length, const char *flags, int type, NMEM nmem, struct ord_list *ol, int reg_type, zint hits_limit, const char *ref_id); @@ -81,7 +79,7 @@ struct rsfd { /* the stuff common to all rsfd's. */ }; -/** +/** * rset_control has function pointers to all the important functions * of a rset. Each type of rset will have its own control block, pointing * to the functions for that type. They all have their own create function @@ -91,7 +89,7 @@ struct rsfd { /* the stuff common to all rsfd's. */ struct rset_control { /** text description of set type (for debugging) */ - char *desc; + char *desc; /* RSET rs_something_create(const struct rset_control *sel, ...); */ void (*f_delete)(RSET ct); @@ -120,7 +118,7 @@ int rset_default_read(RSFD rfd, void *buf, TERMID *term); void rset_get_one_term(RSET ct,TERMID *terms,int maxterms,int *curterm); /** - * key_control contains all there is to know about the keys stored in + * key_control contains all there is to know about the keys stored in * an isam, and therefore operated by the rsets. Other than this info, * all we assume is that all keys are the same size, and they can be * memcpy'd around @@ -133,6 +131,7 @@ struct rset_key_control { int (*cmp)(const void *p1, const void *p2); void (*key_logdump_txt) (int logmask, const void *p, const char *txt); zint (*getseq)(const void *p); + zint (*get_segment)(const void *p); int (*filter_func)(const void *p, void *data); void *filter_data; void (*inc)(struct rset_key_control *kc); @@ -164,9 +163,9 @@ typedef struct rset zint hits_limit; zint hits_count; zint hits_round; - int hits_approx; + int hits_approx; } rset; -/* rset is a "virtual base class", which will never exist on its own +/* rset is a "virtual base class", which will never exist on its own * all instances are rsets of some specific type, like rsisamb, or rsbool * They keep their own stuff behind the priv pointer. */ @@ -176,8 +175,8 @@ typedef struct rset * In more complex isams we can specify on what level we wish to do the * matching and counting of hits. For example, we can have book / chapter / * verse, and a seqno. Scope 2 means then "give me all verses that match", - * 3 would be chapters, 4 books. - * The resolution tells how much of the occurences we need to return. If we + * 3 would be chapters, 4 books. + * The resolution tells how much of the occurences we need to return. If we * are doing some sort of proximity, we need to get the seqnos of all * occurences, whereas if we are only counting hits, we do not need anything * below the scope. Again 1 is seqnos, 2 sysnos (or verses), 3 books, etc. @@ -186,7 +185,7 @@ typedef struct rset RSFD rfd_create_base(RSET rs); int rfd_is_last(RSFD rfd); -RSET rset_create_base(const struct rset_control *sel, +RSET rset_create_base(const struct rset_control *sel, NMEM nmem, struct rset_key_control *kcontrol, int scope, @@ -235,7 +234,7 @@ RSET rset_create_not(NMEM nmem, struct rset_key_control *kcontrol, int scope, RSET rset_l, RSET rset_r); RSET rset_create_between(NMEM nmem, struct rset_key_control *kcontrol, - int scope, RSET rset_l, RSET rset_m, RSET rset_r, + int scope, RSET rset_l, RSET rset_m, RSET rset_r, RSET rset_attr); RSET rset_create_or(NMEM nmem, struct rset_key_control *kcontrol, @@ -259,12 +258,17 @@ RSET rsisams_create(NMEM nmem, struct rset_key_control *kcontrol, void rset_visit(RSET rset, int level); +void rset_set_hits_limit(RSET rs, zint l); + +int rset_no_write(RSFD rfd, const void *buf); + 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