
#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


#ifdef __APPLE__
/* the following define is necessary for OS X 10.6+; without it, the
   Apple-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python
   can't get at the WINDOW flags field. */
#define NCURSES_OPAQUE 0
#endif

#include <ncurses.h>
#include <panel.h>
#include <term.h>

#if defined STRICT_SYSV_CURSES
#define _m_STRICT_SYSV_CURSES TRUE
#else
#define _m_STRICT_SYSV_CURSES FALSE
#endif

#if defined NCURSES_MOUSE_VERSION
#define _m_NCURSES_MOUSE_VERSION TRUE
#else
#define _m_NCURSES_MOUSE_VERSION FALSE
#endif

#if defined __NetBSD__
#define _m_NetBSD TRUE
#else
#define _m_NetBSD FALSE
#endif

int _m_ispad(WINDOW *win) {
    // <curses.h> may not have _flags (and possibly _ISPAD),
    // but for now let's assume that <ncurses.h> always has it
    return (win->_flags & _ISPAD);
}

void _m_getsyx(int *yx) {
    getsyx(yx[0], yx[1]);
}

static void _cffi_check__MEVENT(MEVENT *p)
{
  /* only to generate compile-time warnings or errors */
  (void)p;
  (void)((p->id) << 1);
  (void)((p->x) << 1);
  (void)((p->y) << 1);
  (void)((p->z) << 1);
  (void)((p->bstate) << 1);
}
intptr_t _cffi_layout__MEVENT(intptr_t i)
{
  struct _cffi_aligncheck { char x; MEVENT y; };
  static intptr_t nums[] = {
    sizeof(MEVENT),
    offsetof(struct _cffi_aligncheck, y),
    offsetof(MEVENT, id),
    sizeof(((MEVENT *)0)->id),
    offsetof(MEVENT, x),
    sizeof(((MEVENT *)0)->x),
    offsetof(MEVENT, y),
    sizeof(((MEVENT *)0)->y),
    offsetof(MEVENT, z),
    sizeof(((MEVENT *)0)->z),
    offsetof(MEVENT, bstate),
    sizeof(((MEVENT *)0)->bstate),
    -1
  };
  return nums[i];
  /* the next line is not executed, but compiled */
  _cffi_check__MEVENT(0);
}

int _cffi_const_ALL_MOUSE_EVENTS(long long *out_value)
{
  *out_value = (long long)(ALL_MOUSE_EVENTS);
  return (ALL_MOUSE_EVENTS) <= 0;
}

int _cffi_const_A_ALTCHARSET(long long *out_value)
{
  *out_value = (long long)(A_ALTCHARSET);
  return (A_ALTCHARSET) <= 0;
}

int _cffi_const_A_ATTRIBUTES(long long *out_value)
{
  *out_value = (long long)(A_ATTRIBUTES);
  return (A_ATTRIBUTES) <= 0;
}

int _cffi_const_A_BLINK(long long *out_value)
{
  *out_value = (long long)(A_BLINK);
  return (A_BLINK) <= 0;
}

int _cffi_const_A_BOLD(long long *out_value)
{
  *out_value = (long long)(A_BOLD);
  return (A_BOLD) <= 0;
}

int _cffi_const_A_CHARTEXT(long long *out_value)
{
  *out_value = (long long)(A_CHARTEXT);
  return (A_CHARTEXT) <= 0;
}

int _cffi_const_A_COLOR(long long *out_value)
{
  *out_value = (long long)(A_COLOR);
  return (A_COLOR) <= 0;
}

int _cffi_const_A_DIM(long long *out_value)
{
  *out_value = (long long)(A_DIM);
  return (A_DIM) <= 0;
}

int _cffi_const_A_INVIS(long long *out_value)
{
  *out_value = (long long)(A_INVIS);
  return (A_INVIS) <= 0;
}

int _cffi_const_A_NORMAL(long long *out_value)
{
  *out_value = (long long)(A_NORMAL);
  return (A_NORMAL) <= 0;
}

int _cffi_const_A_PROTECT(long long *out_value)
{
  *out_value = (long long)(A_PROTECT);
  return (A_PROTECT) <= 0;
}

int _cffi_const_A_REVERSE(long long *out_value)
{
  *out_value = (long long)(A_REVERSE);
  return (A_REVERSE) <= 0;
}

int _cffi_const_A_STANDOUT(long long *out_value)
{
  *out_value = (long long)(A_STANDOUT);
  return (A_STANDOUT) <= 0;
}

int _cffi_const_A_UNDERLINE(long long *out_value)
{
  *out_value = (long long)(A_UNDERLINE);
  return (A_UNDERLINE) <= 0;
}

int _cffi_const_BUTTON1_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON1_CLICKED);
  return (BUTTON1_CLICKED) <= 0;
}

int _cffi_const_BUTTON1_DOUBLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON1_DOUBLE_CLICKED);
  return (BUTTON1_DOUBLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON1_PRESSED(long long *out_value)
{
  *out_value = (long long)(BUTTON1_PRESSED);
  return (BUTTON1_PRESSED) <= 0;
}

int _cffi_const_BUTTON1_RELEASED(long long *out_value)
{
  *out_value = (long long)(BUTTON1_RELEASED);
  return (BUTTON1_RELEASED) <= 0;
}

int _cffi_const_BUTTON1_TRIPLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON1_TRIPLE_CLICKED);
  return (BUTTON1_TRIPLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON2_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON2_CLICKED);
  return (BUTTON2_CLICKED) <= 0;
}

int _cffi_const_BUTTON2_DOUBLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON2_DOUBLE_CLICKED);
  return (BUTTON2_DOUBLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON2_PRESSED(long long *out_value)
{
  *out_value = (long long)(BUTTON2_PRESSED);
  return (BUTTON2_PRESSED) <= 0;
}

int _cffi_const_BUTTON2_RELEASED(long long *out_value)
{
  *out_value = (long long)(BUTTON2_RELEASED);
  return (BUTTON2_RELEASED) <= 0;
}

int _cffi_const_BUTTON2_TRIPLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON2_TRIPLE_CLICKED);
  return (BUTTON2_TRIPLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON3_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON3_CLICKED);
  return (BUTTON3_CLICKED) <= 0;
}

int _cffi_const_BUTTON3_DOUBLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON3_DOUBLE_CLICKED);
  return (BUTTON3_DOUBLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON3_PRESSED(long long *out_value)
{
  *out_value = (long long)(BUTTON3_PRESSED);
  return (BUTTON3_PRESSED) <= 0;
}

int _cffi_const_BUTTON3_RELEASED(long long *out_value)
{
  *out_value = (long long)(BUTTON3_RELEASED);
  return (BUTTON3_RELEASED) <= 0;
}

int _cffi_const_BUTTON3_TRIPLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON3_TRIPLE_CLICKED);
  return (BUTTON3_TRIPLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON4_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON4_CLICKED);
  return (BUTTON4_CLICKED) <= 0;
}

int _cffi_const_BUTTON4_DOUBLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON4_DOUBLE_CLICKED);
  return (BUTTON4_DOUBLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON4_PRESSED(long long *out_value)
{
  *out_value = (long long)(BUTTON4_PRESSED);
  return (BUTTON4_PRESSED) <= 0;
}

int _cffi_const_BUTTON4_RELEASED(long long *out_value)
{
  *out_value = (long long)(BUTTON4_RELEASED);
  return (BUTTON4_RELEASED) <= 0;
}

int _cffi_const_BUTTON4_TRIPLE_CLICKED(long long *out_value)
{
  *out_value = (long long)(BUTTON4_TRIPLE_CLICKED);
  return (BUTTON4_TRIPLE_CLICKED) <= 0;
}

int _cffi_const_BUTTON_ALT(long long *out_value)
{
  *out_value = (long long)(BUTTON_ALT);
  return (BUTTON_ALT) <= 0;
}

int _cffi_const_BUTTON_CTRL(long long *out_value)
{
  *out_value = (long long)(BUTTON_CTRL);
  return (BUTTON_CTRL) <= 0;
}

int _cffi_const_BUTTON_SHIFT(long long *out_value)
{
  *out_value = (long long)(BUTTON_SHIFT);
  return (BUTTON_SHIFT) <= 0;
}

int _cffi_const_COLOR_BLACK(long long *out_value)
{
  *out_value = (long long)(COLOR_BLACK);
  return (COLOR_BLACK) <= 0;
}

int _cffi_const_COLOR_BLUE(long long *out_value)
{
  *out_value = (long long)(COLOR_BLUE);
  return (COLOR_BLUE) <= 0;
}

int _cffi_const_COLOR_CYAN(long long *out_value)
{
  *out_value = (long long)(COLOR_CYAN);
  return (COLOR_CYAN) <= 0;
}

int _cffi_const_COLOR_GREEN(long long *out_value)
{
  *out_value = (long long)(COLOR_GREEN);
  return (COLOR_GREEN) <= 0;
}

int _cffi_const_COLOR_MAGENTA(long long *out_value)
{
  *out_value = (long long)(COLOR_MAGENTA);
  return (COLOR_MAGENTA) <= 0;
}

int _cffi_const_COLOR_RED(long long *out_value)
{
  *out_value = (long long)(COLOR_RED);
  return (COLOR_RED) <= 0;
}

int _cffi_const_COLOR_WHITE(long long *out_value)
{
  *out_value = (long long)(COLOR_WHITE);
  return (COLOR_WHITE) <= 0;
}

int _cffi_const_COLOR_YELLOW(long long *out_value)
{
  *out_value = (long long)(COLOR_YELLOW);
  return (COLOR_YELLOW) <= 0;
}

int _cffi_const_ERR(long long *out_value)
{
  *out_value = (long long)(ERR);
  return (ERR) <= 0;
}

int _cffi_const_FALSE(long long *out_value)
{
  *out_value = (long long)(FALSE);
  return (FALSE) <= 0;
}

int _cffi_const_KEY_MAX(long long *out_value)
{
  *out_value = (long long)(KEY_MAX);
  return (KEY_MAX) <= 0;
}

int _cffi_const_KEY_MIN(long long *out_value)
{
  *out_value = (long long)(KEY_MIN);
  return (KEY_MIN) <= 0;
}

int _cffi_const_OK(long long *out_value)
{
  *out_value = (long long)(OK);
  return (OK) <= 0;
}

int _cffi_const_REPORT_MOUSE_POSITION(long long *out_value)
{
  *out_value = (long long)(REPORT_MOUSE_POSITION);
  return (REPORT_MOUSE_POSITION) <= 0;
}

int _cffi_const_TRUE(long long *out_value)
{
  *out_value = (long long)(TRUE);
  return (TRUE) <= 0;
}

void _cffi_f__m_getsyx(int * x0)
{
  _m_getsyx(x0);
}

int _cffi_f__m_ispad(WINDOW * x0)
{
  return _m_ispad(x0);
}

int _cffi_f_baudrate(void)
{
  return baudrate();
}

int _cffi_f_beep(void)
{
  return beep();
}

int _cffi_f_bottom_panel(PANEL * x0)
{
  return bottom_panel(x0);
}

int _cffi_f_box(WINDOW * x0, unsigned long x1, unsigned long x2)
{
  return box(x0, x1, x2);
}

unsigned char _cffi_f_can_change_color(void)
{
  return can_change_color();
}

int _cffi_f_cbreak(void)
{
  return cbreak();
}

int _cffi_f_clearok(WINDOW * x0, unsigned char x1)
{
  return clearok(x0, x1);
}

int _cffi_f_color_content(short x0, short * x1, short * x2, short * x3)
{
  return color_content(x0, x1, x2, x3);
}

int _cffi_f_copywin(WINDOW const * x0, WINDOW * x1, int x2, int x3, int x4, int x5, int x6, int x7, int x8)
{
  return copywin(x0, x1, x2, x3, x4, x5, x6, x7, x8);
}

int _cffi_f_curs_set(int x0)
{
  return curs_set(x0);
}

int _cffi_f_def_prog_mode(void)
{
  return def_prog_mode();
}

int _cffi_f_def_shell_mode(void)
{
  return def_shell_mode();
}

int _cffi_f_del_panel(PANEL * x0)
{
  return del_panel(x0);
}

int _cffi_f_delay_output(int x0)
{
  return delay_output(x0);
}

int _cffi_f_delwin(WINDOW * x0)
{
  return delwin(x0);
}

WINDOW * _cffi_f_derwin(WINDOW * x0, int x1, int x2, int x3, int x4)
{
  return derwin(x0, x1, x2, x3, x4);
}

int _cffi_f_doupdate(void)
{
  return doupdate();
}

int _cffi_f_echo(void)
{
  return echo();
}

int _cffi_f_endwin(void)
{
  return endwin();
}

char _cffi_f_erasechar(void)
{
  return erasechar();
}

void _cffi_f_filter(void)
{
  filter();
}

int _cffi_f_flash(void)
{
  return flash();
}

int _cffi_f_flushinp(void)
{
  return flushinp();
}

int _cffi_f_getattrs(WINDOW const * x0)
{
  return getattrs(x0);
}

int _cffi_f_getbegx(WINDOW const * x0)
{
  return getbegx(x0);
}

int _cffi_f_getbegy(WINDOW const * x0)
{
  return getbegy(x0);
}

unsigned long _cffi_f_getbkgd(WINDOW * x0)
{
  return getbkgd(x0);
}

int _cffi_f_getcurx(WINDOW const * x0)
{
  return getcurx(x0);
}

int _cffi_f_getcury(WINDOW const * x0)
{
  return getcury(x0);
}

int _cffi_f_getmaxx(WINDOW const * x0)
{
  return getmaxx(x0);
}

int _cffi_f_getmaxy(WINDOW const * x0)
{
  return getmaxy(x0);
}

int _cffi_f_getmouse(MEVENT * x0)
{
  return getmouse(x0);
}

int _cffi_f_getparx(WINDOW const * x0)
{
  return getparx(x0);
}

int _cffi_f_getpary(WINDOW const * x0)
{
  return getpary(x0);
}

WINDOW * _cffi_f_getwin(FILE * x0)
{
  return getwin(x0);
}

int _cffi_f_halfdelay(int x0)
{
  return halfdelay(x0);
}

unsigned char _cffi_f_has_colors(void)
{
  return has_colors();
}

unsigned char _cffi_f_has_ic(void)
{
  return has_ic();
}

unsigned char _cffi_f_has_il(void)
{
  return has_il();
}

int _cffi_f_has_key(int x0)
{
  return has_key(x0);
}

int _cffi_f_hide_panel(PANEL * x0)
{
  return hide_panel(x0);
}

void _cffi_f_idcok(WINDOW * x0, unsigned char x1)
{
  idcok(x0, x1);
}

int _cffi_f_idlok(WINDOW * x0, unsigned char x1)
{
  return idlok(x0, x1);
}

void _cffi_f_immedok(WINDOW * x0, unsigned char x1)
{
  immedok(x0, x1);
}

int _cffi_f_init_color(short x0, short x1, short x2, short x3)
{
  return init_color(x0, x1, x2, x3);
}

int _cffi_f_init_pair(short x0, short x1, short x2)
{
  return init_pair(x0, x1, x2);
}

WINDOW * _cffi_f_initscr(void)
{
  return initscr();
}

int _cffi_f_intrflush(WINDOW * x0, unsigned char x1)
{
  return intrflush(x0, x1);
}

unsigned char _cffi_f_is_linetouched(WINDOW * x0, int x1)
{
  return is_linetouched(x0, x1);
}

unsigned char _cffi_f_is_term_resized(int x0, int x1)
{
  return is_term_resized(x0, x1);
}

unsigned char _cffi_f_is_wintouched(WINDOW * x0)
{
  return is_wintouched(x0);
}

unsigned char _cffi_f_isendwin(void)
{
  return isendwin();
}

char const * _cffi_f_keyname(int x0)
{
  return keyname(x0);
}

int _cffi_f_keypad(WINDOW * x0, unsigned char x1)
{
  return keypad(x0, x1);
}

char _cffi_f_killchar(void)
{
  return killchar();
}

int _cffi_f_leaveok(WINDOW * x0, unsigned char x1)
{
  return leaveok(x0, x1);
}

char * _cffi_f_longname(void)
{
  return longname();
}

int _cffi_f_meta(WINDOW * x0, unsigned char x1)
{
  return meta(x0, x1);
}

int _cffi_f_mouseinterval(int x0)
{
  return mouseinterval(x0);
}

unsigned long _cffi_f_mousemask(unsigned long x0, unsigned long * x1)
{
  return mousemask(x0, x1);
}

int _cffi_f_move_panel(PANEL * x0, int x1, int x2)
{
  return move_panel(x0, x1, x2);
}

int _cffi_f_mvderwin(WINDOW * x0, int x1, int x2)
{
  return mvderwin(x0, x1, x2);
}

int _cffi_f_mvwaddch(WINDOW * x0, int x1, int x2, unsigned long x3)
{
  return mvwaddch(x0, x1, x2, x3);
}

int _cffi_f_mvwaddnstr(WINDOW * x0, int x1, int x2, char const * x3, int x4)
{
  return mvwaddnstr(x0, x1, x2, x3, x4);
}

int _cffi_f_mvwaddstr(WINDOW * x0, int x1, int x2, char const * x3)
{
  return mvwaddstr(x0, x1, x2, x3);
}

int _cffi_f_mvwchgat(WINDOW * x0, int x1, int x2, int x3, unsigned long x4, short x5, void const * x6)
{
  return mvwchgat(x0, x1, x2, x3, x4, x5, x6);
}

int _cffi_f_mvwdelch(WINDOW * x0, int x1, int x2)
{
  return mvwdelch(x0, x1, x2);
}

int _cffi_f_mvwgetch(WINDOW * x0, int x1, int x2)
{
  return mvwgetch(x0, x1, x2);
}

int _cffi_f_mvwgetnstr(WINDOW * x0, int x1, int x2, char * x3, int x4)
{
  return mvwgetnstr(x0, x1, x2, x3, x4);
}

int _cffi_f_mvwin(WINDOW * x0, int x1, int x2)
{
  return mvwin(x0, x1, x2);
}

unsigned long _cffi_f_mvwinch(WINDOW * x0, int x1, int x2)
{
  return mvwinch(x0, x1, x2);
}

int _cffi_f_mvwinnstr(WINDOW * x0, int x1, int x2, char * x3, int x4)
{
  return mvwinnstr(x0, x1, x2, x3, x4);
}

int _cffi_f_mvwinsch(WINDOW * x0, int x1, int x2, unsigned long x3)
{
  return mvwinsch(x0, x1, x2, x3);
}

int _cffi_f_mvwinsnstr(WINDOW * x0, int x1, int x2, char const * x3, int x4)
{
  return mvwinsnstr(x0, x1, x2, x3, x4);
}

int _cffi_f_mvwinsstr(WINDOW * x0, int x1, int x2, char const * x3)
{
  return mvwinsstr(x0, x1, x2, x3);
}

int _cffi_f_napms(int x0)
{
  return napms(x0);
}

PANEL * _cffi_f_new_panel(WINDOW * x0)
{
  return new_panel(x0);
}

WINDOW * _cffi_f_newpad(int x0, int x1)
{
  return newpad(x0, x1);
}

WINDOW * _cffi_f_newwin(int x0, int x1, int x2, int x3)
{
  return newwin(x0, x1, x2, x3);
}

int _cffi_f_nl(void)
{
  return nl();
}

int _cffi_f_nocbreak(void)
{
  return nocbreak();
}

int _cffi_f_nodelay(WINDOW * x0, unsigned char x1)
{
  return nodelay(x0, x1);
}

int _cffi_f_noecho(void)
{
  return noecho();
}

int _cffi_f_nonl(void)
{
  return nonl();
}

void _cffi_f_noqiflush(void)
{
  noqiflush();
}

int _cffi_f_noraw(void)
{
  return noraw();
}

int _cffi_f_notimeout(WINDOW * x0, unsigned char x1)
{
  return notimeout(x0, x1);
}

int _cffi_f_overlay(WINDOW const * x0, WINDOW * x1)
{
  return overlay(x0, x1);
}

int _cffi_f_overwrite(WINDOW const * x0, WINDOW * x1)
{
  return overwrite(x0, x1);
}

int _cffi_f_pair_content(short x0, short * x1, short * x2)
{
  return pair_content(x0, x1, x2);
}

PANEL * _cffi_f_panel_above(PANEL const * x0)
{
  return panel_above(x0);
}

PANEL * _cffi_f_panel_below(PANEL const * x0)
{
  return panel_below(x0);
}

int _cffi_f_panel_hidden(PANEL const * x0)
{
  return panel_hidden(x0);
}

void const * _cffi_f_panel_userptr(PANEL const * x0)
{
  return panel_userptr(x0);
}

WINDOW * _cffi_f_panel_window(PANEL const * x0)
{
  return panel_window(x0);
}

int _cffi_f_pechochar(WINDOW * x0, unsigned long x1)
{
  return pechochar(x0, x1);
}

int _cffi_f_pnoutrefresh(WINDOW * x0, int x1, int x2, int x3, int x4, int x5, int x6)
{
  return pnoutrefresh(x0, x1, x2, x3, x4, x5, x6);
}

int _cffi_f_prefresh(WINDOW * x0, int x1, int x2, int x3, int x4, int x5, int x6)
{
  return prefresh(x0, x1, x2, x3, x4, x5, x6);
}

int _cffi_f_putp(char const * x0)
{
  return putp(x0);
}

int _cffi_f_putwin(WINDOW * x0, FILE * x1)
{
  return putwin(x0, x1);
}

void _cffi_f_qiflush(void)
{
  qiflush();
}

int _cffi_f_raw(void)
{
  return raw();
}

int _cffi_f_redrawwin(WINDOW * x0)
{
  return redrawwin(x0);
}

int _cffi_f_replace_panel(PANEL * x0, WINDOW * x1)
{
  return replace_panel(x0, x1);
}

int _cffi_f_reset_prog_mode(void)
{
  return reset_prog_mode();
}

int _cffi_f_reset_shell_mode(void)
{
  return reset_shell_mode();
}

int _cffi_f_resetty(void)
{
  return resetty();
}

int _cffi_f_savetty(void)
{
  return savetty();
}

int _cffi_f_scroll(WINDOW * x0)
{
  return scroll(x0);
}

int _cffi_f_scrollok(WINDOW * x0, unsigned char x1)
{
  return scrollok(x0, x1);
}

int _cffi_f_set_panel_userptr(PANEL * x0, void * x1)
{
  return set_panel_userptr(x0, x1);
}

void _cffi_f_setsyx(int x0, int x1)
{
  setsyx(x0, x1);
}

int _cffi_f_setupterm(char * x0, int x1, int * x2)
{
  return setupterm(x0, x1, x2);
}

int _cffi_f_show_panel(PANEL * x0)
{
  return show_panel(x0);
}

int _cffi_f_start_color(void)
{
  return start_color();
}

WINDOW * _cffi_f_subpad(WINDOW * x0, int x1, int x2, int x3, int x4)
{
  return subpad(x0, x1, x2, x3, x4);
}

WINDOW * _cffi_f_subwin(WINDOW * x0, int x1, int x2, int x3, int x4)
{
  return subwin(x0, x1, x2, x3, x4);
}

int _cffi_f_syncok(WINDOW * x0, unsigned char x1)
{
  return syncok(x0, x1);
}

unsigned long _cffi_f_termattrs(void)
{
  return termattrs();
}

char * _cffi_f_termname(void)
{
  return termname();
}

int _cffi_f_tigetflag(char * x0)
{
  return tigetflag(x0);
}

int _cffi_f_tigetnum(char * x0)
{
  return tigetnum(x0);
}

char * _cffi_f_tigetstr(char * x0)
{
  return tigetstr(x0);
}

int _cffi_f_top_panel(PANEL * x0)
{
  return top_panel(x0);
}

int _cffi_f_touchline(WINDOW * x0, int x1, int x2)
{
  return touchline(x0, x1, x2);
}

int _cffi_f_touchwin(WINDOW * x0)
{
  return touchwin(x0);
}

char *(* _cffi_const_tparm(void))(char const *, ...)
{
  return (tparm);
}

int _cffi_f_typeahead(int x0)
{
  return typeahead(x0);
}

char const * _cffi_f_unctrl(unsigned long x0)
{
  return unctrl(x0);
}

int _cffi_f_ungetch(int x0)
{
  return ungetch(x0);
}

int _cffi_f_ungetmouse(MEVENT * x0)
{
  return ungetmouse(x0);
}

int _cffi_f_untouchwin(WINDOW * x0)
{
  return untouchwin(x0);
}

void _cffi_f_update_panels(void)
{
  update_panels();
}

int _cffi_f_use_default_colors(void)
{
  return use_default_colors();
}

void _cffi_f_use_env(unsigned char x0)
{
  use_env(x0);
}

int _cffi_f_waddch(WINDOW * x0, unsigned long x1)
{
  return waddch(x0, x1);
}

int _cffi_f_waddnstr(WINDOW * x0, char const * x1, int x2)
{
  return waddnstr(x0, x1, x2);
}

int _cffi_f_waddstr(WINDOW * x0, char const * x1)
{
  return waddstr(x0, x1);
}

int _cffi_f_wattroff(WINDOW * x0, int x1)
{
  return wattroff(x0, x1);
}

int _cffi_f_wattron(WINDOW * x0, int x1)
{
  return wattron(x0, x1);
}

int _cffi_f_wattrset(WINDOW * x0, int x1)
{
  return wattrset(x0, x1);
}

int _cffi_f_wbkgd(WINDOW * x0, unsigned long x1)
{
  return wbkgd(x0, x1);
}

void _cffi_f_wbkgdset(WINDOW * x0, unsigned long x1)
{
  wbkgdset(x0, x1);
}

int _cffi_f_wborder(WINDOW * x0, unsigned long x1, unsigned long x2, unsigned long x3, unsigned long x4, unsigned long x5, unsigned long x6, unsigned long x7, unsigned long x8)
{
  return wborder(x0, x1, x2, x3, x4, x5, x6, x7, x8);
}

int _cffi_f_wchgat(WINDOW * x0, int x1, unsigned long x2, short x3, void const * x4)
{
  return wchgat(x0, x1, x2, x3, x4);
}

int _cffi_f_wclear(WINDOW * x0)
{
  return wclear(x0);
}

int _cffi_f_wclrtobot(WINDOW * x0)
{
  return wclrtobot(x0);
}

int _cffi_f_wclrtoeol(WINDOW * x0)
{
  return wclrtoeol(x0);
}

void _cffi_f_wcursyncup(WINDOW * x0)
{
  wcursyncup(x0);
}

int _cffi_f_wdelch(WINDOW * x0)
{
  return wdelch(x0);
}

int _cffi_f_wdeleteln(WINDOW * x0)
{
  return wdeleteln(x0);
}

int _cffi_f_wechochar(WINDOW * x0, unsigned long x1)
{
  return wechochar(x0, x1);
}

unsigned char _cffi_f_wenclose(WINDOW const * x0, int x1, int x2)
{
  return wenclose(x0, x1, x2);
}

int _cffi_f_werase(WINDOW * x0)
{
  return werase(x0);
}

int _cffi_f_wgetch(WINDOW * x0)
{
  return wgetch(x0);
}

int _cffi_f_wgetnstr(WINDOW * x0, char * x1, int x2)
{
  return wgetnstr(x0, x1, x2);
}

int _cffi_f_whline(WINDOW * x0, unsigned long x1, int x2)
{
  return whline(x0, x1, x2);
}

unsigned long _cffi_f_winch(WINDOW * x0)
{
  return winch(x0);
}

int _cffi_f_winnstr(WINDOW * x0, char * x1, int x2)
{
  return winnstr(x0, x1, x2);
}

int _cffi_f_winsch(WINDOW * x0, unsigned long x1)
{
  return winsch(x0, x1);
}

int _cffi_f_winsdelln(WINDOW * x0, int x1)
{
  return winsdelln(x0, x1);
}

int _cffi_f_winsertln(WINDOW * x0)
{
  return winsertln(x0);
}

int _cffi_f_winsnstr(WINDOW * x0, char const * x1, int x2)
{
  return winsnstr(x0, x1, x2);
}

int _cffi_f_winsstr(WINDOW * x0, char const * x1)
{
  return winsstr(x0, x1);
}

int _cffi_f_wmove(WINDOW * x0, int x1, int x2)
{
  return wmove(x0, x1, x2);
}

int _cffi_f_wnoutrefresh(WINDOW * x0)
{
  return wnoutrefresh(x0);
}

int _cffi_f_wredrawln(WINDOW * x0, int x1, int x2)
{
  return wredrawln(x0, x1, x2);
}

int _cffi_f_wrefresh(WINDOW * x0)
{
  return wrefresh(x0);
}

int _cffi_f_wresize(WINDOW * x0, int x1, int x2)
{
  return wresize(x0, x1, x2);
}

int _cffi_f_wscrl(WINDOW * x0, int x1)
{
  return wscrl(x0, x1);
}

int _cffi_f_wsetscrreg(WINDOW * x0, int x1, int x2)
{
  return wsetscrreg(x0, x1, x2);
}

int _cffi_f_wstandend(WINDOW * x0)
{
  return wstandend(x0);
}

int _cffi_f_wstandout(WINDOW * x0)
{
  return wstandout(x0);
}

void _cffi_f_wsyncdown(WINDOW * x0)
{
  wsyncdown(x0);
}

void _cffi_f_wsyncup(WINDOW * x0)
{
  wsyncup(x0);
}

void _cffi_f_wtimeout(WINDOW * x0, int x1)
{
  wtimeout(x0, x1);
}

int _cffi_f_wtouchln(WINDOW * x0, int x1, int x2, int x3)
{
  return wtouchln(x0, x1, x2, x3);
}

int _cffi_f_wvline(WINDOW * x0, unsigned long x1, int x2)
{
  return wvline(x0, x1, x2);
}

int _cffi_const__m_NCURSES_MOUSE_VERSION(long long *out_value)
{
  *out_value = (long long)(_m_NCURSES_MOUSE_VERSION);
  return (_m_NCURSES_MOUSE_VERSION) <= 0;
}

int _cffi_const__m_NetBSD(long long *out_value)
{
  *out_value = (long long)(_m_NetBSD);
  return (_m_NetBSD) <= 0;
}

int _cffi_const__m_STRICT_SYSV_CURSES(long long *out_value)
{
  *out_value = (long long)(_m_STRICT_SYSV_CURSES);
  return (_m_STRICT_SYSV_CURSES) <= 0;
}

int * _cffi_var_COLORS(void)
{
  return (&COLORS);
}

int * _cffi_var_COLOR_PAIRS(void)
{
  return (&COLOR_PAIRS);
}

int * _cffi_var_COLS(void)
{
  return (&COLS);
}

int * _cffi_var_LINES(void)
{
  return (&LINES);
}

unsigned long * _cffi_const_acs_map(void)
{
  return (acs_map);
}

WINDOW * * _cffi_var_stdscr(void)
{
  return (&stdscr);
}

