New command 'stat' for the index program.
[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.1  1995-12-06 12:41:25  adam
8  * New command 'stat' for the index program.
9  * Filenames can be read from stdin by specifying '-'.
10  * Bug fix/enhancement of the transformation from terms to regular
11  * expressons in the search engine.
12  *
13  */
14
15 #include "recindex.h"
16
17 #include <bfile.h>
18
19 #define REC_BLOCK_TYPES 2
20 #define REC_HEAD_MAGIC "recindx"
21
22 struct records_info {
23     int rw;
24
25     char *index_fname;
26     BFile index_BFile;
27
28
29     char *data_fname[REC_BLOCK_TYPES];
30     BFile data_BFile[REC_BLOCK_TYPES];
31
32     char *tmp_buf;
33     int tmp_size;
34
35     struct record_cache_entry *record_cache;
36     int cache_size;
37     int cache_cur;
38     int cache_max;
39
40     struct records_head {
41         char magic[8];
42         int block_size[REC_BLOCK_TYPES];
43         int block_free[REC_BLOCK_TYPES];
44         int block_last[REC_BLOCK_TYPES];
45         int block_used[REC_BLOCK_TYPES];
46         int block_move[REC_BLOCK_TYPES];
47
48         int total_bytes;
49         int index_last;
50         int index_free;
51         int no_records;
52
53     } head;
54 };
55
56 enum recordCacheFlag { recordFlagNop, recordFlagWrite, recordFlagNew,
57                        recordFlagDelete };
58
59 struct record_cache_entry {
60     Record rec;
61     enum recordCacheFlag flag;
62 };
63
64 struct record_index_entry {
65     union {
66         struct {
67             int next;
68             int size;
69         } used;
70         struct {
71             int next;
72         } free;
73     } u;
74 };
75