Minor changes - removed include of ctype.h.
[idzebra-moved-to-github.git] / index / recstat.c
1 /*
2  * Copyright (C) 1994-1996, Index Data I/S 
3  * All rights reserved.
4  * Sebastian Hammer, Adam Dickmeiss
5  *
6  * $Log: recstat.c,v $
7  * Revision 1.3  1996-06-04 10:19:00  adam
8  * Minor changes - removed include of ctype.h.
9  *
10  * Revision 1.2  1996/05/14  14:04:34  adam
11  * In zebraidx, the 'stat' command is improved. Statistics about ISAM/DICT
12  * is collected.
13  *
14  * Revision 1.1  1995/12/06  12:41:26  adam
15  * New command 'stat' for the index program.
16  * Filenames can be read from stdin by specifying '-'.
17  * Bug fix/enhancement of the transformation from terms to regular
18  * expressons in the search engine.
19  *
20  */
21 #include <stdio.h>
22 #include <assert.h>
23 #include <string.h>
24 #include <fcntl.h>
25 #include <unistd.h>
26
27 #include "recindxp.h"
28
29 void rec_prstat (void)
30 {
31     Records records = rec_open (0);
32     int i;
33     int total_bytes = 0;
34     
35     logf (LOG_LOG,
36           "Total records                        %8d",
37           records->head.no_records);
38
39     for (i = 0; i< REC_BLOCK_TYPES; i++)
40     {
41         logf (LOG_LOG, "Record blocks of size %d",
42               records->head.block_size[i]);
43         logf (LOG_LOG,
44           " Used/Total/Bytes used            %d/%d/%d",
45               records->head.block_used[i], records->head.block_last[i]-1,
46               records->head.block_used[i] * records->head.block_size[i]);
47         total_bytes +=
48             records->head.block_used[i] * records->head.block_size[i];
49     }
50     logf (LOG_LOG,
51           "Total size of record index in bytes  %8d",
52           records->head.total_bytes);
53     logf (LOG_LOG,
54           "Total size with overhead             %8d", total_bytes);
55     rec_close (&records);
56 }