"Fossies" - the Fresh Open Source Software Archive

Member "citadel/database.h" (5 Jun 2021, 1859 Bytes) of package /linux/www/citadel.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "database.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 9.01_vs_902.

    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 
   17 void open_databases (void);
   18 void close_databases (void);
   19 int cdb_store (int cdb, const void *key, int keylen, void *data, int datalen);
   20 int cdb_delete (int cdb, void *key, int keylen);
   21 struct cdbdata *cdb_fetch (int cdb, const void *key, int keylen);
   22 void cdb_free (struct cdbdata *cdb);
   23 void cdb_rewind (int cdb);
   24 struct cdbdata *cdb_next_item (int cdb);
   25 void cdb_close_cursor(int cdb);
   26 void cdb_begin_transaction(void);
   27 void cdb_end_transaction(void);
   28 void cdb_allocate_tsd(void);
   29 void cdb_free_tsd(void);
   30 void cdb_check_handles(void);
   31 void cdb_trunc(int cdb);
   32 void *checkpoint_thread(void *arg);
   33 void cdb_chmod_data(void);
   34 void cdb_checkpoint(void);
   35 void check_handles(void *arg);
   36 void cdb_cull_logs(void);
   37 void 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 
   51 struct CtdlCompressHeader {
   52     int magic;
   53     size_t uncompressed_len;
   54     size_t compressed_len;
   55 };
   56 
   57 int CheckIfAlreadySeen(StrBuf *guid);
   58 
   59 #endif /* DATABASE_H */
   60