#include <stdint.h>
#include <inttypes.h>

#ifndef RBT_NO_CMAKE
#  include "cmake_config.h"
#endif //RBT_NO_CMAKE

#include "common.h"
#include "debug.h"


/*
  The following definitions are for rabbit tries with uint32_t keys and constant
  string values. "int_to_const_string_" is used as a prefix throughout.
*/


/*
  key.h
*/
#define RBT_KEY_H_PREFIX_ int_to_const_string_
#define RBT_PIN_T uint_fast8_t
/*
  uint32_t keys have a fixed width of 32 bits. An 8-bit integer will suffice to
  count them.
*/
#define RBT_KEY_SIZE_T uint_fast8_t
#define RBT_KEY_SIZE_T_FORMAT PRIuFAST8
#include "key.h"



/*
  node.h
*/
#define RBT_NODE_H_PREFIX_ int_to_const_string_
#define RBT_VALUE_T const char *
#define RBT_VALUE_NULL NULL
/*
  A simple comparison suffices to determine if the value is null.
*/
#define RBT_VALUE_IS_EQUAL(a, b) (a == b)
/*
  The values are static, so a simple assignment will suffice.
*/
#define RBT_VALUE_COPY(var,val,fail) var = val
/*
  There is no dynamic memory to free, so do nothing.
*/
#define RBT_VALUE_FREE(val)
#define RBT_VALUE_FPRINT(fd, val) \
do \
{ \
  if (val != NULL) \
  { \
    fprintf(fd, "%s", val); \
  } \
} while(0)
#include "node.h"




/*
  wrapper.h
*/
#define RBT_WRAPPER_H_PREFIX_ int_to_const_string_
/*

*/
#define RBT_KEY_T uint32_t
#define RBT_KEY_SIZE_FIXED sizeof(RBT_KEY_T)
#define RBT_KEY_COUNT_BITS(key) (sizeof(RBT_KEY_T) * BITS_PER_BYTE)
#define RBT_KEY_PTR(key) (&key)
#define RBT_KEY_FPRINT(fd, key) fprintf(fd, "%d", key);
#include "wrapper.h"
