
#include <stdio.h>
#include <stddef.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/types.h>   /* XXX for ssize_t on some platforms */

/* this block of #ifs should be kept exactly identical between
   c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py */
#if defined(_MSC_VER)
# include <malloc.h>   /* for alloca() */
# if _MSC_VER < 1600   /* MSVC < 2010 */
   typedef __int8 int8_t;
   typedef __int16 int16_t;
   typedef __int32 int32_t;
   typedef __int64 int64_t;
   typedef unsigned __int8 uint8_t;
   typedef unsigned __int16 uint16_t;
   typedef unsigned __int32 uint32_t;
   typedef unsigned __int64 uint64_t;
   typedef __int8 int_least8_t;
   typedef __int16 int_least16_t;
   typedef __int32 int_least32_t;
   typedef __int64 int_least64_t;
   typedef unsigned __int8 uint_least8_t;
   typedef unsigned __int16 uint_least16_t;
   typedef unsigned __int32 uint_least32_t;
   typedef unsigned __int64 uint_least64_t;
   typedef __int8 int_fast8_t;
   typedef __int16 int_fast16_t;
   typedef __int32 int_fast32_t;
   typedef __int64 int_fast64_t;
   typedef unsigned __int8 uint_fast8_t;
   typedef unsigned __int16 uint_fast16_t;
   typedef unsigned __int32 uint_fast32_t;
   typedef unsigned __int64 uint_fast64_t;
   typedef __int64 intmax_t;
   typedef unsigned __int64 uintmax_t;
# else
#  include <stdint.h>
# endif
# if _MSC_VER < 1800   /* MSVC < 2013 */
   typedef unsigned char _Bool;
# endif
#else
# include <stdint.h>
# if (defined (__SVR4) && defined (__sun)) || defined(_AIX)
#  include <alloca.h>
# endif
#endif


    #include "gdbm.h"
    
static void _cffi_check__datum(datum *p)
{
  /* only to generate compile-time warnings or errors */
  (void)p;
  { char * *tmp = &p->dptr; (void)tmp; }
  (void)((p->dsize) << 1);
}
intptr_t _cffi_layout__datum(intptr_t i)
{
  struct _cffi_aligncheck { char x; datum y; };
  static intptr_t nums[] = {
    sizeof(datum),
    offsetof(struct _cffi_aligncheck, y),
    offsetof(datum, dptr),
    sizeof(((datum *)0)->dptr),
    offsetof(datum, dsize),
    sizeof(((datum *)0)->dsize),
    -1
  };
  return nums[i];
  /* the next line is not executed, but compiled */
  _cffi_check__datum(0);
}

void _cffi_f_free(void * x0)
{
  free(x0);
}

void _cffi_f_gdbm_close(void * x0)
{
  gdbm_close(x0);
}

int _cffi_f_gdbm_delete(void * x0, datum *x1)
{
  return gdbm_delete(x0, *x1);
}

int _cffi_f_gdbm_exists(void * x0, datum *x1)
{
  return gdbm_exists(x0, *x1);
}

datum _cffi_f_gdbm_fetch(void * x0, datum *x1)
{
  return gdbm_fetch(x0, *x1);
}

datum _cffi_f_gdbm_firstkey(void * x0)
{
  return gdbm_firstkey(x0);
}

datum _cffi_f_gdbm_nextkey(void * x0, datum *x1)
{
  return gdbm_nextkey(x0, *x1);
}

void * _cffi_f_gdbm_open(char * x0, int x1, int x2, int x3, void(* x4)(void))
{
  return gdbm_open(x0, x1, x2, x3, x4);
}

int _cffi_f_gdbm_reorganize(void * x0)
{
  return gdbm_reorganize(x0);
}

int _cffi_f_gdbm_store(void * x0, datum *x1, datum *x2, int x3)
{
  return gdbm_store(x0, *x1, *x2, x3);
}

char * _cffi_f_gdbm_strerror(int x0)
{
  return gdbm_strerror(x0);
}

void _cffi_f_gdbm_sync(void * x0)
{
  gdbm_sync(x0);
}

int _cffi_const_GDBM_FAST(long long *out_value)
{
  *out_value = (long long)(GDBM_FAST);
  return (GDBM_FAST) <= 0;
}

int _cffi_const_GDBM_NEWDB(long long *out_value)
{
  *out_value = (long long)(GDBM_NEWDB);
  return (GDBM_NEWDB) <= 0;
}

int _cffi_const_GDBM_NOLOCK(long long *out_value)
{
  *out_value = (long long)(GDBM_NOLOCK);
  return (GDBM_NOLOCK) <= 0;
}

int _cffi_const_GDBM_READER(long long *out_value)
{
  *out_value = (long long)(GDBM_READER);
  return (GDBM_READER) <= 0;
}

int _cffi_const_GDBM_REPLACE(long long *out_value)
{
  *out_value = (long long)(GDBM_REPLACE);
  return (GDBM_REPLACE) <= 0;
}

int _cffi_const_GDBM_SYNC(long long *out_value)
{
  *out_value = (long long)(GDBM_SYNC);
  return (GDBM_SYNC) <= 0;
}

int _cffi_const_GDBM_WRCREAT(long long *out_value)
{
  *out_value = (long long)(GDBM_WRCREAT);
  return (GDBM_WRCREAT) <= 0;
}

int _cffi_const_GDBM_WRITER(long long *out_value)
{
  *out_value = (long long)(GDBM_WRITER);
  return (GDBM_WRITER) <= 0;
}

int * _cffi_var_gdbm_errno(void)
{
  return (&gdbm_errno);
}

