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