xapian-core  1.4.27
Namespaces | Macros | Variables
glass_version.cc File Reference

GlassVersion class. More...

#include <config.h>
#include "glass_version.h"
#include "debuglog.h"
#include "fd.h"
#include "io_utils.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 glass_version.cc:

Go to the source code of this file.

Namespaces

 Glass
 

Macros

#define GLASS_FORMAT_VERSION   DATE_TO_VERSION(2016,03,14)
 Glass 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 GLASS_VERSION_MAGIC_LEN   14
 
#define GLASS_VERSION_MAGIC_AND_VERSION_LEN   16
 

Variables

static const char GLASS_VERSION_MAGIC [GLASS_VERSION_MAGIC_AND_VERSION_LEN]
 
const size_t COMPRESS_MIN = 18
 
static const uint4 compress_min_tab []
 

Detailed Description

GlassVersion class.

Definition in file glass_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 58 of file glass_version.cc.

◆ GLASS_FORMAT_VERSION

#define GLASS_FORMAT_VERSION   DATE_TO_VERSION(2016,03,14)

Glass format version (date of change):

Definition at line 52 of file glass_version.cc.

Referenced by GlassVersion::read().

◆ GLASS_VERSION_MAGIC_AND_VERSION_LEN

#define GLASS_VERSION_MAGIC_AND_VERSION_LEN   16

Definition at line 65 of file glass_version.cc.

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

◆ GLASS_VERSION_MAGIC_LEN

#define GLASS_VERSION_MAGIC_LEN   14

Definition at line 64 of file glass_version.cc.

Referenced by GlassVersion::read().

◆ VERSION_TO_DAY

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

Definition at line 62 of file glass_version.cc.

Referenced by GlassVersion::read().

◆ VERSION_TO_MONTH

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

Definition at line 61 of file glass_version.cc.

Referenced by GlassVersion::read().

◆ VERSION_TO_YEAR

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

Definition at line 60 of file glass_version.cc.

Referenced by GlassVersion::read().

Variable Documentation

◆ COMPRESS_MIN

const size_t COMPRESS_MIN = 18

Definition at line 385 of file glass_version.cc.

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

◆ compress_min_tab

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

Definition at line 387 of file glass_version.cc.

Referenced by GlassVersion::create().

◆ GLASS_VERSION_MAGIC

const char GLASS_VERSION_MAGIC[GLASS_VERSION_MAGIC_AND_VERSION_LEN]
static
Initial value:
= {
'\x0f', '\x0d', 'X', 'a', 'p', 'i', 'a', 'n', ' ', 'G', 'l', 'a', 's', 's',
char((GLASS_FORMAT_VERSION >> 8) & 0xff), char(GLASS_FORMAT_VERSION & 0xff)
}
#define GLASS_FORMAT_VERSION
Glass format version (date of change):

Definition at line 67 of file glass_version.cc.

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