xapian-core  2.0.0
Namespaces | Macros | Variables
honey_version.cc File Reference

HoneyVersion class. More...

#include <config.h>
#include "honey_version.h"
#include "debuglog.h"
#include "fd.h"
#include "honey_defs.h"
#include "io_utils.h"
#include "min_non_zero.h"
#include "omassert.h"
#include "pack.h"
#include "posixy_wrapper.h"
#include "stringutils.h"
#include <cerrno>
#include <cstring>
#include <string>
#include <sys/types.h>
#include "safesysstat.h"
#include "safefcntl.h"
#include "safeunistd.h"
#include "str.h"
#include "backends/uuids.h"
#include "xapian/constants.h"
#include "xapian/error.h"
+ Include dependency graph for honey_version.cc:

Go to the source code of this file.

Namespaces

 Honey
 

Macros

#define HONEY_FORMAT_VERSION   DATE_TO_VERSION(2018,4,3)
 Honey format version (date of change): More...
 
#define DATE_TO_VERSION(Y, M, D)    ((unsigned(Y) - 2014) << 9 | unsigned(M) << 5 | unsigned(D))
 Convert date <-> version number. Dates up to 2141-12-31 fit in 2 bytes. More...
 
#define VERSION_TO_YEAR(V)   ((unsigned(V) >> 9) + 2014)
 
#define VERSION_TO_MONTH(V)   ((unsigned(V) >> 5) & 0x0f)
 
#define VERSION_TO_DAY(V)   (unsigned(V) & 0x1f)
 
#define HONEY_VERSION_MAGIC_LEN   14
 
#define HONEY_VERSION_MAGIC_AND_VERSION_LEN   16
 

Variables

static const char HONEY_VERSION_MAGIC [HONEY_VERSION_MAGIC_AND_VERSION_LEN]
 
const size_t COMPRESS_MIN = 18
 
static const uint4 compress_min_tab []
 

Detailed Description

HoneyVersion class.

Definition in file honey_version.cc.

Macro Definition Documentation

◆ DATE_TO_VERSION

#define DATE_TO_VERSION (   Y,
  M,
 
)     ((unsigned(Y) - 2014) << 9 | unsigned(M) << 5 | unsigned(D))

Convert date <-> version number. Dates up to 2141-12-31 fit in 2 bytes.

Definition at line 80 of file honey_version.cc.

◆ HONEY_FORMAT_VERSION

#define HONEY_FORMAT_VERSION   DATE_TO_VERSION(2018,4,3)

Honey format version (date of change):

Definition at line 54 of file honey_version.cc.

◆ HONEY_VERSION_MAGIC_AND_VERSION_LEN

#define HONEY_VERSION_MAGIC_AND_VERSION_LEN   16

Definition at line 87 of file honey_version.cc.

◆ HONEY_VERSION_MAGIC_LEN

#define HONEY_VERSION_MAGIC_LEN   14

Definition at line 86 of file honey_version.cc.

◆ VERSION_TO_DAY

#define VERSION_TO_DAY (   V)    (unsigned(V) & 0x1f)

Definition at line 84 of file honey_version.cc.

◆ VERSION_TO_MONTH

#define VERSION_TO_MONTH (   V)    ((unsigned(V) >> 5) & 0x0f)

Definition at line 83 of file honey_version.cc.

◆ VERSION_TO_YEAR

#define VERSION_TO_YEAR (   V)    ((unsigned(V) >> 9) + 2014)

Definition at line 82 of file honey_version.cc.

Variable Documentation

◆ COMPRESS_MIN

const size_t COMPRESS_MIN = 18

Definition at line 463 of file honey_version.cc.

Referenced by Honey::RootInfo::unserialise().

◆ compress_min_tab

const uint4 compress_min_tab[]
static
Initial value:
= {
0,
0,
}
const size_t COMPRESS_MIN

Definition at line 465 of file honey_version.cc.

Referenced by HoneyVersion::create().

◆ HONEY_VERSION_MAGIC

const char HONEY_VERSION_MAGIC[HONEY_VERSION_MAGIC_AND_VERSION_LEN]
static
Initial value:
= {
'\x0f', '\x0d', 'X', 'a', 'p', 'i', 'a', 'n', ' ', 'H', 'o', 'n', 'e', 'y',
char((HONEY_FORMAT_VERSION >> 8) & 0xff), char(HONEY_FORMAT_VERSION & 0xff)
}
#define HONEY_FORMAT_VERSION
Honey format version (date of change):

Definition at line 89 of file honey_version.cc.

Referenced by HoneyVersion::read(), and HoneyVersion::write().