Omit CVS Id. Update copyright year.
[idzebra-moved-to-github.git] / index / rank.h
1 /* This file is part of the Zebra server.
2    Copyright (C) 1995-2008 Index Data
3
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 */
19
20 #ifndef RANK_H
21 #define RANK_H
22
23 #include <idzebra/api.h>
24
25 YAZ_BEGIN_CDECL
26
27 struct rank_control {
28     char *name;
29     void *(*create)(ZebraHandle zh);
30     void (*destroy)(struct zebra_register *reg, void *class_handle);
31     void *(*begin)(struct zebra_register *reg, 
32                    void *class_handle, RSET rset, NMEM nmem,
33                    TERMID *terms, int numterms);
34     /* ### Could add parameters to begin:
35      *  char *index;    // author, title, etc.
36      *  int dbsize;     // number of records in database
37      *  int rssize;     // number of records in result set (estimate?)
38      */
39     void (*end)(struct zebra_register *reg, void *set_handle);
40     int (*calc)(void *set_handle, zint sysno, zint staticrank,
41                 int *stop_flag);
42     void (*add)(void *set_handle, int seqno, TERMID term);
43 };
44
45 void zebraRankInstall (struct zebra_register *reg, struct rank_control *ctrl);
46 ZebraRankClass zebraRankLookup (ZebraHandle zh, const char *name);
47 void zebraRankDestroy (struct zebra_register *reg);
48
49 /* declaring externally defined rank class structures */
50 /* remember to install rank classes in zebraapi.c as well!! */
51 extern struct rank_control *rank_1_class;
52 extern struct rank_control *rank_zv_class;
53 extern struct rank_control *rank_static_class;
54 extern struct rank_control *rank_similarity_class;
55
56
57
58 YAZ_END_CDECL
59
60 #endif
61 /*
62  * Local variables:
63  * c-basic-offset: 4
64  * indent-tabs-mode: nil
65  * End:
66  * vim: shiftwidth=4 tabstop=8 expandtab
67  */
68