175#ifndef RBT_HEADER_COMMON
176#define RBT_HEADER_COMMON
190#define BITS_PER_BYTE CHAR_BIT
203#define MIN(a,b) (((a) < (b)) ? (a) : (b))
215#define MAX(a,b) (((a) > (b)) ? (a) : (b))
228#define RBT_TOKEN_2(a,b) a ## b
240#define RBT_TOKEN_2_W(a,b) RBT_TOKEN_2(a,b)
253#define _RBT_TOKEN_2(a,b) _ ## a ## b
265#define _RBT_TOKEN_2_W(a,b) _RBT_TOKEN_2(a,b)
274#define MOST_SIGNIFICANT_BIT(x) (((x) ~ 0) ^ (((x) ~ 0) >> 1))
283#define MOST_SIGNIFICANT_BIT_W(x) MOST_SIGNIFICANT_BIT(x)
292#define FIRST_BIT_IS_1(x) (MOST_SIGNIFICANT_BIT(typeof(x)) & (x))
304#define N_BIT_IS_1(x,n) (MOST_SIGNIFICANT_BIT(typeof(x)) & (x << n))
319#define DIV_UP(x,y) ((x) ? (1 + (x-1)/y) : 0)
390 return "INSERT OR REPLACE";
394 return "UNKNOWN ACTION";
465 return "RBT_QUERY_ACTION_RETRIEVE_AND_INSERT";
473 return "UNKNOWN ACTION";
const char * rbt_retrieve_action_string(rbt_retrieve_action_t action)
Return a string representing a retrieval action.
Definition: common.h:377
rbt_query_action_t
Query action for RBT_NODE_QUERY().
Definition: common.h:408
@ RBT_QUERY_ACTION_RETRIEVE_AND_INSERT
Definition: common.h:427
@ RBT_QUERY_ACTION_SWAP
Definition: common.h:435
@ RBT_QUERY_ACTION_RETRIEVE
Definition: common.h:422
@ RBT_QUERY_ACTION_DELETE
Definition: common.h:412
@ RBT_QUERY_ACTION_INSERT
Definition: common.h:417
rbt_retrieve_action_t
Retrieval action for RBT_NODE_RETRIEVE().
Definition: common.h:330
@ RBT_RETRIEVE_ACTION_NOTHING
Definition: common.h:334
@ RBT_RETRIEVE_ACTION_PREFIX_SUBTREE
Definition: common.h:364
@ RBT_RETRIEVE_ACTION_INSERT_OR_REPLACE
Definition: common.h:346
@ RBT_RETRIEVE_ACTION_INSERT
Definition: common.h:340
const char * rbt_query_action_string(rbt_query_action_t action)
Return a string representing a query action.
Definition: common.h:448