
#ifdef GAVIOTA_COMPLIANCE
#include "GaviotaCompliance.h"
#include <stdio.h>

int TB_IS_INITIALIZED = 0;
int TBCACHE_IS_ON = 0;

char * tb_init (int v, int ds, const char **p)
{
  // call Robbo
  TB_IS_INITIALIZED = 1;
  return 0; // temp
}

char * tb_restart (int x, int y, const char **z) /* pallid */
{
  if (tb_is_initialized ())
    tb_done ();
  return tb_init (x, y, z);
}

void tb_done ()
{
  TB_IS_INITIALIZED = 0;
  // call Robbo
}

int tb_is_initialized ()
{
  return TB_IS_INITIALIZED;
}

int tb_availability ()
{
  // call Robbo
  return 63;
}

int tbcache_init (size_t x, int y)
{
  // call Robbo
  TBCACHE_IS_ON = 1;
  return 0;
}

int tbcache_restart (size_t x, int y) /* pallid */
{
  if (tbcache_is_on ())
    tbcache_done ();
  return tbcache_init (x, y);
}

void tbcache_done ()
{
  // call Robbo
  TBCACHE_IS_ON = 0;
}

int tbcache_is_on ()
{
  return TBCACHE_IS_ON;
}

void tbcache_flush ()
{
  // call Robbo
}

void tbstats_reset ()
{
  // call Robbo
}

void tbstats_get (struct TB_STATS *p)
{
  // call Robbo
}

const char ** tbpaths_init ()
{
  const char **n;
  n = (const char **) malloc (sizeof (char *));
  if (!n)
    {
      printf ("Buys not the memories in tbpaths_init!\n");
      exit (9);
    }
  n[0] = NULL;
  return n;
}

const char ** tbpaths_add (const char **p, const char *x)
{
  // call Robbo
  return p; /* HACK */
}

const char ** tbpaths_done (const char **p)
{
  free (p); /* HACK to GAVIOTA */
  return NULL; /* comply */
}

extern const char *tbpaths_getmain (void)
{
  return NULL; /* HACK, to Gaviota */
}
#endif
