1 /* $Id: recindex.h,v 1.29 2006-09-15 10:45:13 adam Exp $
2 Copyright (C) 1995-2006
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <idzebra/util.h>
27 #include <zebra-lock.h>
28 #include <idzebra/bfile.h>
34 typedef struct record_info {
37 char *info[REC_NO_INFO];
38 size_t size[REC_NO_INFO];
39 char buf_size[REC_NO_INFO][6];
40 size_t size_size[REC_NO_INFO];
44 typedef struct records_info *Records;
46 /** \brief marks record for deletion (on file storage)
47 \param p records handle
48 \param recpp record pointer
49 \returns ZEBRA_OK / ZEBRA_FAIL
51 ZEBRA_RES rec_del(Records p, Record *recpp);
53 /** \brief frees record (from memory)
54 \param recpp record pointer
56 void rec_free(Record *recpp);
58 /** \brief puts record (writes into file storage)
59 \param p records handle
60 \param recpp record pointer
61 \returns ZEBRA_OK / ZEBRA_FAIL
63 ZEBRA_RES rec_put(Records p, Record *recpp);
65 /** \brief creates new record (to be written to file storage)
66 \param p records handle
67 \returns record pointer (or NULL on error)
69 Record rec_new(Records p);
70 /** \brief gets record - with given system number
71 \param p records handle
72 \param sysno system ID (external number)
73 \returns record pointer (or NULL on error)
75 Record rec_get(Records p, SYSNO sysno);
77 /** \brief gets root record
78 \param p records handle
79 \returns record pointer (or NULL on error)
81 Record rec_get_root(Records p);
82 ZEBRA_RES rec_close (Records *p);
84 /** \brief opens records system
85 \param bfs block file storage
86 \param rw read-write flag(0=read only, 1=write)
87 \param compression_method REC_COMPRESS_ type
89 Records rec_open(BFiles bfs, int rw, int compression_method);
91 char *rec_strdup(const char *s, size_t *len);
92 void rec_prstat(Records p);
94 SYSNO rec_sysno_to_int(SYSNO sysno);
96 /** \brief compression types */
97 #define REC_COMPRESS_NONE 0
98 #define REC_COMPRESS_BZIP2 1
104 recInfo_databaseName,
115 * indent-tabs-mode: nil
117 * vim: shiftwidth=4 tabstop=8 expandtab