citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

database.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 1987-2017 by the citadel.org team
3 *
4 * This program is open source software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef DATABASE_H
14#define DATABASE_H
15
16
17void open_databases (void);
18void close_databases (void);
19int cdb_store (int cdb, const void *key, int keylen, void *data, int datalen);
20int cdb_delete (int cdb, void *key, int keylen);
21struct cdbdata *cdb_fetch (int cdb, const void *key, int keylen);
22void cdb_free (struct cdbdata *cdb);
23void cdb_rewind (int cdb);
24struct cdbdata *cdb_next_item (int cdb);
25void cdb_close_cursor(int cdb);
26void cdb_begin_transaction(void);
27void cdb_end_transaction(void);
29void cdb_free_tsd(void);
30void cdb_check_handles(void);
31void cdb_trunc(int cdb);
32void *checkpoint_thread(void *arg);
33void cdb_chmod_data(void);
34void cdb_checkpoint(void);
35void check_handles(void *arg);
36void cdb_cull_logs(void);
37void cdb_compact(void);
38
39
40/*
41 * Database records beginning with this magic number are assumed to
42 * be compressed. In the event that a database record actually begins with
43 * this magic number, we *must* compress it whether we want to or not,
44 * because the fetch function will try to uncompress it anyway.
45 *
46 * (No need to #ifdef this stuff; it compiles ok even if zlib is not present
47 * and doesn't declare anything so it won't bloat the code)
48 */
49#define COMPRESS_MAGIC 0xc0ffeeee
50
52 int magic;
55};
56
57int CheckIfAlreadySeen(StrBuf *guid);
58
59#endif /* DATABASE_H */
60
void cdb_checkpoint(void)
Definition: database.c:150
void cdb_check_handles(void)
Definition: database.c:137
void cdb_free_tsd(void)
void cdb_close_cursor(int cdb)
Definition: database.c:617
void cdb_cull_logs(void)
void cdb_free(struct cdbdata *cdb)
Definition: database.c:609
void * checkpoint_thread(void *arg)
void check_handles(void *arg)
struct cdbdata * cdb_next_item(int cdb)
Definition: database.c:655
void cdb_begin_transaction(void)
Definition: database.c:688
void cdb_allocate_tsd(void)
void cdb_chmod_data(void)
Definition: database.c:285
void open_databases(void)
Definition: database.c:177
int cdb_store(int cdb, const void *key, int keylen, void *data, int datalen)
Definition: database.c:397
struct cdbdata * cdb_fetch(int cdb, const void *key, int keylen)
Definition: database.c:546
int cdb_delete(int cdb, void *key, int keylen)
Definition: database.c:482
void close_databases(void)
Definition: database.c:310
void cdb_trunc(int cdb)
Definition: database.c:726
void cdb_rewind(int cdb)
Definition: database.c:631
void cdb_end_transaction(void)
Definition: database.c:700
int CheckIfAlreadySeen(StrBuf *guid)
Definition: database.c:783
void cdb_compact(void)
Definition: database.c:764
size_t compressed_len
Definition: database.h:54
size_t uncompressed_len
Definition: database.h:53