C++ compilation.
[idzebra-moved-to-github.git] / index / recindxp.h
1 /*
2  * Copyright (C) 1994-1999, Index Data
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: recindxp.h,v $
7  * Revision 1.6  1999-05-26 07:49:13  adam
8  * C++ compilation.
9  *
10  * Revision 1.5  1999/02/02 14:51:05  adam
11  * Updated WIN32 code specific sections. Changed header.
12  *
13  * Revision 1.4  1998/03/05 08:45:12  adam
14  * New result set model and modular ranking system. Moved towards
15  * descent server API. System information stored as "SGML" records.
16  *
17  * Revision 1.3  1995/12/11 11:45:55  adam
18  * Removed commented code.
19  *
20  * Revision 1.2  1995/12/11  09:12:51  adam
21  * The rec_get function returns NULL if record doesn't exist - will
22  * happen in the server if the result set records have been deleted since
23  * the creation of the set (i.e. the search).
24  * The server saves a result temporarily if it is 'volatile', i.e. the
25  * set is register dependent.
26  *
27  * Revision 1.1  1995/12/06  12:41:25  adam
28  * New command 'stat' for the index program.
29  * Filenames can be read from stdin by specifying '-'.
30  * Bug fix/enhancement of the transformation from terms to regular
31  * expressons in the search engine.
32  *
33  */
34
35 #include "recindex.h"
36
37 #include <bfile.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 #define REC_BLOCK_TYPES 2
44 #define REC_HEAD_MAGIC "recindx"
45
46 struct records_info {
47     int rw;
48
49     char *index_fname;
50     BFile index_BFile;
51
52     char *data_fname[REC_BLOCK_TYPES];
53     BFile data_BFile[REC_BLOCK_TYPES];
54
55     char *tmp_buf;
56     int tmp_size;
57
58     struct record_cache_entry *record_cache;
59     int cache_size;
60     int cache_cur;
61     int cache_max;
62
63     struct records_head {
64         char magic[8];
65         int block_size[REC_BLOCK_TYPES];
66         int block_free[REC_BLOCK_TYPES];
67         int block_last[REC_BLOCK_TYPES];
68         int block_used[REC_BLOCK_TYPES];
69         int block_move[REC_BLOCK_TYPES];
70
71         int total_bytes;
72         int index_last;
73         int index_free;
74         int no_records;
75
76     } head;
77 };
78
79 enum recordCacheFlag { recordFlagNop, recordFlagWrite, recordFlagNew,
80                        recordFlagDelete };
81
82 struct record_cache_entry {
83     Record rec;
84     enum recordCacheFlag flag;
85 };
86
87 struct record_index_entry {
88     int next;         /* first block of record info / next free entry */
89     int size;         /* size of record or 0 if free entry */
90 };
91
92 #ifdef __cplusplus
93 }
94 #endif