
#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 <syslog.h>

#ifndef LOG_NOWAIT
#define LOG_NOWAIT -919919
#endif
#ifndef LOG_PERROR
#define LOG_PERROR -919919
#endif
#ifndef LOG_SYSLOG
#define LOG_SYSLOG LOG_DAEMON
#endif
#ifndef LOG_CRON
#define LOG_CRON LOG_DAEMON
#endif
#ifndef LOG_UUCP
#define LOG_UUCP LOG_MAIL
#endif
#ifndef LOG_NEWS
#define LOG_NEWS LOG_MAIL
#endif

void _cffi_f_closelog(void)
{
  closelog();
}

void _cffi_f_openlog(char const * x0, int x1, int x2)
{
  openlog(x0, x1, x2);
}

int _cffi_f_setlogmask(int x0)
{
  return setlogmask(x0);
}

void _cffi_f_syslog(int x0, char const * x1, char const * x2)
{
  syslog(x0, x1, x2);
}

int _cffi_const_LOG_ALERT(long long *out_value)
{
  *out_value = (long long)(LOG_ALERT);
  return (LOG_ALERT) <= 0;
}

int _cffi_const_LOG_AUTH(long long *out_value)
{
  *out_value = (long long)(LOG_AUTH);
  return (LOG_AUTH) <= 0;
}

int _cffi_const_LOG_CONS(long long *out_value)
{
  *out_value = (long long)(LOG_CONS);
  return (LOG_CONS) <= 0;
}

int _cffi_const_LOG_CRIT(long long *out_value)
{
  *out_value = (long long)(LOG_CRIT);
  return (LOG_CRIT) <= 0;
}

int _cffi_const_LOG_CRON(long long *out_value)
{
  *out_value = (long long)(LOG_CRON);
  return (LOG_CRON) <= 0;
}

int _cffi_const_LOG_DAEMON(long long *out_value)
{
  *out_value = (long long)(LOG_DAEMON);
  return (LOG_DAEMON) <= 0;
}

int _cffi_const_LOG_DEBUG(long long *out_value)
{
  *out_value = (long long)(LOG_DEBUG);
  return (LOG_DEBUG) <= 0;
}

int _cffi_const_LOG_EMERG(long long *out_value)
{
  *out_value = (long long)(LOG_EMERG);
  return (LOG_EMERG) <= 0;
}

int _cffi_const_LOG_ERR(long long *out_value)
{
  *out_value = (long long)(LOG_ERR);
  return (LOG_ERR) <= 0;
}

int _cffi_const_LOG_INFO(long long *out_value)
{
  *out_value = (long long)(LOG_INFO);
  return (LOG_INFO) <= 0;
}

int _cffi_const_LOG_KERN(long long *out_value)
{
  *out_value = (long long)(LOG_KERN);
  return (LOG_KERN) <= 0;
}

int _cffi_const_LOG_LOCAL0(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL0);
  return (LOG_LOCAL0) <= 0;
}

int _cffi_const_LOG_LOCAL1(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL1);
  return (LOG_LOCAL1) <= 0;
}

int _cffi_const_LOG_LOCAL2(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL2);
  return (LOG_LOCAL2) <= 0;
}

int _cffi_const_LOG_LOCAL3(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL3);
  return (LOG_LOCAL3) <= 0;
}

int _cffi_const_LOG_LOCAL4(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL4);
  return (LOG_LOCAL4) <= 0;
}

int _cffi_const_LOG_LOCAL5(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL5);
  return (LOG_LOCAL5) <= 0;
}

int _cffi_const_LOG_LOCAL6(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL6);
  return (LOG_LOCAL6) <= 0;
}

int _cffi_const_LOG_LOCAL7(long long *out_value)
{
  *out_value = (long long)(LOG_LOCAL7);
  return (LOG_LOCAL7) <= 0;
}

int _cffi_const_LOG_LPR(long long *out_value)
{
  *out_value = (long long)(LOG_LPR);
  return (LOG_LPR) <= 0;
}

int _cffi_const_LOG_MAIL(long long *out_value)
{
  *out_value = (long long)(LOG_MAIL);
  return (LOG_MAIL) <= 0;
}

int _cffi_const_LOG_NDELAY(long long *out_value)
{
  *out_value = (long long)(LOG_NDELAY);
  return (LOG_NDELAY) <= 0;
}

int _cffi_const_LOG_NEWS(long long *out_value)
{
  *out_value = (long long)(LOG_NEWS);
  return (LOG_NEWS) <= 0;
}

int _cffi_const_LOG_NOTICE(long long *out_value)
{
  *out_value = (long long)(LOG_NOTICE);
  return (LOG_NOTICE) <= 0;
}

int _cffi_const_LOG_NOWAIT(long long *out_value)
{
  *out_value = (long long)(LOG_NOWAIT);
  return (LOG_NOWAIT) <= 0;
}

int _cffi_const_LOG_PERROR(long long *out_value)
{
  *out_value = (long long)(LOG_PERROR);
  return (LOG_PERROR) <= 0;
}

int _cffi_const_LOG_PID(long long *out_value)
{
  *out_value = (long long)(LOG_PID);
  return (LOG_PID) <= 0;
}

int _cffi_const_LOG_SYSLOG(long long *out_value)
{
  *out_value = (long long)(LOG_SYSLOG);
  return (LOG_SYSLOG) <= 0;
}

int _cffi_const_LOG_USER(long long *out_value)
{
  *out_value = (long long)(LOG_USER);
  return (LOG_USER) <= 0;
}

int _cffi_const_LOG_UUCP(long long *out_value)
{
  *out_value = (long long)(LOG_UUCP);
  return (LOG_UUCP) <= 0;
}

int _cffi_const_LOG_WARNING(long long *out_value)
{
  *out_value = (long long)(LOG_WARNING);
  return (LOG_WARNING) <= 0;
}

