Here it is, the new thread interface.
[citadel.git] / citadel / database.h
1 /* $Id$ */
2 void defrag_databases (void);
3 void open_databases (void);
4 void close_databases (void);
5 int cdb_store (int cdb, void *key, int keylen, void *data, int datalen);
6 int cdb_delete (int cdb, void *key, int keylen);
7 struct cdbdata *cdb_fetch (int cdb, void *key, int keylen);
8 void cdb_free (struct cdbdata *cdb);
9 void cdb_rewind (int cdb);
10 struct cdbdata *cdb_next_item (int cdb);
11 void cdb_close_cursor(int cdb);
12 void cdb_begin_transaction(void);
13 void cdb_end_transaction(void);
14 void cdb_allocate_tsd(void);
15 void cdb_free_tsd(void);
16 void cdb_check_handles(void);
17 void cdb_trunc(int cdb);
18 void *checkpoint_thread(void *arg);
19 void cdb_chmod_data(void);
20 void cdb_checkpoint(void);
21
22 /*
23  * Database records beginning with this magic number are assumed to
24  * be compressed.  In the event that a database record actually begins with
25  * this magic number, we *must* compress it whether we want to or not,
26  * because the fetch function will try to uncompress it anyway.
27  * 
28  * (No need to #ifdef this stuff; it compiles ok even if zlib is not present
29  * and doesn't declare anything so it won't bloat the code)
30  */
31 #define COMPRESS_MAGIC  0xc0ffeeee
32
33 struct CtdlCompressHeader {
34         int magic;
35         size_t uncompressed_len;
36         size_t compressed_len;
37 };
38
39