2007-10-02 14:53:06 +00:00
|
|
|
#if !defined(TOKUDB_COMMON_H)
|
|
|
|
#define TOKUDB_COMMON_H
|
2007-11-29 14:29:22 +00:00
|
|
|
|
|
|
|
/* -*- mode: C; c-basic-offset: 4 -*- */
|
|
|
|
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
|
|
|
|
|
2007-10-04 16:21:30 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdint.h>
|
2007-10-02 14:53:06 +00:00
|
|
|
#include <limits.h>
|
2007-10-04 16:21:30 +00:00
|
|
|
#include <db.h>
|
2007-12-11 17:28:38 +00:00
|
|
|
#include <inttypes.h>
|
2007-12-11 17:00:24 +00:00
|
|
|
#include <signal.h>
|
2013-04-16 23:57:46 -04:00
|
|
|
#include <memory.h>
|
2007-10-02 14:53:06 +00:00
|
|
|
|
2008-07-21 18:00:38 +00:00
|
|
|
typedef u_int8_t bool;
|
2007-10-04 16:21:30 +00:00
|
|
|
|
|
|
|
#define true ((bool)1)
|
|
|
|
#define false ((bool)0)
|
|
|
|
|
|
|
|
#define SET_BITS(bitvector, bits) ((bitvector) |= (bits))
|
|
|
|
#define REMOVE_BITS(bitvector, bits) ((bitvector) &= ~(bits))
|
|
|
|
#define IS_SET_ANY(bitvector, bits) ((bitvector) & (bits))
|
|
|
|
#define IS_SET_ALL(bitvector, bits) (((bitvector) & (bits)) == (bits))
|
2007-10-04 19:53:14 +00:00
|
|
|
|
2007-10-09 16:24:05 +00:00
|
|
|
#define IS_POWER_OF_2(num) ((num) > 0 && ((num) & ((num) - 1)) == 0)
|
2007-10-04 16:21:30 +00:00
|
|
|
|
2007-10-02 14:53:06 +00:00
|
|
|
#endif /* #if !defined(TOKUDB_COMMON_H) */
|