2 * Copyright (c) 1987-2009 by the citadel.org team
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 void open_databases (void);
24 void close_databases (void);
25 int cdb_store (int cdb, const void *key, int keylen, void *data, int datalen);
26 int cdb_delete (int cdb, void *key, int keylen);
27 struct cdbdata *cdb_fetch (int cdb, const void *key, int keylen);
28 void cdb_free (struct cdbdata *cdb);
29 void cdb_rewind (int cdb);
30 struct cdbdata *cdb_next_item (int cdb);
31 void cdb_close_cursor(int cdb);
32 void cdb_begin_transaction(void);
33 void cdb_end_transaction(void);
34 void cdb_allocate_tsd(void);
35 void cdb_free_tsd(void);
36 void cdb_check_handles(void);
37 void cdb_trunc(int cdb);
38 void *checkpoint_thread(void *arg);
39 void cdb_chmod_data(void);
40 void cdb_checkpoint(void);
41 void check_handles(void *arg);
44 * Database records beginning with this magic number are assumed to
45 * be compressed. In the event that a database record actually begins with
46 * this magic number, we *must* compress it whether we want to or not,
47 * because the fetch function will try to uncompress it anyway.
49 * (No need to #ifdef this stuff; it compiles ok even if zlib is not present
50 * and doesn't declare anything so it won't bloat the code)
52 #define COMPRESS_MAGIC 0xc0ffeeee
54 struct CtdlCompressHeader {
56 size_t uncompressed_len;
57 size_t compressed_len;
60 #endif /* DATABASE_H */