IDZEBRA  2.2.7
recindex.h
Go to the documentation of this file.
1 /* This file is part of the Zebra server.
2  Copyright (C) Index Data
3 
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8 
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 
18 */
19 
20 #ifndef RECINDEX_H
21 #define RECINDEX_H
22 
23 #include <idzebra/util.h>
24 #include <zebra-lock.h>
25 #include <idzebra/bfile.h>
26 
27 YAZ_BEGIN_CDECL
28 
29 #define REC_NO_INFO 8
30 
31 typedef struct record_info {
33  int newFlag;
34  char *info[REC_NO_INFO];
35  size_t size[REC_NO_INFO];
39 } *Record;
40 
41 typedef struct records_info *Records;
42 
48 ZEBRA_RES rec_del(Records p, Record *recpp);
49 
53 void rec_free(Record *recpp);
54 
60 ZEBRA_RES rec_put(Records p, Record *recpp);
61 
72 Record rec_get(Records p, zint sysno);
73 
79 
80 
87 
89 
96 
103 
104 char *rec_strdup(const char *s, size_t *len);
105 void rec_prstat(Records p, int verbose);
106 
107 zint rec_sysno_to_int(zint sysno);
108 
109 
111 #define REC_COMPRESS_NONE 0
113 #define REC_COMPRESS_BZIP2 1
115 #define REC_COMPRESS_ZLIB 2
116 
117 
118 enum {
126 };
127 
128 typedef struct recindex *recindex_t;
129 
135 recindex_t recindex_open(BFiles bfs, int rw, int use_isamb);
136 
140 void recindex_close(recindex_t p);
141 int recindex_read_head(recindex_t p, void *buf);
142 const char *recindex_get_fname(recindex_t p);
143 ZEBRA_RES recindex_write_head(recindex_t p, const void *buf, size_t len);
144 int recindex_read_indx(recindex_t p, zint sysno, void *buf, int itemsize,
145  int ignoreError);
146 void recindex_write_indx(recindex_t p, zint sysno, void *buf, int itemsize);
147 
148 YAZ_END_CDECL
149 #endif
150 /*
151  * Local variables:
152  * c-basic-offset: 4
153  * c-file-style: "Stroustrup"
154  * indent-tabs-mode: nil
155  * End:
156  * vim: shiftwidth=4 tabstop=8 expandtab
157  */
158 
Zebra Block File Layer.
ZEBRA_RES rec_close(Records *p)
Definition: records.c:721
int recindex_read_indx(recindex_t p, zint sysno, void *buf, int itemsize, int ignoreError)
Definition: recindex.c:225
struct records_info * Records
Definition: recindex.h:41
void recindex_write_indx(recindex_t p, zint sysno, void *buf, int itemsize)
Definition: recindex.c:312
struct record_info * Record
zint rec_sysno_to_int(zint sysno)
Definition: records.c:130
Record rec_new(Records p)
creates new record (to be written to file storage)
Definition: records.c:991
Records rec_open(BFiles bfs, int rw, int compression_method)
opens records system
Definition: records.c:309
Record rec_get(Records p, zint sysno)
gets record - with given system number
Definition: records.c:928
ZEBRA_RES rec_put(Records p, Record *recpp)
puts record (writes into file storage)
Definition: records.c:1023
recindex_t recindex_open(BFiles bfs, int rw, int use_isamb)
opens record index handle
Definition: recindex.c:134
@ recInfo_databaseName
Definition: recindex.h:122
@ recInfo_filename
Definition: recindex.h:120
@ recInfo_delKeys
Definition: recindex.h:121
@ recInfo_fileType
Definition: recindex.h:119
@ recInfo_sortKeys
Definition: recindex.h:125
@ recInfo_attr
Definition: recindex.h:124
@ recInfo_storeData
Definition: recindex.h:123
void rec_prstat(Records p, int verbose)
Definition: records.c:1095
void recindex_close(recindex_t p)
closes record index handle
Definition: recindex.c:182
char * rec_strdup(const char *s, size_t *len)
Definition: records.c:1080
void rec_free(Record *recpp)
frees record (from memory)
Definition: records.c:1044
Record rec_get_next(Records p, Record rec)
gets next record - with given records
Definition: records.c:943
const char * recindex_get_fname(recindex_t p)
Definition: recindex.c:203
ZEBRA_RES recindex_write_head(recindex_t p, const void *buf, size_t len)
Definition: recindex.c:208
ZEBRA_RES rec_del(Records p, Record *recpp)
marks record for deletion (on file storage)
Definition: records.c:1001
#define REC_NO_INFO
Definition: recindex.h:29
int rec_check_compression_method(int compression_method)
check whether a compression method is supported
Definition: records.c:287
int recindex_read_head(recindex_t p, void *buf)
Definition: recindex.c:198
Record rec_get_root(Records p)
gets root record
Definition: records.c:938
struct recindex * recindex_t
Definition: recindex.h:128
size_t size_size[REC_NO_INFO]
Definition: recindex.h:37
char * info[REC_NO_INFO]
Definition: recindex.h:34
Zebra_mutex mutex
Definition: recindex.h:38
char buf_size[REC_NO_INFO][6]
Definition: recindex.h:36
size_t size[REC_NO_INFO]
Definition: recindex.h:35
int newFlag
Definition: recindex.h:33
zint sysno
Definition: recindex.h:32
int compression_method
Definition: records.c:61
long zint
Zebra integer.
Definition: util.h:66
short ZEBRA_RES
Common return type for Zebra API.
Definition: util.h:80