1 | /**************************************************************************
|
---|
2 | *
|
---|
3 | * lists.h -- List processing functions for boolean queries
|
---|
4 | * Copyright (C) 1994 Neil Sharman, Alistair Moffat and Lachlan Andrew
|
---|
5 | *
|
---|
6 | * This program is free software; you can redistribute it and/or modify
|
---|
7 | * it under the terms of the GNU General Public License as published by
|
---|
8 | * the Free Software Foundation; either version 2 of the License, or
|
---|
9 | * (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This program is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | * GNU General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU General Public License
|
---|
17 | * along with this program; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
19 | *
|
---|
20 | * $Id: lists.h 3745 2003-02-20 21:20:24Z mdewsnip $
|
---|
21 | *
|
---|
22 | **************************************************************************/
|
---|
23 |
|
---|
24 |
|
---|
25 | #ifndef H_LISTS
|
---|
26 | #define H_LISTS
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 | typedef struct DocEntry
|
---|
31 | {
|
---|
32 | float Weight;
|
---|
33 | int DocNum;
|
---|
34 | unsigned long SeekPos; /* position in the text file in bytes */
|
---|
35 | unsigned long Len; /* length of the document in bytes */
|
---|
36 | char *CompTextBuffer;
|
---|
37 | struct DocEntry *Next;
|
---|
38 | short or_included; /*[TS:Mar/95] whether included in an AND of ORed-terms */
|
---|
39 | }
|
---|
40 | DocEntry;
|
---|
41 |
|
---|
42 | typedef struct DocList
|
---|
43 | {
|
---|
44 | int num;
|
---|
45 | int total_retrieved; /* valid if > 0 */
|
---|
46 | int is_approx; /* whether total_retrieved is approximate */
|
---|
47 | DocEntry DE[1];
|
---|
48 | }
|
---|
49 | DocList;
|
---|
50 |
|
---|
51 | DocList *MakeDocList (int num);
|
---|
52 | DocList *ResizeDocList (DocList * d, int num);
|
---|
53 | DocList *IntersectLists (DocList * List1, DocList * List2);
|
---|
54 | DocList *DiffLists (DocList * List1, DocList * List2);
|
---|
55 | DocList *MergeLists (DocList * List1, DocList * List2);
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 | #endif
|
---|