xapian-core  1.4.21
Macros | Functions
chert_btreebase.cc File Reference
#include <config.h>
#include <xapian/error.h>
#include "chert_btreebase.h"
#include "errno_to_string.h"
#include "fd.h"
#include "io_utils.h"
#include "omassert.h"
#include "pack.h"
#include "posixy_wrapper.h"
#include "str.h"
#include <algorithm>
#include <cerrno>
#include <climits>
#include <cstring>
+ Include dependency graph for chert_btreebase.cc:

Go to the source code of this file.

Macros

#define CURR_FORMAT   5U
 This is the current description of the base file format: More...
 
#define DO_UNPACK_UINT_ERRCHECK(start, end, var)
 
#define REASONABLE_BASE_SIZE   1024
 
#define BIT_MAP_INC   1000
 

Functions

static bool do_unpack_uint (const char **start, const char *end, uint4 *dest, string &err_msg, const string &basename, const char *varname)
 Do most of the error handling from unpack_uint() More...
 
static bool do_unpack_uint (const char **start, const char *end, chert_tablesize_t *dest, string &err_msg, const string &basename, const char *varname)
 

Macro Definition Documentation

◆ BIT_MAP_INC

#define BIT_MAP_INC   1000

Definition at line 386 of file chert_btreebase.cc.

Referenced by ChertTable_base::extend_bit_map().

◆ CURR_FORMAT

#define CURR_FORMAT   5U

This is the current description of the base file format:

Numbers are (unless mentioned otherwise) stored in the variable length format used by pack_uint() - that is 7 bits at a time in a byte, starting with lower-order bits, and setting the high bit on all bytes before the last one.

The format consists of a sequence of numbers in this order:

REVISION FORMAT will be = CURR_FORMAT for the current format. If this value higher then it is a different format which we doesn't yet understand, so we bomb out. If it's lower, then it depends if we have backwards-compatibility code implemented (we don't for format versions < 5). BLOCK_SIZE ROOT LEVEL BIT_MAP_SIZE ITEM_COUNT LAST_BLOCK HAVE_FAKEROOT SEQUENTIAL REVISION2 A second copy of the revision number, for consistency checks. BITMAP The bitmap. This will be BIT_MAP_SIZE raw bytes. REVISION3 A third copy of the revision number, for consistency checks.

Definition at line 72 of file chert_btreebase.cc.

Referenced by ChertTable_base::read(), and ChertTable_base::write_to_file().

◆ DO_UNPACK_UINT_ERRCHECK

#define DO_UNPACK_UINT_ERRCHECK (   start,
  end,
  var 
)
Value:
do { \
if (!do_unpack_uint(start, end, &var, err_msg, basename, #var)) { \
return false; \
} \
} while (0)
static bool do_unpack_uint(const char **start, const char *end, uint4 *dest, string &err_msg, const string &basename, const char *varname)
Do most of the error handling from unpack_uint()

Definition at line 150 of file chert_btreebase.cc.

Referenced by ChertTable_base::read().

◆ REASONABLE_BASE_SIZE

#define REASONABLE_BASE_SIZE   1024

Definition at line 163 of file chert_btreebase.cc.

Referenced by ChertTable_base::read().

Function Documentation

◆ do_unpack_uint() [1/2]

static bool do_unpack_uint ( const char **  start,
const char *  end,
uint4 dest,
string &  err_msg,
const string &  basename,
const char *  varname 
)
static

Do most of the error handling from unpack_uint()

Definition at line 117 of file chert_btreebase.cc.

References rare, and unpack_uint().

◆ do_unpack_uint() [2/2]

static bool do_unpack_uint ( const char **  start,
const char *  end,
chert_tablesize_t dest,
string &  err_msg,
const string &  basename,
const char *  varname 
)
static

Definition at line 134 of file chert_btreebase.cc.

References rare, and unpack_uint().