#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![warn(missing_debug_implementations)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::missing_safety_doc)]
use std::{char, ptr};
use cstring::*;
use shims::bindings;
pub type short_t = i16;
pub type chtype = bindings::chtype;
pub type cchar_t = bindings::cchar_t;
pub type wint_t = bindings::wint_t;
pub type wchar_t = bindings::wchar_t;
pub type attr_t = bindings::attr_t;
pub type FILE = *mut bindings::_IO_FILE;
pub type WINDOW = *mut bindings::_win_st;
pub type SCREEN = *mut bindings::screen;
static MODULE_PATH: &str = "ncursesw::shims::ncurses::";
mod wrapped {
use libc::{c_int, c_char};
use bindings::{chtype, WINDOW};
extern "C" {
pub static curscr: *mut WINDOW;
pub static newscr: *mut WINDOW;
pub static stdscr: *mut WINDOW;
pub static ttytype: *mut c_char;
pub static COLORS: c_int;
pub static COLOR_PAIRS: c_int;
pub static COLS: c_int;
pub static ESCDELAY: c_int;
pub static LINES: c_int;
pub static TABSIZE: c_int;
pub static mut acs_map: [chtype; 0];
}
}
pub unsafe fn curscr() -> WINDOW {
wrapped::curscr
}
pub unsafe fn newscr() -> WINDOW {
wrapped::newscr
}
pub unsafe fn stdscr() -> WINDOW {
wrapped::stdscr
}
pub unsafe fn ttytype() -> Option<String> {
wrapped::ttytype.as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub fn COLORS() -> i32 {
unsafe { wrapped::COLORS }
}
pub fn COLOR_PAIR(n: i32) -> i32 {
unsafe { bindings::COLOR_PAIR(n) }
}
pub fn PAIR_NUMBER(attr: i32) -> i32 {
unsafe { bindings::PAIR_NUMBER(attr) }
}
pub fn COLOR_PAIRS() -> i32 {
unsafe { wrapped::COLOR_PAIRS }
}
pub fn COLS() -> i32 {
unsafe { wrapped::COLS }
}
pub fn ESCDELAY() -> i32 {
unsafe { wrapped::ESCDELAY }
}
pub fn LINES() -> i32 {
unsafe { wrapped::LINES }
}
pub fn TABSIZE() -> i32 {
unsafe { wrapped::TABSIZE }
}
pub fn add_wch(wch: &cchar_t) -> i32 {
unsafe { bindings::add_wch(wch) }
}
pub fn add_wchnstr(wchstr: &[cchar_t], n: i32) -> i32 {
assert!(n > 0, "{}add_wchnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::add_wchnstr(wchstr.as_ptr(), n) }
}
pub fn add_wchstr(wchstr: &[cchar_t]) -> i32 {
unsafe { bindings::add_wchstr(wchstr.as_ptr()) }
}
pub fn addch(ch: chtype) -> i32 {
unsafe { bindings::addch(ch) }
}
pub fn addchnstr(chstr: &[chtype], n: i32) -> i32 {
assert!(n > 0, "{}addchnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::addchnstr(chstr.as_ptr(), n) }
}
pub fn addchstr(chstr: &[chtype]) -> i32 {
unsafe { bindings::addchstr(chstr.as_ptr()) }
}
pub fn addnstr(str: &[i8], n: i32) -> i32 {
assert!(n > 0, "{}addnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::addnstr(str.as_ptr(), n) }
}
pub fn addnwstr(wstr: &[wchar_t], n: i32) -> i32 {
assert!(n > 0, "{}addnwstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::addnwstr(wstr.as_ptr(), n) }
}
pub fn addstr(str: &[i8]) -> i32 {
unsafe { bindings::addstr(str.as_ptr()) }
}
pub fn addwstr(wstr: &[wchar_t]) -> i32 {
unsafe { bindings::addwstr(wstr.as_ptr()) }
}
pub fn alloc_pair(fg: i32, bg: i32) -> i32 {
unsafe { bindings::alloc_pair(fg, bg) }
}
pub fn assume_default_colors(fg: i32, bg: i32) -> i32 {
unsafe { bindings::assume_default_colors(fg, bg) }
}
pub unsafe fn attr_get(attrs: *mut attr_t, pair: *mut short_t, opts: *mut libc::c_void) -> i32 {
assert!(!attrs.is_null(), "{}attr_get() : attrs.is_null()", MODULE_PATH);
assert!(!pair.is_null(), "{}attr_get() : pair.is_null()", MODULE_PATH);
bindings::attr_get(attrs, pair, opts)
}
pub unsafe fn attr_off(attrs: attr_t, opts: *mut libc::c_void) -> i32 {
assert!(opts.is_null(), "{}attr_off() : !opts.is_null()", MODULE_PATH);
bindings::attr_off(attrs, opts)
}
pub unsafe fn attr_on(attrs: attr_t, opts: *mut libc::c_void) -> i32 {
assert!(opts.is_null(), "{}attr_on() : !opts.is_null()", MODULE_PATH);
bindings::attr_on(attrs, opts)
}
pub unsafe fn attr_set(attrs: attr_t, pair: short_t, opts: *mut libc::c_void) -> i32 {
bindings::attr_set(attrs, pair, opts)
}
pub fn attroff(attrs: i32) -> i32 {
unsafe { bindings::attroff(attrs) }
}
pub fn attron(attrs: i32) -> i32 {
unsafe { bindings::attron(attrs) }
}
pub fn attrset(attrs: i32) -> i32 {
unsafe { bindings::attrset(attrs) }
}
pub fn baudrate() -> i32 {
unsafe { bindings::baudrate() }
}
pub fn beep() -> i32 {
unsafe { bindings::beep() }
}
pub fn bkgd(ch: chtype) -> i32 {
unsafe { bindings::bkgd(ch) }
}
pub fn bkgdset(ch: chtype) {
unsafe { bindings::bkgdset(ch) }
}
pub fn bkgrnd(wch: &cchar_t) -> i32 {
unsafe { bindings::bkgrnd(wch) }
}
pub fn bkgrndset(wch: &cchar_t) {
unsafe { bindings::bkgrndset(wch) }
}
pub fn border(
ls: chtype,
rs: chtype,
ts: chtype,
bs: chtype,
tl: chtype,
tr: chtype,
bl: chtype,
br: chtype
) -> i32 {
unsafe { bindings::border(ls, rs, ts, bs, tl, tr, bl, br) }
}
pub fn border_set(
ls: &cchar_t,
rs: &cchar_t,
ts: &cchar_t,
bs: &cchar_t,
tl: &cchar_t,
tr: &cchar_t,
bl: &cchar_t,
br: &cchar_t
) -> i32 {
unsafe { bindings::border_set(ls, rs, ts, bs, tl, tr, bl, br) }
}
pub unsafe fn r#box(win: WINDOW, verch: chtype, horch: chtype) -> i32 {
assert!(!win.is_null(), "{}box() : win.is_null()", MODULE_PATH);
bindings::box_(win, verch, horch)
}
pub unsafe fn box_set(win: WINDOW, verch: &cchar_t, horch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}box_set() : win.is_null()", MODULE_PATH);
bindings::box_set(win, verch, horch)
}
pub fn can_change_color() -> bool {
unsafe { bindings::can_change_color() }
}
pub fn cbreak() -> i32 {
unsafe { bindings::cbreak() }
}
pub unsafe fn chgat(n: i32, attr: attr_t, pair: short_t, opts: *const libc::c_void) -> i32 {
assert!(n > 0, "{}chgat() : n = {}", MODULE_PATH, n);
bindings::chgat(n, attr, pair, opts)
}
pub fn clear() -> i32 {
unsafe { bindings::clear() }
}
pub unsafe fn clearok(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}clear_ok() : win.is_null()", MODULE_PATH);
bindings::clearok(win, bf)
}
pub fn clrtobot() -> i32 {
unsafe { bindings::clrtobot() }
}
pub fn clrtoeol() -> i32 {
unsafe { bindings::clrtoeol() }
}
pub unsafe fn color_content(color: short_t, r: *mut short_t, g: *mut short_t, b: *mut short_t) -> i32 {
assert!(!r.is_null(), "{}color_content() : r.is_null()", MODULE_PATH);
assert!(!g.is_null(), "{}color_content() : g.is_null()", MODULE_PATH);
assert!(!b.is_null(), "{}color_content() : b.is_null()", MODULE_PATH);
bindings::color_content(color, r, g, b)
}
pub unsafe fn color_set(pair: short_t, opts: *mut libc::c_void) -> i32 {
bindings::color_set(pair, opts)
}
pub unsafe fn copywin(
srcwin: WINDOW,
dstwin: WINDOW,
sminrow: i32,
smincol: i32,
dminrow: i32,
dmincol: i32,
dmaxrow: i32,
dmaxcol: i32,
overlay: i32
) -> i32 {
assert!(!srcwin.is_null(), "{}copy_win() : srcwin.is_null()", MODULE_PATH);
assert!(!dstwin.is_null(), "{}copy_win() : dstwin.is_null()", MODULE_PATH);
assert!(sminrow >= 0, "{}copy_win() : sminrow = {}", MODULE_PATH, sminrow);
assert!(smincol >= 0, "{}copy_win() : smincol = {}", MODULE_PATH, smincol);
assert!(dminrow >= 0, "{}copy_win() : dminrow = {}", MODULE_PATH, dminrow);
assert!(dmincol >= 0, "{}copy_win() : dmincol = {}", MODULE_PATH, dmincol);
assert!(dmaxrow >= 0, "{}copy_win() : dmaxrow = {}", MODULE_PATH, dmaxrow);
assert!(dmaxcol >= 0, "{}copy_win() : dmaxcol = {}", MODULE_PATH, dmaxcol);
bindings::copywin(srcwin, dstwin, sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, overlay)
}
pub fn curs_set(visibility: i32) -> i32 {
unsafe { bindings::curs_set(visibility) }
}
pub fn curses_version() -> Option<String> {
unsafe { (bindings::curses_version() as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn def_prog_mode() -> i32 {
unsafe { bindings::def_prog_mode() }
}
pub fn def_shell_mode() -> i32 {
unsafe { bindings::def_shell_mode() }
}
pub unsafe fn define_key(definition: *mut i8, keycode: i32) -> i32 {
bindings::define_key(definition, keycode)
}
pub fn delay_output(ms: i32) -> i32 {
unsafe { bindings::delay_output(ms) }
}
pub fn delch() -> i32 {
unsafe { bindings::delch() }
}
pub fn deleteln() -> i32 {
unsafe { bindings::deleteln() }
}
pub unsafe fn delscreen(sp: SCREEN) {
assert!(!sp.is_null(), "{}delscreen() : sp.is_null()", MODULE_PATH);
bindings::delscreen(sp)
}
pub unsafe fn delwin(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}delwin() : win.is_null()", MODULE_PATH);
bindings::delwin(win)
}
pub unsafe fn derwin(orig: WINDOW, nlines: i32, ncols: i32, begin_y: i32, begin_x: i32) -> Option<WINDOW> {
assert!(!orig.is_null(), "{}derwin() : orig.is_null()", MODULE_PATH);
assert!(nlines >= 0, "{}derwin() : nlines = {}", MODULE_PATH, nlines);
assert!(ncols >= 0, "{}derwin() : ncols = {}", MODULE_PATH, ncols);
assert!(begin_y >= 0, "{}derwin() : begin_y = {}", MODULE_PATH, begin_y);
assert!(begin_x >= 0, "{}derwin() : begin_x = {}", MODULE_PATH, begin_x);
bindings::derwin(orig, nlines, ncols, begin_y, begin_x).as_mut().map(|ptr| ptr as WINDOW)
}
pub fn doupdate() -> i32 {
unsafe { bindings::doupdate() }
}
pub unsafe fn dupwin(win: WINDOW) -> Option<WINDOW> {
assert!(!win.is_null(), "{}dupwin() : win.is_null()", MODULE_PATH);
bindings::dupwin(win).as_mut().map(|ptr| ptr as WINDOW)
}
pub fn echo() -> i32 {
unsafe { bindings::echo() }
}
pub fn echo_wchar(wch: &cchar_t) -> i32 {
unsafe { bindings::echo_wchar(wch) }
}
pub fn echochar(ch: chtype) -> i32 {
unsafe { bindings::echochar(ch) }
}
pub fn endwin() -> i32 {
unsafe { bindings::endwin() }
}
pub fn erase() -> i32 {
unsafe { bindings::erase() }
}
pub fn erasechar() -> i8 {
unsafe { bindings::erasechar() }
}
pub unsafe fn erasewchar(ch: *mut wchar_t) -> i32 {
assert!(!ch.is_null(), "{}erasewchar() : ch.is_null()", MODULE_PATH);
bindings::erasewchar(ch)
}
pub unsafe fn extended_color_content(color: i32, r: *mut i32, g: *mut i32, b: *mut i32) -> i32 {
assert!(!r.is_null(), "{}extended_color_content() : r.is_null()", MODULE_PATH);
assert!(!g.is_null(), "{}extended_color_content() : g.is_null()", MODULE_PATH);
assert!(!b.is_null(), "{}extended_color_content() : b.is_null()", MODULE_PATH);
bindings::extended_color_content(color, r, g, b)
}
pub unsafe fn extended_pair_content(pair: i32, fg: *mut i32, bg: *mut i32) -> i32 {
assert!(!fg.is_null(), "{}extended_pair_content() : fg.is_null()", MODULE_PATH);
assert!(!bg.is_null(), "{}extended_pair_content() : bg.is_null()", MODULE_PATH);
bindings::extended_pair_content(pair, fg, bg)
}
pub fn extended_slk_color(pair: i32) -> i32 {
unsafe { bindings::extended_slk_color(pair) }
}
pub fn filter() {
unsafe { bindings::filter() }
}
pub fn find_pair(fg: i32, bg: i32) -> i32 {
unsafe { bindings::find_pair(fg, bg) }
}
pub fn flash() -> i32 {
unsafe { bindings::flash() }
}
pub fn flushinp() -> i32 {
unsafe { bindings::flushinp() }
}
pub fn free_pair(pair: i32) -> i32 {
unsafe { bindings::free_pair(pair) }
}
pub fn get_escdelay() -> i32 {
unsafe { bindings::get_escdelay() }
}
pub unsafe fn get_wch(wch: *mut wint_t) -> i32 {
assert!(!wch.is_null(), "{}get_wch() : wch.is_null()", MODULE_PATH);
bindings::get_wch(wch)
}
pub unsafe fn get_wstr(wstr: *mut wint_t) -> i32 {
assert!(!wstr.is_null(), "{}get_wstr() : wstr.is_null()", MODULE_PATH);
bindings::get_wstr(wstr)
}
pub unsafe fn getattrs(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getattrs() : win.is_null()", MODULE_PATH);
bindings::getattrs(win)
}
pub unsafe fn getbegx(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getbegx() : win.is_null()", MODULE_PATH);
bindings::getbegx(win)
}
pub unsafe fn getbegy(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getbegy() : win.is_null()", MODULE_PATH);
bindings::getbegy(win)
}
pub unsafe fn getbkgd(win: WINDOW) -> chtype {
assert!(!win.is_null(), "{}getbkgd() : win.is_null()", MODULE_PATH);
bindings::getbkgd(win)
}
pub unsafe fn getbkgrnd(wch: *mut cchar_t) -> i32 {
assert!(!wch.is_null(), "{}getbkgrnd() : wch.is_null()", MODULE_PATH);
bindings::getbkgrnd(wch)
}
pub unsafe fn getcchar(wcval: &cchar_t, wch: *mut wchar_t, attrs: *mut attr_t, color_pair: *mut short_t, opts: *mut i32) -> i32 {
assert!(!wch.is_null(), "{}getcchar() : wch.is_null()", MODULE_PATH);
assert!(!attrs.is_null(), "{}getcchar() : attrs.is_null()", MODULE_PATH);
assert!(!color_pair.is_null(), "{}getcchar() : color_pair.is_null()", MODULE_PATH);
assert!(opts.is_null(), "{}getcchar() : !opts.is_null()", MODULE_PATH);
bindings::getcchar(wcval, wch, attrs, color_pair, opts)
}
pub fn getch() -> i32 {
unsafe { bindings::getch() }
}
pub unsafe fn getcurx(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getcurx() : win.is_null()", MODULE_PATH);
bindings::getcurx(win)
}
pub unsafe fn getcury(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getcury() : win.is_null()", MODULE_PATH);
bindings::getcury(win)
}
pub unsafe fn getmaxx(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getmaxx() : win.is_null()", MODULE_PATH);
bindings::getmaxx(win)
}
pub unsafe fn getmaxy(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getmaxy() : win.is_null()", MODULE_PATH);
bindings::getmaxy(win)
}
pub unsafe fn getn_wstr(wstr: *mut wint_t, n: i32) -> i32 {
assert!(!wstr.is_null(), "{}getn_wstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}getn_wstr() : n = {}", MODULE_PATH, n);
bindings::getn_wstr(wstr, n)
}
pub unsafe fn getnstr(str: *mut i8, n: i32) -> i32 {
assert!(!str.is_null(), "{}getnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}getnstr() : n = {}", MODULE_PATH, n);
bindings::getnstr(str, n)
}
pub unsafe fn getparx(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getparx() : win.is_null()", MODULE_PATH);
bindings::getparx(win)
}
pub unsafe fn getpary(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}getpary() : win.is_null()", MODULE_PATH);
bindings::getpary(win)
}
pub unsafe fn getstr(str: *mut i8) -> i32 {
assert!(!str.is_null(), "{}getstr() : str.is_null()", MODULE_PATH);
bindings::getstr(str)
}
pub unsafe fn getwin(filep: FILE) -> Option<WINDOW> {
assert!(!filep.is_null(), "{}getwin() : filep.is_null()", MODULE_PATH);
bindings::getwin(filep).as_mut().map(|ptr| ptr as WINDOW)
}
pub fn halfdelay(tenths: i32) -> i32 {
unsafe { bindings::halfdelay(tenths) }
}
pub fn has_colors() -> bool {
unsafe { bindings::has_colors() }
}
pub fn has_ic() -> bool {
unsafe { bindings::has_ic() }
}
pub fn has_il() -> bool {
unsafe { bindings::has_il() }
}
pub fn has_key(ch: i32) -> i32 {
unsafe { bindings::has_key(ch) }
}
pub fn hline(ch: chtype, n: i32) -> i32 {
assert!(n > 0, "{}hline() : n = {}", MODULE_PATH, n);
unsafe { bindings::hline(ch, n) }
}
pub fn hline_set(wch: &cchar_t, n: i32) -> i32 {
assert!(n > 0, "{}hline_set() : n = {}", MODULE_PATH, n);
unsafe { bindings::hline_set(wch, n) }
}
pub unsafe fn idcok(win: WINDOW, bf: bool) {
assert!(!win.is_null(), "{}idcok() : win.is_null()", MODULE_PATH);
bindings::idcok(win, bf)
}
pub unsafe fn idlok(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}idlcok() : win.is_null()", MODULE_PATH);
bindings::idlok(win, bf)
}
pub unsafe fn immedok(win: WINDOW, bf: bool) {
assert!(!win.is_null(), "{}immedok() : win.is_null()", MODULE_PATH);
bindings::immedok(win, bf)
}
pub unsafe fn in_wch(wcval: *mut cchar_t) -> i32 {
assert!(!wcval.is_null(), "{}in_wch() : wcval.is_null()", MODULE_PATH);
bindings::in_wch(wcval)
}
pub unsafe fn in_wchnstr(wchstr: *mut cchar_t, n: i32) -> i32 {
assert!(!wchstr.is_null(), "{}in_wchnstr() : wchstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}in_wchnstr() : n = {}", MODULE_PATH, n);
bindings::in_wchnstr(wchstr, n)
}
pub unsafe fn in_wchstr(wchstr: *mut cchar_t) -> i32 {
assert!(!wchstr.is_null(), "{}in_wchstr() : wchstr.is_null()", MODULE_PATH);
bindings::in_wchstr(wchstr)
}
pub fn inch() -> chtype {
unsafe { bindings::inch() }
}
pub unsafe fn inchnstr(chstr: *mut chtype, n: i32) -> i32 {
assert!(!chstr.is_null(), "{}inchnstr() : chstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}inchnstr() : n = {}", MODULE_PATH, n);
bindings::inchnstr(chstr, n)
}
pub unsafe fn inchstr(chstr: *mut chtype) -> i32 {
assert!(!chstr.is_null(), "{}inchstr() : chstr.is_null()", MODULE_PATH);
bindings::inchstr(chstr)
}
pub fn init_color(color: short_t, r: short_t, g: short_t, b: short_t) -> i32 {
unsafe { bindings::init_color(color, r, g, b) }
}
pub fn init_extended_color(color: i32, r: i32, g: i32, b: i32) -> i32 {
unsafe { bindings::init_extended_color(color, r, g, b) }
}
pub fn init_extended_pair(color: i32, f: i32, b: i32) -> i32 {
unsafe { bindings::init_extended_pair(color, f, b) }
}
pub fn init_pair(pair: short_t, f: short_t, b: short_t) -> i32 {
unsafe { bindings::init_pair(pair, f, b) }
}
pub unsafe fn initscr() -> Option<WINDOW> {
bindings::initscr().as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn innstr(str: *mut i8, n: i32) -> i32 {
assert!(!str.is_null(), "{}innstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}innstr() : n = {}", MODULE_PATH, n);
bindings::innstr(str, n)
}
pub unsafe fn innwstr(wstr: *mut wchar_t, n: i32) -> i32 {
assert!(!wstr.is_null(), "{}innwstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}innwstr() : n = {}", MODULE_PATH, n);
bindings::innwstr(wstr, n)
}
pub fn ins_nwstr(wstr: &[wchar_t], n: i32) -> i32 {
assert!(n > 0, "{}ins_nwstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::ins_nwstr(wstr.as_ptr(), n) }
}
pub fn ins_wch(wch: &cchar_t) -> i32 {
unsafe { bindings::ins_wch(wch) }
}
pub fn ins_wstr(wstr: &[wchar_t]) -> i32 {
unsafe { bindings::ins_wstr(wstr.as_ptr()) }
}
pub fn insch(ch: chtype) -> i32 {
unsafe { bindings::insch(ch) }
}
pub fn insdelln(n: i32) -> i32 {
unsafe { bindings::insdelln(n) }
}
pub fn insertln() -> i32 {
unsafe { bindings::insertln() }
}
pub fn insnstr(str: &[i8], n: i32) -> i32 {
assert!(n > 0, "{}insnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::insnstr(str.as_ptr(), n) }
}
pub fn insstr(str: &[i8]) -> i32 {
unsafe { bindings::insstr(str.as_ptr()) }
}
pub unsafe fn instr(str: *mut i8) -> i32 {
assert!(!str.is_null(), "{}instr() : str.is_null()", MODULE_PATH);
bindings::instr(str)
}
pub unsafe fn intrflush(win: WINDOW, bf: bool) -> i32 {
bindings::intrflush(win, bf)
}
pub unsafe fn inwstr(wstr: *mut wchar_t) -> i32 {
assert!(!wstr.is_null(), "{}inwstr() : wstr.is_null()", MODULE_PATH);
bindings::inwstr(wstr)
}
pub unsafe fn is_cleared(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_cleared() : win.is_null()", MODULE_PATH);
bindings::is_cleared(win)
}
pub unsafe fn is_idcok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_idcok() : win.is_null()", MODULE_PATH);
bindings::is_idcok(win)
}
pub unsafe fn is_idlok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_idlcok() : win.is_null()", MODULE_PATH);
bindings::is_idlok(win)
}
pub unsafe fn is_immedok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_immedok() : win.is_null()", MODULE_PATH);
bindings::is_immedok(win)
}
pub unsafe fn is_keypad(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_keypad() : win.is_null()", MODULE_PATH);
bindings::is_keypad(win)
}
pub unsafe fn is_leaveok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_leaveok() : win.is_null()", MODULE_PATH);
bindings::is_leaveok(win)
}
pub unsafe fn is_linetouched(win: WINDOW, l: i32) -> bool {
assert!(!win.is_null(), "{}is_linetouched() : win.is_null()", MODULE_PATH);
bindings::is_linetouched(win, l)
}
pub unsafe fn is_nodelay(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_nodelay() : win.is_null()", MODULE_PATH);
bindings::is_nodelay(win)
}
pub unsafe fn is_notimeout(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_notimeout() : win.is_null()", MODULE_PATH);
bindings::is_notimeout(win)
}
pub unsafe fn is_pad(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_pad() : win.is_null()", MODULE_PATH);
bindings::is_pad(win)
}
pub unsafe fn is_scrollok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_scrollok() : win.is_null()", MODULE_PATH);
bindings::is_scrollok(win)
}
pub unsafe fn is_subwin(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_subwin() : win.is_null()", MODULE_PATH);
bindings::is_subwin(win)
}
pub unsafe fn is_syncok(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_syncok() : win.is_null()", MODULE_PATH);
bindings::is_syncok(win)
}
pub fn is_term_resized(lines: i32, cols: i32) -> bool {
assert!(lines >= 0, "{}is_term_resized() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}is_term_resized() : cols = {}", MODULE_PATH, cols);
unsafe { bindings::is_term_resized(lines, cols) }
}
pub unsafe fn is_wintouched(win: WINDOW) -> bool {
assert!(!win.is_null(), "{}is_wintouched() : win.is_null()", MODULE_PATH);
bindings::is_wintouched(win)
}
pub fn isendwin() -> bool {
unsafe { bindings::isendwin() }
}
pub fn key_defined(definition: &[i8]) -> i32 {
unsafe { bindings::key_defined(definition.as_ptr()) }
}
pub fn key_name(w: wchar_t) -> Option<String> {
unsafe { (bindings::key_name(w) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn keybound(keycode: i32, count: i32) -> Option<String> {
unsafe { (bindings::keybound(keycode, count) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn keyname(c: i32) -> Option<String> {
unsafe { (bindings::keyname(c) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn keyok(keycode: i32, enable: bool) -> i32 {
unsafe { bindings::keyok(keycode, enable) }
}
pub unsafe fn keypad(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}keypad() : win.is_null()", MODULE_PATH);
bindings::keypad(win, bf)
}
pub fn killchar() -> i8 {
unsafe { bindings::killchar() }
}
pub unsafe fn killwchar(ch: *mut wchar_t) -> i32 {
assert!(!ch.is_null(), "{}killwchar() : ch.is_null()", MODULE_PATH);
bindings::killwchar(ch)
}
pub unsafe fn leaveok(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}leaveok() : win.is_null()", MODULE_PATH);
bindings::leaveok(win, bf)
}
pub fn longname() -> Option<String> {
unsafe { (bindings::longname() as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub unsafe fn mcprint(data: *mut i8, len: i32) -> i32 {
assert!(!data.is_null(), "{}mcprint() : data.is_null()", MODULE_PATH);
assert!(len > 0, "{}mcprint() : n = {}", MODULE_PATH, len);
bindings::mcprint(data, len)
}
pub unsafe fn meta(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}meta() : win.is_null()", MODULE_PATH);
bindings::meta(win, bf)
}
pub fn r#move(y: i32, x: i32) -> i32 {
assert!(y >= 0, "{}r#move() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}r#move() : x = {}", MODULE_PATH, x);
unsafe { bindings::move_(y, x) }
}
pub fn mvadd_wch(y: i32, x: i32, wch: &cchar_t) -> i32 {
assert!(y >= 0, "{}mvadd_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvadd_wch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvadd_wch(y, x, wch) }
}
pub fn mvadd_wchnstr(y: i32, x: i32, wchstr: &[cchar_t], n: i32) -> i32 {
assert!(y >= 0, "{}mvadd_wchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvadd_wchnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvadd_wchnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvadd_wchnstr(y, x, wchstr.as_ptr(), n) }
}
pub fn mvadd_wchstr(y: i32, x: i32, wchstr: &[cchar_t]) -> i32 {
assert!(y >= 0, "{}mvadd_wchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvadd_wchstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvadd_wchstr(y, x, wchstr.as_ptr()) }
}
pub fn mvaddch(y: i32, x: i32, ch: chtype) -> i32 {
assert!(y >= 0, "{}mvaddch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvaddch(y, x, ch) }
}
pub fn mvaddchnstr(y: i32, x: i32, chstr: &[chtype], n: i32) -> i32 {
assert!(y >= 0, "{}mvaddchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddchnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvaddchnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvaddchnstr(y, x, chstr.as_ptr(), n) }
}
pub fn mvaddchstr(y: i32, x: i32, chstr: &[chtype]) -> i32 {
assert!(y >= 0, "{}mvaddchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddchstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvaddchstr(y, x, chstr.as_ptr()) }
}
pub fn mvaddnstr(y: i32, x: i32, str: &[i8], n: i32) -> i32 {
assert!(y >= 0, "{}mvaddnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvaddnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvaddnstr(y, x, str.as_ptr(), n) }
}
pub fn mvaddnwstr(y: i32, x: i32, wstr: &[wchar_t], n: i32) -> i32 {
assert!(y >= 0, "{}mvaddnwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddnwstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvaddnwstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvaddnwstr(y, x, wstr.as_ptr(), n) }
}
pub fn mvaddstr(y: i32, x: i32, str: &[i8]) -> i32 {
assert!(y >= 0, "{}mvaddstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvaddstr(y, x, str.as_ptr()) }
}
pub fn mvaddwstr(y: i32, x: i32, wstr: &[wchar_t]) -> i32 {
assert!(y >= 0, "{}mvaddwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvaddwstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvaddwstr(y, x, wstr.as_ptr()) }
}
pub unsafe fn mvchgat(y: i32, x: i32, n: i32, attr: attr_t, color: short_t, opts: *const libc::c_void) -> i32 {
assert!(y >= 0, "{}mvchgat() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvchgat() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvchgat() : n = {}", MODULE_PATH, n);
bindings::mvchgat(y, x, n, attr, color, opts)
}
pub fn mvcur(oldrow: i32, oldcol: i32, newrow: i32, newcol: i32) -> i32 {
assert!(oldrow >= 0, "{}mvcur() : oldrow = {}", MODULE_PATH, oldrow);
assert!(oldcol >= 0, "{}mvcur() : oldcol = {}", MODULE_PATH, oldcol);
assert!(newrow >= 0, "{}mvcur() : newrow = {}", MODULE_PATH, newrow);
assert!(newcol >= 0, "{}mvcur() : newcol = {}", MODULE_PATH, newcol);
unsafe { bindings::mvcur(oldrow, oldcol, newrow, newcol) }
}
pub fn mvdelch(y: i32, x: i32) -> i32 {
assert!(y >= 0, "{}mvdelch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvdelch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvdelch(y, x) }
}
pub unsafe fn mvderwin(win: WINDOW, y: i32, x: i32) -> i32 {
assert!(!win.is_null(), "{}mvderwin() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvderwin() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvderwin() : x = {}", MODULE_PATH, x);
bindings::mvderwin(win, y, x)
}
pub unsafe fn mvget_wch(y: i32, x: i32, wch: *mut wint_t) -> i32 {
assert!(y >= 0, "{}mvget_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvget_wch() : x = {}", MODULE_PATH, x);
assert!(!wch.is_null(), "{}mvget_wch() : wch.is_null()", MODULE_PATH);
bindings::mvget_wch(y, x, wch)
}
pub unsafe fn mvget_wstr(y: i32, x: i32, wstr: *mut wint_t) -> i32 {
assert!(y >= 0, "{}mvget_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvget_wstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvget_wstr() : wstr.is_null()", MODULE_PATH);
bindings::mvget_wstr(y, x, wstr)
}
pub fn mvgetch(y: i32, x: i32) -> i32 {
assert!(y >= 0, "{}mvgetch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvgetch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvgetch(y, x) }
}
pub unsafe fn mvgetn_wstr(y: i32, x: i32, wstr: *mut wint_t, n: i32) -> i32 {
assert!(y >= 0, "{}mvgetn_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvgetn_wstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvgetn_wstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvgetn_wstr() : n = {}", MODULE_PATH, n);
bindings::mvgetn_wstr(y, x, wstr, n)
}
pub unsafe fn mvgetnstr(y: i32, x: i32, str: *mut i8, n: i32) -> i32 {
assert!(y >= 0, "{}mvgetnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvgetnstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvgetnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvgetnstr() : n = {}", MODULE_PATH, n);
bindings::mvgetnstr(y, x, str, n)
}
pub unsafe fn mvgetstr(y: i32, x: i32, str: *mut i8) -> i32 {
assert!(y >= 0, "{}mvgetstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvgetstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvgetstr() : str.is_null()", MODULE_PATH);
bindings::mvgetstr(y, x, str)
}
pub fn mvhline(y: i32, x: i32, ch: chtype, n: i32) -> i32 {
assert!(y >= 0, "{}mvhline() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvhline() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvhline() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvhline(y, x, ch, n) }
}
pub fn mvhline_set(y: i32, x: i32, wch: &cchar_t, n: i32) -> i32 {
assert!(y >= 0, "{}mvhline_set() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvhline_set() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvhline_set() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvhline_set(y, x, wch, n) }
}
pub unsafe fn mvin_wch(y: i32, x: i32, wcval: *mut cchar_t) -> i32 {
assert!(y >= 0, "{}mvin_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvin_wch() : x = {}", MODULE_PATH, x);
assert!(!wcval.is_null(), "{}mvin_wch() : wcval.is_null()", MODULE_PATH);
bindings::mvin_wch(y, x, wcval)
}
pub unsafe fn mvin_wchnstr(y: i32, x: i32, wchstr: *mut cchar_t, n: i32) -> i32 {
assert!(y >= 0, "{}mvin_wchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvin_wchnstr() : x = {}", MODULE_PATH, x);
assert!(!wchstr.is_null(), "{}mvin_wchnstr() : wchstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvin_wchnstr() : n = {}", MODULE_PATH, n);
bindings::mvin_wchnstr(y, x, wchstr, n)
}
pub unsafe fn mvin_wchstr(y: i32, x: i32, wchstr: *mut cchar_t) -> i32 {
assert!(y >= 0, "{}mvin_wchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvin_wchstr() : x = {}", MODULE_PATH, x);
assert!(!wchstr.is_null(), "{}in_mvchstr() : wchstr.is_null()", MODULE_PATH);
bindings::mvin_wchstr(y, x, wchstr)
}
pub fn mvinch(y: i32, x: i32) -> chtype {
assert!(y >= 0, "{}mvinch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvinch(y, x) }
}
pub unsafe fn mvinchnstr(y: i32, x: i32, chstr: *mut chtype, n: i32) -> i32 {
assert!(y >= 0, "{}mvinchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinchnstr() : x = {}", MODULE_PATH, x);
assert!(!chstr.is_null(), "{}mvinchnstr() : chstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvinchnstr() : n = {}", MODULE_PATH, n);
bindings::mvinchnstr(y, x, chstr, n)
}
pub unsafe fn mvinchstr(y: i32, x: i32, chstr: *mut chtype) -> i32 {
assert!(y >= 0, "{}mvinchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinchstr() : x = {}", MODULE_PATH, x);
assert!(!chstr.is_null(), "{}mvinchstr() : chstr.is_null()", MODULE_PATH);
bindings::mvinchstr(y, x, chstr)
}
pub unsafe fn mvinnstr(y: i32, x: i32, str: *mut i8, n: i32) -> i32 {
assert!(y >= 0, "{}mvinnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinnstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvinnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvinnstr() : n = {}", MODULE_PATH, n);
bindings::mvinnstr(y, x, str, n)
}
pub unsafe fn mvinnwstr(y: i32, x: i32, wstr: *mut wchar_t, n: i32) -> i32 {
assert!(y >= 0, "{}mvinnwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinnwstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvinnwstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvinnwstr() : n = {}", MODULE_PATH, n);
bindings::mvinnwstr(y, x, wstr, n)
}
pub fn mvins_nwstr(y: i32, x: i32, wstr: &[wchar_t], n: i32) -> i32 {
assert!(y >= 0, "{}mvins_nwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvins_nwstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvins_nwstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvins_nwstr(y, x, wstr.as_ptr(), n) }
}
pub fn mvins_wch(y: i32, x: i32, wch: &cchar_t) -> i32 {
assert!(y >= 0, "{}mvins_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvins_wch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvins_wch(y, x, wch) }
}
pub fn mvins_wstr(y: i32, x: i32, wstr: &[wchar_t]) -> i32 {
assert!(y >= 0, "{}mvins_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvins_wstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvins_wstr(y, x, wstr.as_ptr()) }
}
pub fn mvinsch(y: i32, x: i32, ch: chtype) -> i32 {
assert!(y >= 0, "{}mvinsch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinsch() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvinsch(y, x, ch) }
}
pub fn mvinsnstr(y: i32, x: i32, str: &[i8], n: i32) -> i32 {
assert!(y >= 0, "{}mvinsnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinsnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvinsnstr() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvinsnstr(y, x, str.as_ptr(), n) }
}
pub fn mvinsstr(y: i32, x: i32, str: &[i8]) -> i32 {
assert!(y >= 0, "{}mvinsstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinsstr() : x = {}", MODULE_PATH, x);
unsafe { bindings::mvinsstr(y, x, str.as_ptr()) }
}
pub unsafe fn mvinstr(y: i32, x: i32, str: *mut i8) -> i32 {
assert!(y >= 0, "{}mvinstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvinstr() : str.is_null()", MODULE_PATH);
bindings::mvinstr(y, x, str)
}
pub unsafe fn mvinwstr(y: i32, x: i32, wstr: *mut wchar_t) -> i32 {
assert!(y >= 0, "{}mvinwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvinwstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvinwstr() : wstr.is_null()", MODULE_PATH);
bindings::mvinwstr(y, x, wstr)
}
pub fn mvvline(y: i32, x: i32, ch: chtype, n: i32) -> i32 {
assert!(y >= 0, "{}mvvline() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvvline() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvvline() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvvline(y, x, ch, n) }
}
pub fn mvvline_set(y: i32, x: i32, wch: &cchar_t, n: i32) -> i32 {
assert!(y >= 0, "{}mvvline_set() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvvline_set() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvvline_set() : n = {}", MODULE_PATH, n);
unsafe { bindings::mvvline_set(y, x, wch, n) }
}
pub unsafe fn mvwadd_wch(win: WINDOW, y: i32, x: i32, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}mvwadd_wch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwadd_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwadd_wch() : x = {}", MODULE_PATH, x);
bindings::mvwadd_wch(win, y, x, wch)
}
pub unsafe fn mvwadd_wchnstr(win: WINDOW, y: i32, x: i32, wchstr: &[cchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwadd_wchnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwadd_wchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwadd_wchnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvadd_wchnstr() : n = {}", MODULE_PATH, n);
bindings::mvwadd_wchnstr(win, y, x, wchstr.as_ptr(), n)
}
pub unsafe fn mvwadd_wchstr(win: WINDOW, y: i32, x: i32, wchstr: &[cchar_t]) -> i32 {
assert!(!win.is_null(), "{}mvwadd_wchstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwadd_wchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwadd_wchstr() : x = {}", MODULE_PATH, x);
bindings::mvwadd_wchstr(win, y, x, wchstr.as_ptr())
}
pub unsafe fn mvwaddch(win: WINDOW, y: i32, x: i32, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}mvwaddch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddch() : x = {}", MODULE_PATH, x);
bindings::mvwaddch(win, y, x, ch)
}
pub unsafe fn mvwaddchnstr(win: WINDOW, y: i32, x: i32, chstr: &[chtype], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwaddchnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddchnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvaddchnstr() : n = {}", MODULE_PATH, n);
bindings::mvwaddchnstr(win, y, x, chstr.as_ptr(), n)
}
pub unsafe fn mvwaddchstr(win: WINDOW, y: i32, x: i32, chstr: &[chtype]) -> i32 {
assert!(!win.is_null(), "{}mvwaddchstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddchstr() : x = {}", MODULE_PATH, x);
bindings::mvwaddchstr(win, y, x, chstr.as_ptr())
}
pub unsafe fn mvwaddnstr(win: WINDOW, y: i32, x: i32, str: &[i8], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwaddnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddnstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwaddnstr() : n = {}", MODULE_PATH, n);
bindings::mvwaddnstr(win, y, x, str.as_ptr(), n)
}
pub unsafe fn mvwaddnwstr(win: WINDOW, y: i32, x: i32, wstr: &[wchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwaddnwstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddnwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddnwstr() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwaddnwstr() : n = {}", MODULE_PATH, n);
bindings::mvwaddnwstr(win, y, x, wstr.as_ptr(), n)
}
pub unsafe fn mvwaddstr(win: WINDOW, y: i32, x: i32, str: &[i8]) -> i32 {
assert!(!win.is_null(), "{}mvwaddstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddstr() : x = {}", MODULE_PATH, x);
bindings::mvwaddstr(win, y, x, str.as_ptr())
}
pub unsafe fn mvwaddwstr(win: WINDOW, y: i32, x: i32, wstr: &[wchar_t]) -> i32 {
assert!(!win.is_null(), "{}mvwaddwstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwaddwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwaddwstr() : x = {}", MODULE_PATH, x);
bindings::mvwaddwstr(win, y, x, wstr.as_ptr())
}
pub unsafe fn mvwchgat(win: WINDOW, y: i32, x: i32, n: i32, attr: attr_t, color: short_t, opts: *const libc::c_void) -> i32 {
assert!(!win.is_null(), "{}mvwchgat() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwchgat() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwchgat() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwchgat() : n = {}", MODULE_PATH, n);
bindings::mvwchgat(win, y, x, n, attr, color, opts)
}
pub unsafe fn mvwdelch(win: WINDOW, y: i32, x: i32) -> i32 {
assert!(!win.is_null(), "{}mvwdelch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwdelch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwdelch() : x = {}", MODULE_PATH, x);
bindings::mvwdelch(win, y, x)
}
pub unsafe fn mvwget_wch(win: WINDOW, y: i32, x: i32, wch: *mut wint_t) -> i32 {
assert!(!win.is_null(), "{}mvwget_wch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwget_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwget_wch() : x = {}", MODULE_PATH, x);
assert!(!wch.is_null(), "{}mvwget_wch() : wch.is_null()", MODULE_PATH);
bindings::mvwget_wch(win, y, x, wch)
}
pub unsafe fn mvwget_wstr(win: WINDOW, y: i32, x: i32, wstr: *mut wint_t) -> i32 {
assert!(!win.is_null(), "{}mvwget_wstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwget_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwget_wstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvwget_wstr() : wstr.is_null()", MODULE_PATH);
bindings::mvwget_wstr(win, y, x, wstr)
}
pub unsafe fn mvwgetch(win: WINDOW, y: i32, x: i32) -> i32 {
assert!(!win.is_null(), "{}mvwgetch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwgetch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwgetch() : x = {}", MODULE_PATH, x);
bindings::mvwgetch(win, y, x)
}
pub unsafe fn mvwgetn_wstr(win: WINDOW, y: i32, x: i32, wstr: *mut wint_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwgetn_wstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwgetn_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwgetn_wstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvwgetn_wstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwgetn_wstr() : n = {}", MODULE_PATH, n);
bindings::mvwgetn_wstr(win, y, x, wstr, n)
}
pub unsafe fn mvwgetnstr(win: WINDOW, y: i32, x: i32, str: *mut i8, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwgetnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwgetnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwgetnstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvwgetnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwgetnstr() : n = {}", MODULE_PATH, n);
bindings::mvwgetnstr(win, y, x, str, n)
}
pub unsafe fn mvwgetstr(win: WINDOW, y: i32, x: i32, str: *mut i8) -> i32 {
assert!(!win.is_null(), "{}mvwgetstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwgetstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwgetstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvwgetstr() : str.is_null()", MODULE_PATH);
bindings::mvwgetstr(win, y, x, str)
}
pub unsafe fn mvwhline(win: WINDOW, y: i32, x: i32, ch: chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwhline() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwhline() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwhline() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwhline() : n = {}", MODULE_PATH, n);
bindings::mvwhline(win, y, x, ch, n)
}
pub unsafe fn mvwhline_set(win: WINDOW, y: i32, x: i32, wch: &cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwhline_set() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwhline_set() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwhline_set() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwhline_set() : n = {}", MODULE_PATH, n);
bindings::mvwhline_set(win, y, x, wch, n)
}
pub unsafe fn mvwin(win: WINDOW, y: i32, x: i32) -> i32 {
assert!(!win.is_null(), "{}mvwin() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwin() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwin() : x = {}", MODULE_PATH, x);
bindings::mvwin(win, y, x)
}
pub unsafe fn mvwin_wch(win: WINDOW, y: i32, x: i32, wcval: *mut cchar_t) -> i32 {
assert!(!win.is_null(), "{}mvwin_wch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwin_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwin_wch() : x = {}", MODULE_PATH, x);
assert!(!wcval.is_null(), "{}mvwin_wch() : wcval.is_null()", MODULE_PATH);
bindings::mvwin_wch(win, y, x, wcval)
}
pub unsafe fn mvwin_wchnstr(win: WINDOW, y: i32, x: i32, wchstr: *mut cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwin_wchnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwin_wchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwin_wchnstr() : x = {}", MODULE_PATH, x);
assert!(!wchstr.is_null(), "{}mvwin_wchnstr() : wchstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwin_wchnstr() : n = {}", MODULE_PATH, n);
bindings::mvwin_wchnstr(win, y, x, wchstr, n)
}
pub unsafe fn mvwin_wchstr(win: WINDOW, y: i32, x: i32, wchstr: *mut cchar_t) -> i32 {
assert!(!win.is_null(), "{}mvwin_wchstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwin_wchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwin_wchstr() : x = {}", MODULE_PATH, x);
assert!(!wchstr.is_null(), "{}mvwin_wchstr() : wchstr.is_null()", MODULE_PATH);
bindings::mvwin_wchstr(win, y, x, wchstr)
}
pub unsafe fn mvwinch(win: WINDOW, y: i32, x: i32) -> chtype {
assert!(!win.is_null(), "{}mvwinch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinch() : x = {}", MODULE_PATH, x);
bindings::mvwinch(win, y, x)
}
pub unsafe fn mvwinchnstr(win: WINDOW, y: i32, x: i32, chstr: *mut chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwinchnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinchnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinchnstr() : x = {}", MODULE_PATH, x);
assert!(!chstr.is_null(), "{}mvwinchnstr() : chstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwinchnstr() : n = {}", MODULE_PATH, n);
bindings::mvwinchnstr(win, y, x, chstr, n)
}
pub unsafe fn mvwinchstr(win: WINDOW, y: i32, x: i32, chstr: *mut chtype) -> i32 {
assert!(!win.is_null(), "{}mvwinchstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinchstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinchstr() : x = {}", MODULE_PATH, x);
assert!(!chstr.is_null(), "{}mvwinchstr() : chstr.is_null()", MODULE_PATH);
bindings::mvwinchstr(win, y, x, chstr)
}
pub unsafe fn mvwinnstr(win: WINDOW, y: i32, x: i32, str: *mut i8, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwinnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinnstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvwinnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwinnstr() : n = {}", MODULE_PATH, n);
bindings::mvwinnstr(win, y, x, str, n)
}
pub unsafe fn mvwinnwstr(win: WINDOW, y: i32, x: i32, wstr: *mut wchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwinnwstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinnwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinnwstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvwinnwstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}mvwinnwstr() : n = {}", MODULE_PATH, n);
bindings::mvwinnwstr(win, y, x, wstr, n)
}
pub unsafe fn mvwins_nwstr(win: WINDOW, y: i32, x: i32, wstr: &[wchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwins_nwstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwins_nwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwins_nwstr() : x = {}", MODULE_PATH, x);
bindings::mvwins_nwstr(win, y, x, wstr.as_ptr(), n)
}
pub unsafe fn mvwins_wch(win: WINDOW, y: i32, x: i32, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}mvwins_wch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwins_wch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwins_wch() : x = {}", MODULE_PATH, x);
bindings::mvwins_wch(win, y, x, wch)
}
pub unsafe fn mvwins_wstr(win: WINDOW, y: i32, x: i32, wstr: &[wchar_t]) -> i32 {
assert!(!win.is_null(), "{}mvwins_wstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwins_wstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwins_wstr() : x = {}", MODULE_PATH, x);
bindings::mvwins_wstr(win, y, x, wstr.as_ptr())
}
pub unsafe fn mvwinsch(win: WINDOW, y: i32, x: i32, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}mvwinsch() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinsch() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinsch() : x = {}", MODULE_PATH, x);
bindings::mvwinsch(win, y, x, ch)
}
pub unsafe fn mvwinsnstr(win: WINDOW, y: i32, x: i32, str: &[i8], n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwinsnstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinsnstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinsnstr() : x = {}", MODULE_PATH, x);
bindings::mvwinsnstr(win, y, x, str.as_ptr(), n)
}
pub unsafe fn mvwinsstr(win: WINDOW, y: i32, x: i32, str: &[i8]) -> i32 {
assert!(!win.is_null(), "{}mvwinsstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinsstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinsstr() : x = {}", MODULE_PATH, x);
bindings::mvwinsstr(win, y, x, str.as_ptr())
}
pub unsafe fn mvwinstr(win: WINDOW, y: i32, x: i32, str: *mut i8) -> i32 {
assert!(!win.is_null(), "{}mvwinstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinstr() : x = {}", MODULE_PATH, x);
assert!(!str.is_null(), "{}mvwinstr() : str.is_null()", MODULE_PATH);
bindings::mvwinstr(win, y, x, str)
}
pub unsafe fn mvwinwstr(win: WINDOW, y: i32, x: i32, wstr: *mut wchar_t) -> i32 {
assert!(!win.is_null(), "{}mvwinwstr() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwinwstr() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwinwstr() : x = {}", MODULE_PATH, x);
assert!(!wstr.is_null(), "{}mvwinwstr() : wstr.is_null()", MODULE_PATH);
bindings::mvwinwstr(win, y, x, wstr)
}
pub unsafe fn mvwvline(win: WINDOW, y: i32, x: i32, ch: chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwvline() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwvline() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwvline() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwvline() : n = {}", MODULE_PATH, n);
bindings::mvwvline(win, y, x, ch, n)
}
pub unsafe fn mvwvline_set(win: WINDOW, y: i32, x: i32, wch: &cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}mvwvline_set() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}mvwvline_set() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}mvwvline_set() : x = {}", MODULE_PATH, x);
assert!(n > 0, "{}mvwvline_set() : n = {}", MODULE_PATH, n);
bindings::mvwvline_set(win, y, x, wch, n)
}
pub fn napms(ms: i32) -> i32 {
unsafe { bindings::napms(ms) }
}
pub unsafe fn newpad(lines: i32, cols: i32) -> Option<WINDOW> {
assert!(lines >= 0, "{}newpad() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}newpad() : cols = {}", MODULE_PATH, cols);
bindings::newpad(lines, cols).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn newterm(ty: Option<&[i8]>, outfd: FILE, infd: FILE) -> Option<SCREEN> {
assert!(!outfd.is_null(), "{}newterm() : outfd.is_null()", MODULE_PATH);
assert!(!infd.is_null(), "{}newterm() : infd.is_null()", MODULE_PATH);
let term_type = match ty {
Some(term) => term.as_ptr(),
None => ptr::null()
};
bindings::newterm(term_type, outfd, infd).as_mut().map(|ptr| ptr as SCREEN)
}
pub unsafe fn newwin(lines: i32, cols: i32, y: i32, x: i32) -> Option<WINDOW> {
assert!(lines >= 0, "{}newwin() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}newwin() : cols = {}", MODULE_PATH, cols);
assert!(y >= 0, "{}newwin() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}newwin() : x = {}", MODULE_PATH, x);
bindings::newwin(lines, cols, y, x).as_mut().map(|ptr| ptr as WINDOW)
}
pub fn nl() -> i32 {
unsafe { bindings::nl() }
}
pub fn nocbreak() -> i32 {
unsafe { bindings::nocbreak() }
}
pub unsafe fn nodelay(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}nodelay() : win.is_null()", MODULE_PATH);
bindings::nodelay(win, bf)
}
pub fn noecho() -> i32 {
unsafe { bindings::noecho() }
}
pub fn nofilter() {
unsafe { bindings::nofilter() }
}
pub fn nonl() -> i32 {
unsafe { bindings::nonl() }
}
pub fn noqiflush() {
unsafe { bindings::noqiflush() }
}
pub fn noraw() -> i32 {
unsafe { bindings::noraw() }
}
pub unsafe fn notimeout(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}notimeout() : win.is_null()", MODULE_PATH);
bindings::notimeout(win, bf)
}
pub unsafe fn overlay(srcwin: WINDOW, dstwin: WINDOW) -> i32 {
assert!(!srcwin.is_null(), "{}overlay() : srcwin.is_null()", MODULE_PATH);
assert!(!dstwin.is_null(), "{}overlay() : dstwin.is_null()", MODULE_PATH);
bindings::overlay(srcwin, dstwin)
}
pub unsafe fn overwrite(srcwin: WINDOW, dstwin: WINDOW) -> i32 {
assert!(!srcwin.is_null(), "{}overwrite() : srcwin.is_null()", MODULE_PATH);
assert!(!dstwin.is_null(), "{}overwrite() : dstwin.is_null()", MODULE_PATH);
bindings::overwrite(srcwin, dstwin)
}
pub unsafe fn pair_content(pair: short_t, fg: *mut short_t, bg: *mut short_t) -> i32 {
assert!(!fg.is_null(), "{}pair_content() : fg.is_null()", MODULE_PATH);
assert!(!bg.is_null(), "{}pair_content() : bg.is_null()", MODULE_PATH);
bindings::pair_content(pair, fg, bg)
}
pub unsafe fn pechochar(pad: WINDOW, ch: chtype) -> i32 {
assert!(!pad.is_null(), "{}pechochar() : pad.is_null()", MODULE_PATH);
bindings::pechochar(pad, ch)
}
pub unsafe fn pecho_wchar(pad: WINDOW, wch: &cchar_t) -> i32 {
assert!(!pad.is_null(), "{}pecho_wchar() : pad.is_null()", MODULE_PATH);
bindings::pecho_wchar(pad, wch)
}
pub unsafe fn pnoutrefresh(
pad: WINDOW,
pminrow: i32,
pmincol: i32,
sminrow: i32,
smincol: i32,
smaxrow: i32,
smaxcol: i32
) -> i32 {
assert!(!pad.is_null(), "{}pnoutrefresh() : pad.is_null()", MODULE_PATH);
assert!(pminrow >= 0, "{}pnoutrefresh() : pminrow = {}", MODULE_PATH, pminrow);
assert!(pmincol >= 0, "{}pnoutrefresh() : pmincol = {}", MODULE_PATH, pmincol);
assert!(sminrow >= 0, "{}pnoutrefresh() : sminrow = {}", MODULE_PATH, sminrow);
assert!(smincol >= 0, "{}pnoutrefresh() : smincol = {}", MODULE_PATH, smincol);
assert!(smaxrow >= 0, "{}pnoutrefresh() : smaxrow = {}", MODULE_PATH, smaxrow);
assert!(smaxcol >= 0, "{}pnoutrefresh() : smaxcol = {}", MODULE_PATH, smaxcol);
bindings::pnoutrefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
}
pub unsafe fn prefresh(
pad: WINDOW,
pminrow: i32,
pmincol: i32,
sminrow: i32,
smincol: i32,
smaxrow: i32,
smaxcol: i32
) -> i32 {
assert!(!pad.is_null(), "{}prefresh() : pad.is_null()", MODULE_PATH);
assert!(pminrow >= 0, "{}prefresh() : pminrow = {}", MODULE_PATH, pminrow);
assert!(pmincol >= 0, "{}prefresh() : pmincol = {}", MODULE_PATH, pmincol);
assert!(sminrow >= 0, "{}prefresh() : sminrow = {}", MODULE_PATH, sminrow);
assert!(smincol >= 0, "{}prefresh() : smincol = {}", MODULE_PATH, smincol);
assert!(smaxrow >= 0, "{}prefresh() : smaxrow = {}", MODULE_PATH, smaxrow);
assert!(smaxcol >= 0, "{}prefresh() : smaxcol = {}", MODULE_PATH, smaxcol);
bindings::prefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)
}
pub fn putp(str: &[i8]) -> i32 {
unsafe { bindings::putp(str.as_ptr()) }
}
pub unsafe fn putwin(win: WINDOW, filep: FILE) -> i32 {
assert!(!win.is_null(), "{}putwin() : win.is_null()", MODULE_PATH);
assert!(!filep.is_null(), "{}putwin() : filep.is_null()", MODULE_PATH);
bindings::putwin(win, filep)
}
pub fn qiflush() {
unsafe { bindings::qiflush() }
}
pub fn raw() -> i32 {
unsafe { bindings::raw() }
}
pub unsafe fn redrawwin(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}redrawwin() : win.is_null()", MODULE_PATH);
bindings::redrawwin(win)
}
pub fn refresh() -> i32 {
unsafe { bindings::refresh() }
}
pub fn reset_color_pairs() {
unsafe { bindings::reset_color_pairs() }
}
pub fn reset_prog_mode() -> i32 {
unsafe { bindings::reset_prog_mode() }
}
pub fn reset_shell_mode() -> i32 {
unsafe { bindings::reset_shell_mode() }
}
pub fn resetty() -> i32 {
unsafe { bindings::resetty() }
}
pub fn resize_term(lines: i32, cols: i32) -> i32 {
assert!(lines >= 0, "{}resize_term() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}resize_term() : cols = {}", MODULE_PATH, cols);
unsafe { bindings::resize_term(lines, cols) }
}
pub fn resizeterm(lines: i32, cols: i32) -> i32 {
assert!(lines >= 0, "{}resizeterm() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}resizeterm() : cols = {}", MODULE_PATH, cols);
unsafe { bindings::resizeterm(lines, cols) }
}
pub fn ripoffline(line: i32, init: bindings::RipoffInit) -> i32 {
unsafe { bindings::ripoffline(line, init) }
}
pub fn savetty() -> i32 {
unsafe { bindings::savetty() }
}
pub fn scr_dump(filename: &[i8]) -> i32 {
unsafe { bindings::scr_dump(filename.as_ptr()) }
}
pub fn scr_init(filename: &[i8]) -> i32 {
unsafe { bindings::scr_init(filename.as_ptr()) }
}
pub fn scr_restore(filename: &[i8]) -> i32 {
unsafe { bindings::scr_restore(filename.as_ptr()) }
}
pub fn scr_set(filename: &[i8]) -> i32 {
unsafe { bindings::scr_set(filename.as_ptr()) }
}
pub fn scrl(n: i32) -> i32 {
unsafe { bindings::scrl(n) }
}
pub unsafe fn scroll(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}scroll() : win.is_null()", MODULE_PATH);
bindings::scroll(win)
}
pub unsafe fn scrollok(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}scrollok() : win.is_null()", MODULE_PATH);
bindings::scrollok(win, bf)
}
pub fn set_escdelay(delay: i32) -> i32 {
assert!(delay >= 0, "{}set_escdelay() : delay = {}", MODULE_PATH, delay);
unsafe { bindings::set_escdelay(delay) }
}
pub fn set_tabsize(size: i32) -> i32 {
assert!(size >= 0, "{}set_tabsize() : size = {}", MODULE_PATH, size);
unsafe { bindings::set_tabsize(size) }
}
pub unsafe fn set_term(new: SCREEN) -> Option<SCREEN> {
assert!(!new.is_null(), "{}set_term() : new.is_null()", MODULE_PATH);
bindings::set_term(new).as_mut().map(|ptr| ptr as SCREEN)
}
pub unsafe fn setcchar(wcval: *mut cchar_t, wch: *const wchar_t, attrs: attr_t, color_pair: short_t, opts: *const libc::c_void) -> i32 {
assert!(!wcval.is_null(), "{}setcchar() : wcval.is_null()", MODULE_PATH);
assert!(!wch.is_null(), "{}setcchar() : wch.is_null()", MODULE_PATH);
bindings::setcchar(wcval, wch, attrs, color_pair, opts)
}
pub fn setscrreg(top: i32, bot: i32) -> i32 {
assert!(top >= 0, "{}setscrreg() : top = {}", MODULE_PATH, top);
assert!(bot >= 0, "{}setscrreg() : bot = {}", MODULE_PATH, bot);
unsafe { bindings::setscrreg(top, bot) }
}
pub fn slk_attr() -> attr_t {
unsafe { bindings::slk_attr() }
}
pub unsafe fn slk_attr_off(attrs: attr_t, opts: *mut libc::c_void) -> i32 {
bindings::slk_attr_off(attrs, opts)
}
pub unsafe fn slk_attr_on(attrs: attr_t, opts: *mut libc::c_void) -> i32 {
bindings::slk_attr_on(attrs, opts)
}
pub unsafe fn slk_attr_set(attrs: attr_t, pair: short_t, opts: *mut libc::c_void) -> i32 {
bindings::slk_attr_set(attrs, pair, opts)
}
pub fn slk_attroff(ch: chtype) -> i32 {
unsafe { bindings::slk_attroff(ch) }
}
pub fn slk_attron(ch: chtype) -> i32 {
unsafe { bindings::slk_attron(ch) }
}
pub fn slk_attrset(ch: chtype) -> i32 {
unsafe { bindings::slk_attrset(ch) }
}
pub fn slk_clear() -> i32 {
unsafe { bindings::slk_clear() }
}
pub fn slk_color(pair: short_t) -> i32 {
unsafe { bindings::slk_color(pair) }
}
pub fn slk_init(fmt: i32) -> i32 {
assert!(fmt >= 0, "{}slk_init() : fmt = {}", MODULE_PATH, fmt);
unsafe { bindings::slk_init(fmt) }
}
pub fn slk_label(n: i32) -> Option<String> {
assert!(n > 0, "{}slk_label() : n = {}", MODULE_PATH, n);
unsafe { (bindings::slk_label(n) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn slk_noutrefresh() -> i32 {
unsafe { bindings::slk_noutrefresh() }
}
pub fn slk_refresh() -> i32 {
unsafe { bindings::slk_refresh() }
}
pub fn slk_restore() -> i32 {
unsafe { bindings::slk_restore() }
}
pub fn slk_set(n: i32, label: &[i8], fmt: i32) -> i32 {
assert!(n > 0, "{}slk_set() : n = {}", MODULE_PATH, n);
assert!(fmt >= 0, "{}slk_set() : fmt = {}", MODULE_PATH, fmt);
unsafe { bindings::slk_set(n, label.as_ptr(), fmt) }
}
pub fn slk_touch() -> i32 {
unsafe { bindings::slk_touch() }
}
pub fn slk_wset(n: i32, label: &[wchar_t], fmt: i32) -> i32 {
assert!(n > 0, "{}slk_wset() : n = {}", MODULE_PATH, n);
assert!(fmt >= 0, "{}slk_wset() : fmt = {}", MODULE_PATH, fmt);
unsafe { bindings::slk_wset(n, label.as_ptr(), fmt) }
}
pub fn standend() -> i32 {
unsafe { bindings::standend() }
}
pub fn standout() -> i32 {
unsafe { bindings::standout() }
}
pub fn start_color() -> i32 {
unsafe { bindings::start_color() }
}
pub unsafe fn subpad(win: WINDOW, lines: i32, cols: i32, y: i32, x: i32) -> Option<WINDOW> {
assert!(!win.is_null(), "{}subpad() : win.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}subpad() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}subpad() : cols = {}", MODULE_PATH, cols);
assert!(y >= 0, "{}subpad() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}subpad() : x = {}", MODULE_PATH, x);
bindings::subpad(win, lines, cols, y, x).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn subwin(win: WINDOW, lines: i32, cols: i32, y: i32, x: i32) -> Option<WINDOW> {
assert!(!win.is_null(), "{}subwin() : win.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}subwin() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}subwin() : cols = {}", MODULE_PATH, cols);
assert!(y >= 0, "{}subwin() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}subwin() : x = {}", MODULE_PATH, x);
bindings::subwin(win, lines, cols, y, x).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn syncok(win: WINDOW, bf: bool) -> i32 {
assert!(!win.is_null(), "{}syncok() : win.is_null()", MODULE_PATH);
bindings::syncok(win, bf)
}
pub fn term_attrs() -> attr_t {
unsafe { bindings::term_attrs() }
}
pub fn termattrs() -> chtype {
unsafe { bindings::termattrs() }
}
pub fn termname() -> Option<String> {
unsafe { (bindings::termname() as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn tigetflag(capname: &[i8]) -> i32 {
unsafe { bindings::tigetflag(capname.as_ptr()) }
}
pub fn tigetnum(capname: &[i8]) -> i32 {
unsafe { bindings::tigetnum(capname.as_ptr()) }
}
pub fn tigetstr(capname: &[i8]) -> Option<String> {
unsafe { (bindings::tigetstr(capname.as_ptr()) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn timeout(delay: i32) {
unsafe { bindings::timeout(delay) }
}
pub unsafe fn touchline(win: WINDOW, start: i32, count: i32) -> i32 {
assert!(!win.is_null(), "{}touchline() : win.is_null()", MODULE_PATH);
assert!(start >= 0, "{}touchline() : start = {}", MODULE_PATH, start);
assert!(count >= 0, "{}touchline() : count = {}", MODULE_PATH, count);
bindings::touchline(win, start, count)
}
pub unsafe fn touchwin(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}touchwin() : win.is_null()", MODULE_PATH);
bindings::touchwin(win)
}
pub fn tparm(s: &[i8]) -> Option<String> {
unsafe { (bindings::tparm(s.as_ptr()) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn typeahead(fd: i32) -> i32 {
unsafe { bindings::typeahead(fd) }
}
pub fn unctrl(c: chtype) -> Option<String> {
unsafe { (bindings::unctrl(c) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr)) }
}
pub fn unget_wch(ch: wchar_t) -> i32 {
unsafe { bindings::unget_wch(ch) }
}
pub fn ungetch(ch: i32) -> i32 {
unsafe { bindings::ungetch(ch) }
}
pub unsafe fn untouchwin(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}untouchwin() : win.is_null()", MODULE_PATH);
bindings::untouchwin(win)
}
pub fn use_default_colors() -> i32 {
unsafe { bindings::use_default_colors() }
}
pub fn use_env(f: bool) {
unsafe { bindings::use_env(f) }
}
pub fn use_extended_names(enable: bool) -> i32 {
unsafe { bindings::use_extended_names(enable) }
}
pub fn use_legacy_coding(level: i32) -> i32 {
assert!(level >= 0, "{}use_legacy_coding() : level = {}", MODULE_PATH, level);
unsafe { bindings::use_legacy_coding(level) }
}
pub fn use_tioctl(f: bool) {
unsafe { bindings::use_tioctl(f) }
}
pub fn vid_attr(attrs: attr_t, pair: short_t) -> i32 {
unsafe { bindings::vid_attr(attrs, pair, ptr::null_mut()) }
}
pub fn vidattr(attrs: chtype) -> i32 {
unsafe { bindings::vidattr(attrs) }
}
pub fn vline(ch: chtype, n: i32) -> i32 {
assert!(n > 0, "{}vline() : n = {}", MODULE_PATH, n);
unsafe { bindings::vline(ch, n) }
}
pub fn vline_set(wch: &cchar_t, n: i32) -> i32 {
assert!(n > 0, "{}vline_set() : n = {}", MODULE_PATH, n);
unsafe { bindings::vline_set(wch, n) }
}
pub unsafe fn wadd_wch(win: WINDOW, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}wadd_wch() : win.is_null()", MODULE_PATH);
bindings::wadd_wch(win, wch)
}
pub unsafe fn wadd_wchnstr(win: WINDOW, wchstr: &[cchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}wadd_wchnstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}wadd_wchnstr() : n = {}", MODULE_PATH, n);
bindings::wadd_wchnstr(win, wchstr.as_ptr(), n)
}
pub unsafe fn wadd_wchstr(win: WINDOW, wchstr: &[cchar_t]) -> i32 {
assert!(!win.is_null(), "{}wadd_wchstr() : win.is_null()", MODULE_PATH);
bindings::wadd_wchstr(win, wchstr.as_ptr())
}
pub unsafe fn waddch(win: WINDOW, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}waddch() : win.is_null()", MODULE_PATH);
bindings::waddch(win, ch)
}
pub unsafe fn waddchnstr(win: WINDOW, chstr: &[chtype], n: i32) -> i32 {
assert!(!win.is_null(), "{}waddchnstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}waddchnstr() : n = {}", MODULE_PATH, n);
bindings::waddchnstr(win, chstr.as_ptr(), n)
}
pub unsafe fn waddchstr(win: WINDOW, chstr: &[chtype]) -> i32 {
assert!(!win.is_null(), "{}waddchstr() : win.is_null()", MODULE_PATH);
bindings::waddchstr(win, chstr.as_ptr())
}
pub unsafe fn waddnstr(win: WINDOW, str: &[i8], n: i32) -> i32 {
assert!(!win.is_null(), "{}waddnstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}waddnstr() : n = {}", MODULE_PATH, n);
bindings::waddnstr(win, str.as_ptr(), n)
}
pub unsafe fn waddnwstr(win: WINDOW, wstr: &[wchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}waddnwstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}waddnwstr() : n = {}", MODULE_PATH, n);
bindings::waddnwstr(win, wstr.as_ptr(), n)
}
pub unsafe fn waddstr(win: WINDOW, str: &[i8]) -> i32 {
assert!(!win.is_null(), "{}waddstr() : win.is_null()", MODULE_PATH);
bindings::waddstr(win, str.as_ptr())
}
pub unsafe fn waddwstr(win: WINDOW, wstr: &[wchar_t]) -> i32 {
assert!(!win.is_null(), "{}waddwstr() : win.is_null()", MODULE_PATH);
bindings::waddwstr(win, wstr.as_ptr())
}
pub unsafe fn wattr_get(win: WINDOW, attrs: *mut attr_t, pair: *mut short_t, opts: *mut libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wattr_get() : win.is_null()", MODULE_PATH);
assert!(!attrs.is_null(), "{}wattr_get() : attrs.is_null()", MODULE_PATH);
assert!(!pair.is_null(), "{}wattr_get() : pair.is_null()", MODULE_PATH);
bindings::wattr_get(win, attrs, pair, opts)
}
pub unsafe fn wattr_off(win: WINDOW, attrs: attr_t, opts: *mut libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wattr_off() : win.is_null()", MODULE_PATH);
assert!(opts.is_null(), "{}wattr_off() : !opts.is_null()", MODULE_PATH);
bindings::wattr_off(win, attrs, opts)
}
pub unsafe fn wattr_on(win: WINDOW, attrs: attr_t, opts: *mut libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wattr_on() : win.is_null()", MODULE_PATH);
assert!(opts.is_null(), "{}wattr_on() : !opts.is_null()", MODULE_PATH);
bindings::wattr_on(win, attrs, opts)
}
pub unsafe fn wattr_set(win: WINDOW, attrs: attr_t, pair: short_t, opts: *mut libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wattr_set() : win.is_null()", MODULE_PATH);
bindings::wattr_set(win, attrs, pair, opts)
}
pub unsafe fn wattroff(win: WINDOW, attrs: i32) -> i32 {
assert!(!win.is_null(), "{}wattroff() : win.is_null()", MODULE_PATH);
bindings::wattroff(win, attrs)
}
pub unsafe fn wattron(win: WINDOW, attrs: i32) -> i32 {
assert!(!win.is_null(), "{}wattron() : win.is_null()", MODULE_PATH);
bindings::wattron(win, attrs)
}
pub unsafe fn wattrset(win: WINDOW, attrs: i32) -> i32 {
assert!(!win.is_null(), "{}wattrset() : win.is_null()", MODULE_PATH);
bindings::wattrset(win, attrs)
}
pub unsafe fn wbkgd(win: WINDOW, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}wbkgd() : win.is_null()", MODULE_PATH);
bindings::wbkgd(win, ch)
}
pub unsafe fn wbkgdset(win: WINDOW, ch: chtype) {
assert!(!win.is_null(), "{}wbkgdset() : win.is_null()", MODULE_PATH);
bindings::wbkgdset(win, ch)
}
pub unsafe fn wbkgrnd(win: WINDOW, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}wbkgrnd() : win.is_null()", MODULE_PATH);
bindings::wbkgrnd(win, wch)
}
pub unsafe fn wbkgrndset(win: WINDOW, wch: &cchar_t) {
assert!(!win.is_null(), "{}wbkgrndset() : win.is_null()", MODULE_PATH);
bindings::wbkgrndset(win, wch)
}
pub unsafe fn wborder(
win: WINDOW,
ls: chtype,
rs: chtype,
ts: chtype,
bs: chtype,
tl: chtype,
tr: chtype,
bl: chtype,
br: chtype
) -> i32 {
assert!(!win.is_null(), "{}wborder() : win.is_null()", MODULE_PATH);
bindings::wborder(win, ls, rs, ts, bs, tl, tr, bl, br)
}
pub unsafe fn wborder_set(
win: WINDOW,
ls: &cchar_t,
rs: &cchar_t,
ts: &cchar_t,
bs: &cchar_t,
tl: &cchar_t,
tr: &cchar_t,
bl: &cchar_t,
br: &cchar_t
) -> i32 {
assert!(!win.is_null(), "{}wborder_set() : win.is_null()", MODULE_PATH);
bindings::wborder_set(win, ls, rs, ts, bs, tl, tr, bl, br)
}
pub unsafe fn wchgat(win: WINDOW, n: i32, attr: attr_t, color: short_t, opts: *const libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wchgat() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}wchgat() : n = {}", MODULE_PATH, n);
bindings::wchgat(win, n, attr, color, opts)
}
pub unsafe fn wclear(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wclear() : win.is_null()", MODULE_PATH);
bindings::wclear(win)
}
pub unsafe fn wclrtobot(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wclrtobot() : win.is_null()", MODULE_PATH);
bindings::wclrtobot(win)
}
pub unsafe fn wclrtoeol(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wclrtoeol() : win.is_null()", MODULE_PATH);
bindings::wclrtoeol(win)
}
pub unsafe fn wcolor_set(win: WINDOW, pair: short_t, opts: *mut libc::c_void) -> i32 {
assert!(!win.is_null(), "{}wcolor_set() : win.is_null()", MODULE_PATH);
bindings::wcolor_set(win, pair, opts)
}
pub unsafe fn wcursyncup(win: WINDOW) {
assert!(!win.is_null(), "{}wcursyncup() : win.is_null()", MODULE_PATH);
bindings::wcursyncup(win)
}
pub unsafe fn wdelch(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wdelch() : win.is_null()", MODULE_PATH);
bindings::wdelch(win)
}
pub unsafe fn wecho_wchar(win: WINDOW, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}wecho_wchar() : win.is_null()", MODULE_PATH);
bindings::wecho_wchar(win, wch)
}
pub unsafe fn wechochar(win: WINDOW, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}wechochar() : win.is_null()", MODULE_PATH);
bindings::wechochar(win, ch)
}
pub unsafe fn werase(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}werase() : win.is_null()", MODULE_PATH);
bindings::werase(win)
}
pub unsafe fn wget_wch(win: WINDOW, wch: *mut wint_t) -> i32 {
assert!(!win.is_null(), "{}wget_wch() : win.is_null()", MODULE_PATH);
assert!(!wch.is_null(), "{}wget_wch() : wch.is_null()", MODULE_PATH);
bindings::wget_wch(win, wch)
}
pub unsafe fn wget_wstr(win: WINDOW, wstr: *mut wint_t) -> i32 {
assert!(!win.is_null(), "{}wget_wstr() : win.is_null()", MODULE_PATH);
assert!(!wstr.is_null(), "{}wget_wstr() : wstr.is_null()", MODULE_PATH);
bindings::wget_wstr(win, wstr)
}
pub unsafe fn wgetbkgrnd(win: WINDOW, wch: *mut cchar_t) -> i32 {
assert!(!win.is_null(), "{}wgetbkgrnd() : win.is_null()", MODULE_PATH);
assert!(!wch.is_null(), "{}wgetbkgrnd() : wch.is_null()", MODULE_PATH);
bindings::wgetbkgrnd(win, wch)
}
pub unsafe fn wgetch(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wgetch() : win.is_null()", MODULE_PATH);
bindings::wgetch(win)
}
pub unsafe fn wgetdelay(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wgetdelay() : win.is_null()", MODULE_PATH);
bindings::wgetdelay(win)
}
pub unsafe fn wgetn_wstr(win: WINDOW, wstr: *mut wint_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}wgetn_wstr() : win.is_null()", MODULE_PATH);
assert!(!wstr.is_null(), "{}wgetn_wstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}wgetn_wstr() : n = {}", MODULE_PATH, n);
bindings::wgetn_wstr(win, wstr, n)
}
pub unsafe fn wgetnstr(win: WINDOW, str: *mut i8, n: i32) -> i32 {
assert!(!win.is_null(), "{}wgetnstr() : win.is_null()", MODULE_PATH);
assert!(!str.is_null(), "{}wgetnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}wgetnstr() : n = {}", MODULE_PATH, n);
bindings::wgetnstr(win, str, n)
}
pub unsafe fn wgetparent(win: WINDOW) -> Option<WINDOW> {
assert!(!win.is_null(), "{}wgetparent() : win.is_null()", MODULE_PATH);
bindings::wgetparent(win).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn wgetscrreg(win: WINDOW, top: *mut i32, bot: *mut i32) -> i32 {
assert!(!win.is_null(), "{}wgetscrreg() : win.is_null()", MODULE_PATH);
assert!(!top.is_null(), "{}wgetscrreg() : top.is_null()", MODULE_PATH);
assert!(!bot.is_null(), "{}wgetscrreg() : bot.is_null()", MODULE_PATH);
bindings::wgetscrreg(win, top, bot)
}
pub unsafe fn wgetstr(win: WINDOW, str: *mut i8) -> i32 {
assert!(!win.is_null(), "{}wgetstr() : win.is_null()", MODULE_PATH);
assert!(!str.is_null(), "{}wgetstr() : str.is_null()", MODULE_PATH);
bindings::wgetstr(win, str)
}
pub unsafe fn whline(win: WINDOW, ch: chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}whline() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}whline() : n = {}", MODULE_PATH, n);
bindings::whline(win, ch, n)
}
pub unsafe fn whline_set(win: WINDOW, wch: &cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}whline_set() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}whline_set() : n = {}", MODULE_PATH, n);
bindings::whline_set(win, wch, n)
}
pub unsafe fn win_wch(win: WINDOW, wcval: *mut cchar_t) -> i32 {
assert!(!win.is_null(), "{}win_wch() : win.is_null()", MODULE_PATH);
assert!(!wcval.is_null(), "{}win_wch() : wcval.is_null()", MODULE_PATH);
bindings::win_wch(win, wcval)
}
pub unsafe fn win_wchnstr(win: WINDOW, wchstr: *mut cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}win_wchnstr() : win.is_null()", MODULE_PATH);
assert!(!wchstr.is_null(), "{}win_wchnstr() : wchstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}win_wchnstr() : n = {}", MODULE_PATH, n);
bindings::win_wchnstr(win, wchstr, n)
}
pub unsafe fn win_wchstr(win: WINDOW, wchstr: *mut cchar_t) -> i32 {
assert!(!win.is_null(), "{}win_wchstr() : win.is_null()", MODULE_PATH);
assert!(!wchstr.is_null(), "{}win_wchstr() : wchstr.is_null()", MODULE_PATH);
bindings::win_wchstr(win, wchstr)
}
pub unsafe fn winch(win: WINDOW) -> chtype {
assert!(!win.is_null(), "{}winch() : win.is_null()", MODULE_PATH);
bindings::winch(win)
}
pub unsafe fn winchnstr(win: WINDOW, chstr: *mut chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}winchnstr() : win.is_null()", MODULE_PATH);
assert!(!chstr.is_null(), "{}winchnstr() : chstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}winchnstr() : n = {}", MODULE_PATH, n);
bindings::winchnstr(win, chstr, n)
}
pub unsafe fn winchstr(win: WINDOW, chstr: *mut chtype) -> i32 {
assert!(!win.is_null(), "{}winchstr() : win.is_null()", MODULE_PATH);
assert!(!chstr.is_null(), "{}winchstr() : chstr.is_null()", MODULE_PATH);
bindings::winchstr(win, chstr)
}
pub unsafe fn winnstr(win: WINDOW, str: *mut i8, n: i32) -> i32 {
assert!(!win.is_null(), "{}winnstr() : win.is_null()", MODULE_PATH);
assert!(!str.is_null(), "{}winnstr() : str.is_null()", MODULE_PATH);
assert!(n > 0, "{}winnstr() : n = {}", MODULE_PATH, n);
bindings::winnstr(win, str, n)
}
pub unsafe fn winnwstr(win: WINDOW, wstr: *mut wchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}winnwstr() : win.is_null()", MODULE_PATH);
assert!(!wstr.is_null(), "{}winnwstr() : wstr.is_null()", MODULE_PATH);
assert!(n > 0, "{}winnwstr() : n = {}", MODULE_PATH, n);
bindings::winnwstr(win, wstr, n)
}
pub unsafe fn wins_nwstr(win: WINDOW, wstr: &[wchar_t], n: i32) -> i32 {
assert!(!win.is_null(), "{}wins_nwstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}wins_nwstr() : n = {}", MODULE_PATH, n);
bindings::wins_nwstr(win, wstr.as_ptr(), n)
}
pub unsafe fn wins_wch(win: WINDOW, wch: &cchar_t) -> i32 {
assert!(!win.is_null(), "{}wins_wch() : win.is_null()", MODULE_PATH);
bindings::wins_wch(win, wch)
}
pub unsafe fn wins_wstr(win: WINDOW, wstr: &[wchar_t]) -> i32 {
assert!(!win.is_null(), "{}wins_wstr() : win.is_null()", MODULE_PATH);
bindings::wins_wstr(win, wstr.as_ptr())
}
pub unsafe fn winsch(win: WINDOW, ch: chtype) -> i32 {
assert!(!win.is_null(), "{}winsch() : win.is_null()", MODULE_PATH);
bindings::winsch(win, ch)
}
pub unsafe fn winsdelln(win: WINDOW, n: i32) -> i32 {
assert!(!win.is_null(), "{}winsdelln() : win.is_null()", MODULE_PATH);
bindings::winsdelln(win, n)
}
pub unsafe fn winsertln(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}winsertln() : win.is_null()", MODULE_PATH);
bindings::winsertln(win)
}
pub unsafe fn winsnstr(win: WINDOW, str: &[i8], n: i32) -> i32 {
assert!(!win.is_null(), "{}winsnstr() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}winsnstr() : n = {}", MODULE_PATH, n);
bindings::winsnstr(win, str.as_ptr(), n)
}
pub unsafe fn winsstr(win: WINDOW, str: &[i8]) -> i32 {
assert!(!win.is_null(), "{}winsstr() : win.is_null()", MODULE_PATH);
bindings::winsstr(win, str.as_ptr())
}
pub unsafe fn winstr(win: WINDOW, str: *mut i8) -> i32 {
assert!(!win.is_null(), "{}winstr() : win.is_null()", MODULE_PATH);
assert!(!str.is_null(), "{}winstr() : str.is_null()", MODULE_PATH);
bindings::winstr(win, str)
}
pub unsafe fn winwstr(win: WINDOW, wstr: *mut wchar_t) -> i32 {
assert!(!win.is_null(), "{}winwstr() : win.is_null()", MODULE_PATH);
assert!(!wstr.is_null(), "{}winwstr() : wstr.is_null()", MODULE_PATH);
bindings::winwstr(win, wstr)
}
pub unsafe fn wmove(win: WINDOW, y: i32, x: i32) -> i32 {
assert!(!win.is_null(), "{}wmove() : win.is_null()", MODULE_PATH);
bindings::wmove(win, y, x)
}
pub unsafe fn wnoutrefresh(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wnoutrefresh() : win.is_null()", MODULE_PATH);
bindings::wnoutrefresh(win)
}
pub unsafe fn wredrawln(win: WINDOW, beg_line: i32, num_lines: i32) -> i32 {
assert!(!win.is_null(), "{}wredrawln() : win.is_null()", MODULE_PATH);
assert!(beg_line >= 0, "{}wredrawln() : beg_line = {}", MODULE_PATH, beg_line);
assert!(num_lines >= 0, "{}wredrawln() : num_lines = {}", MODULE_PATH, num_lines);
bindings::wredrawln(win, beg_line, num_lines)
}
pub unsafe fn wrefresh(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wrefresh() : win.is_null()", MODULE_PATH);
bindings::wrefresh(win)
}
pub unsafe fn wresize(win: WINDOW, lines: i32, columns: i32) -> i32 {
assert!(!win.is_null(), "{}wresize() : win.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}wresize() : lines = {}", MODULE_PATH, lines);
assert!(columns >= 0, "{}wresize() : columns = {}", MODULE_PATH, columns);
bindings::wresize(win, lines, columns)
}
pub unsafe fn wscrl(win: WINDOW, n: i32) -> i32 {
assert!(!win.is_null(), "{}wscrl() : win.is_null()", MODULE_PATH);
bindings::wscrl(win, n)
}
pub unsafe fn wsetscrreg(win: WINDOW, top: i32, bot: i32) -> i32 {
assert!(!win.is_null(), "{}wsetscrreg() : win.is_null()", MODULE_PATH);
assert!(top >= 0, "{}wsetscrreg() : top = {}", MODULE_PATH, top);
assert!(bot >= 0, "{}wsetscrreg() : bot = {}", MODULE_PATH, bot);
bindings::wsetscrreg(win, top, bot)
}
pub unsafe fn wstandend(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wstandend() : win.is_null()", MODULE_PATH);
bindings::wstandend(win)
}
pub unsafe fn wstandout(win: WINDOW) -> i32 {
assert!(!win.is_null(), "{}wstandout() : win.is_null()", MODULE_PATH);
bindings::wstandout(win)
}
pub unsafe fn wsyncdown(win: WINDOW) {
assert!(!win.is_null(), "{}wsyncdown() : win.is_null()", MODULE_PATH);
bindings::wsyncdown(win)
}
pub unsafe fn wsyncup(win: WINDOW) {
assert!(!win.is_null(), "{}wsyncup() : win.is_null()", MODULE_PATH);
bindings::wsyncup(win)
}
pub unsafe fn wtimeout(win: WINDOW, delay: i32) {
assert!(!win.is_null(), "{}wtimeout() : win.is_null()", MODULE_PATH);
bindings::wtimeout(win, delay)
}
pub unsafe fn wtouchln(win: WINDOW, y: i32, n: i32, changed: i32) -> i32 {
assert!(!win.is_null(), "{}wtouchln() : win.is_null()", MODULE_PATH);
assert!(y >= 0, "{}wtouchln() : y = {}", MODULE_PATH, y);
bindings::wtouchln(win, y, n, changed)
}
pub unsafe fn wunctrl(ch: *mut cchar_t) -> Option<*mut wchar_t> {
assert!(!ch.is_null(), "{}wunctrl() : ch.is_null()", MODULE_PATH);
bindings::wunctrl(ch).as_mut().map(|ptr| ptr as *mut wchar_t)
}
pub unsafe fn wvline(win: WINDOW, ch: chtype, n: i32) -> i32 {
assert!(!win.is_null(), "{}wvline() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}wvline() : n = {}", MODULE_PATH, n);
bindings::wvline(win, ch, n)
}
pub unsafe fn wvline_set(win: WINDOW, wch: &cchar_t, n: i32) -> i32 {
assert!(!win.is_null(), "{}wvline_set() : win.is_null()", MODULE_PATH);
assert!(n > 0, "{}wvline_set() : n = {}", MODULE_PATH, n);
bindings::wvline_set(win, wch, n)
}
fn acs_map() -> *const chtype {
unsafe { &wrapped::acs_map as *const chtype }
}
pub fn NCURSES_ACS(c: char) -> chtype {
unsafe { *acs_map().offset((c as libc::c_uchar) as isize) as chtype }
}
pub fn ACS_ULCORNER() -> chtype { NCURSES_ACS('l') }
pub fn ACS_LLCORNER() -> chtype { NCURSES_ACS('m') }
pub fn ACS_URCORNER() -> chtype { NCURSES_ACS('k') }
pub fn ACS_LRCORNER() -> chtype { NCURSES_ACS('j') }
pub fn ACS_LTEE() -> chtype { NCURSES_ACS('t') }
pub fn ACS_RTEE() -> chtype { NCURSES_ACS('u') }
pub fn ACS_BTEE() -> chtype { NCURSES_ACS('v') }
pub fn ACS_TTEE() -> chtype { NCURSES_ACS('w') }
pub fn ACS_HLINE() -> chtype { NCURSES_ACS('q') }
pub fn ACS_VLINE() -> chtype { NCURSES_ACS('x') }
pub fn ACS_PLUS() -> chtype { NCURSES_ACS('n') }
pub fn ACS_S1() -> chtype { NCURSES_ACS('o') }
pub fn ACS_S9() -> chtype { NCURSES_ACS('s') }
pub fn ACS_DIAMOND() -> chtype { NCURSES_ACS('`') }
pub fn ACS_CKBOARD() -> chtype { NCURSES_ACS('a') }
pub fn ACS_DEGREE() -> chtype { NCURSES_ACS('f') }
pub fn ACS_PLMINUS() -> chtype { NCURSES_ACS('g') }
pub fn ACS_BULLET() -> chtype { NCURSES_ACS('~') }
pub fn ACS_LARROW() -> chtype { NCURSES_ACS(',') }
pub fn ACS_RARROW() -> chtype { NCURSES_ACS('+') }
pub fn ACS_DARROW() -> chtype { NCURSES_ACS('.') }
pub fn ACS_UARROW() -> chtype { NCURSES_ACS('-') }
pub fn ACS_BOARD() -> chtype { NCURSES_ACS('h') }
pub fn ACS_LANTERN() -> chtype { NCURSES_ACS('i') }
pub fn ACS_BLOCK() -> chtype { NCURSES_ACS('0') }
pub fn ACS_S3() -> chtype { NCURSES_ACS('p') }
pub fn ACS_S7() -> chtype { NCURSES_ACS('r') }
pub fn ACS_LEQUAL() -> chtype { NCURSES_ACS('y') }
pub fn ACS_GEQUAL() -> chtype { NCURSES_ACS('z') }
pub fn ACS_PI() -> chtype { NCURSES_ACS('{') }
pub fn ACS_NEQUAL() -> chtype { NCURSES_ACS('|') }
pub fn ACS_STERLING() -> chtype { NCURSES_ACS('}') }
pub fn ACS_BSSB() -> chtype { ACS_ULCORNER() }
pub fn ACS_SSBB() -> chtype { ACS_LLCORNER() }
pub fn ACS_BBSS() -> chtype { ACS_URCORNER() }
pub fn ACS_SBBS() -> chtype { ACS_LRCORNER() }
pub fn ACS_SBSS() -> chtype { ACS_RTEE() }
pub fn ACS_SSSB() -> chtype { ACS_LTEE() }
pub fn ACS_SSBS() -> chtype { ACS_BTEE() }
pub fn ACS_BSSS() -> chtype { ACS_TTEE() }
pub fn ACS_BSBS() -> chtype { ACS_HLINE() }
pub fn ACS_SBSB() -> chtype { ACS_VLINE() }
pub fn ACS_SSSS() -> chtype { ACS_PLUS() }
pub unsafe fn alloc_pair_sp(sp: SCREEN, fg: i32, bg: i32) -> i32 {
assert!(!sp.is_null(), "{}alloc_pair_sp() : sp.is_null()", MODULE_PATH);
bindings::alloc_pair_sp(sp, fg, bg)
}
pub unsafe fn assume_default_colors_sp(sp: SCREEN, fg: i32, bg: i32) -> i32 {
assert!(!sp.is_null(), "{}assume_default_colors_sp() : sp.is_null()", MODULE_PATH);
bindings::assume_default_colors_sp(sp, fg, bg)
}
pub unsafe fn baudrate_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}baudrate_sp() : sp.is_null()", MODULE_PATH);
bindings::baudrate_sp(sp)
}
pub unsafe fn beep_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}beep_sp() : sp.is_null()", MODULE_PATH);
bindings::beep_sp(sp)
}
pub unsafe fn can_change_color_sp(sp: SCREEN) -> bool {
assert!(!sp.is_null(), "{}can_change_color_sp() : sp.is_null()", MODULE_PATH);
bindings::can_change_color_sp(sp)
}
pub unsafe fn cbreak_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}cbreak_sp() : sp.is_null()", MODULE_PATH);
bindings::cbreak_sp(sp)
}
pub unsafe fn color_content_sp(sp: SCREEN, color: short_t, r: *mut short_t, g: *mut short_t, b: *mut short_t) -> i32 {
assert!(!sp.is_null(), "{}color_content_sp() : sp.is_null()", MODULE_PATH);
assert!(!r.is_null(), "{}color_content_sp() : r.is_null()", MODULE_PATH);
assert!(!g.is_null(), "{}color_content_sp() : g.is_null()", MODULE_PATH);
assert!(!b.is_null(), "{}color_content_sp() : b.is_null()", MODULE_PATH);
bindings::color_content_sp(sp, color, r, g, b)
}
pub unsafe fn curs_set_sp(sp: SCREEN, visibility: i32) -> i32 {
assert!(!sp.is_null(), "{}curs_set_sp() : sp.is_null()", MODULE_PATH);
bindings::curs_set_sp(sp, visibility)
}
pub unsafe fn define_key_sp(sp: SCREEN, definition: *mut i8, keycode: i32) -> i32 {
assert!(!sp.is_null(), "{}define_key_sp() : sp.is_null()", MODULE_PATH);
bindings::define_key_sp(sp, definition, keycode)
}
pub unsafe fn def_prog_mode_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}def_prog_mode_sp() : sp.is_null()", MODULE_PATH);
bindings::def_prog_mode_sp(sp)
}
pub unsafe fn def_shell_mode_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}def_shell_mode_sp() : sp.is_null()", MODULE_PATH);
bindings::def_shell_mode_sp(sp)
}
pub unsafe fn delay_output_sp(sp: SCREEN, ms: i32) -> i32 {
assert!(!sp.is_null(), "{}delay_output_sp() : sp.is_null()", MODULE_PATH);
bindings::delay_output_sp(sp, ms)
}
pub unsafe fn doupdate_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}doupdate_sp() : sp.is_null()", MODULE_PATH);
bindings::doupdate_sp(sp)
}
pub unsafe fn echo_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}echo_sp() : sp.is_null()", MODULE_PATH);
bindings::echo_sp(sp)
}
pub unsafe fn endwin_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}endwin_sp() : sp.is_null()", MODULE_PATH);
bindings::endwin_sp(sp)
}
pub unsafe fn erasechar_sp(sp: SCREEN) -> i8 {
assert!(!sp.is_null(), "{}erasechar_sp() : sp.is_null()", MODULE_PATH);
bindings::erasechar_sp(sp)
}
pub unsafe fn extended_color_content_sp(sp: SCREEN, color: i32, r: *mut i32, g: *mut i32, b: *mut i32) -> i32 {
assert!(!sp.is_null(), "{}extended_color_content_sp() : sp.is_null()", MODULE_PATH);
assert!(!r.is_null(), "{}extended_color_content_sp() : r.is_null()", MODULE_PATH);
assert!(!g.is_null(), "{}extended_color_content_sp() : g.is_null()", MODULE_PATH);
assert!(!b.is_null(), "{}extended_color_content_sp() : b.is_null()", MODULE_PATH);
bindings::extended_color_content_sp(sp, color, r, g, b)
}
pub unsafe fn extended_pair_content_sp(sp: SCREEN, pair: i32, fg: *mut i32, bg: *mut i32) -> i32 {
assert!(!sp.is_null(), "{}extended_pair_content_sp() : sp.is_null()", MODULE_PATH);
assert!(!fg.is_null(), "{}extended_pair_content_sp() : fg.is_null()", MODULE_PATH);
assert!(!bg.is_null(), "{}extended_pair_content_sp() : bg.is_null()", MODULE_PATH);
bindings::extended_pair_content_sp(sp, pair, fg, bg)
}
pub unsafe fn extended_slk_color_sp(sp: SCREEN, pair: i32) -> i32 {
assert!(!sp.is_null(), "{}extended_slk_color_sp() : sp.is_null()", MODULE_PATH);
bindings::extended_slk_color_sp(sp, pair)
}
pub unsafe fn filter_sp(sp: SCREEN) {
assert!(!sp.is_null(), "{}filter_sp() : sp.is_null()", MODULE_PATH);
bindings::filter_sp(sp)
}
pub unsafe fn find_pair_sp(sp: SCREEN, fg: i32, bg: i32) -> i32 {
assert!(!sp.is_null(), "{}find_pair_sp() : sp.is_null()", MODULE_PATH);
bindings::find_pair_sp(sp, fg, bg)
}
pub unsafe fn free_pair_sp(sp: SCREEN, pair: i32) -> i32 {
assert!(!sp.is_null(), "{}free_pair_sp() : sp.is_null()", MODULE_PATH);
bindings::free_pair_sp(sp, pair)
}
pub unsafe fn flash_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}flash_sp() : sp.is_null()", MODULE_PATH);
bindings::flash_sp(sp)
}
pub unsafe fn flushinp_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}flushinp_sp() : sp.is_null()", MODULE_PATH);
bindings::flushinp_sp(sp)
}
pub unsafe fn get_escdelay_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}get_escdelay_sp() : sp.is_null()", MODULE_PATH);
bindings::get_escdelay_sp(sp)
}
pub unsafe fn getwin_sp(sp: SCREEN, filep: FILE) -> Option<WINDOW> {
assert!(!sp.is_null(), "{}getwin_sp() : sp.is_null()", MODULE_PATH);
assert!(!filep.is_null(), "{}getwin_sp() : filep.is_null()", MODULE_PATH);
bindings::getwin_sp(sp, filep).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn halfdelay_sp(sp: SCREEN, tenths: i32) -> i32 {
assert!(!sp.is_null(), "{}halfdelay_sp() : sp.is_null()", MODULE_PATH);
bindings::halfdelay_sp(sp, tenths)
}
pub unsafe fn has_colors_sp(sp: SCREEN) -> bool {
assert!(!sp.is_null(), "{}has_colors_sp() : sp.is_null()", MODULE_PATH);
bindings::has_colors_sp(sp)
}
pub unsafe fn has_ic_sp(sp: SCREEN) -> bool {
assert!(!sp.is_null(), "{}has_ic_sp() : sp.is_null()", MODULE_PATH);
bindings::has_ic_sp(sp)
}
pub unsafe fn has_il_sp(sp: SCREEN) -> bool {
assert!(!sp.is_null(), "{}has_il_sp() : sp.is_null()", MODULE_PATH);
bindings::has_il_sp(sp)
}
pub unsafe fn has_key_sp(sp: SCREEN, ch: i32) -> i32 {
assert!(!sp.is_null(), "{}has_key_sp() : sp.is_null()", MODULE_PATH);
bindings::has_key_sp(sp, ch)
}
pub unsafe fn init_color_sp(sp: SCREEN, color: short_t, r: short_t, g: short_t, b: short_t) -> i32 {
assert!(!sp.is_null(), "{}init_color_sp() : sp.is_null()", MODULE_PATH);
bindings::init_color_sp(sp, color, r, g, b)
}
pub unsafe fn init_extended_color_sp(sp: SCREEN, color: i32, r: i32, g: i32, b: i32) -> i32 {
assert!(!sp.is_null(), "{}init_extended_color_sp() : sp.is_null()", MODULE_PATH);
bindings::init_extended_color_sp(sp, color, r, g, b)
}
pub unsafe fn init_extended_pair_sp(sp: SCREEN, color: i32, f: i32, b: i32) -> i32 {
assert!(!sp.is_null(), "{}init_extended_pair_sp() : sp.is_null()", MODULE_PATH);
bindings::init_extended_pair_sp(sp, color, f, b)
}
pub unsafe fn init_pair_sp(sp: SCREEN, pair: short_t, f: short_t, b: short_t) -> i32 {
assert!(!sp.is_null(), "{}init_pair_sp() : sp.is_null()", MODULE_PATH);
bindings::init_pair_sp(sp, pair, f, b)
}
pub unsafe fn intrflush_sp(sp: SCREEN, win: WINDOW, bf: bool) -> i32 {
assert!(!sp.is_null(), "{}intrflush_sp() : sp.is_null()", MODULE_PATH);
assert!(!win.is_null(), "{}intrflush_sp() : win.is_null()", MODULE_PATH);
bindings::intrflush_sp(sp, win, bf)
}
pub unsafe fn isendwin_sp(sp: SCREEN) -> bool {
assert!(!sp.is_null(), "{}isendwin_sp() : sp.is_null()", MODULE_PATH);
bindings::isendwin_sp(sp)
}
pub unsafe fn is_term_resized_sp(sp: SCREEN, lines: i32, cols: i32) -> bool {
assert!(!sp.is_null(), "{}is_term_resized_sp() : sp.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}is_term_resized_sp() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}is_term_resized_sp() : cols = {}", MODULE_PATH, cols);
bindings::is_term_resized_sp(sp, lines, cols)
}
pub unsafe fn keybound_sp(sp: SCREEN, keycode: i32, count: i32) -> Option<String> {
assert!(!sp.is_null(), "{}keybound_sp() : sp.is_null()", MODULE_PATH);
(bindings::keybound_sp(sp, keycode, count) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn key_defined_sp(sp: SCREEN, definition: &[i8]) -> i32 {
assert!(!sp.is_null(), "{}key_defined_sp() : sp.is_null()", MODULE_PATH);
bindings::key_defined_sp(sp, definition.as_ptr())
}
pub unsafe fn keyname_sp(sp: SCREEN, c: i32) -> Option<String> {
assert!(!sp.is_null(), "{}keyname_sp() : sp.is_null()", MODULE_PATH);
(bindings::keyname_sp(sp, c) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn keyok_sp(sp: SCREEN, keycode: i32, enable: bool) -> i32 {
assert!(!sp.is_null(), "{}keyok_sp() : sp.is_null()", MODULE_PATH);
bindings::keyok_sp(sp, keycode, enable)
}
pub unsafe fn killchar_sp(sp: SCREEN) -> i8 {
assert!(!sp.is_null(), "{}keychar_sp() : sp.is_null()", MODULE_PATH);
bindings::killchar_sp(sp)
}
pub unsafe fn longname_sp(sp: SCREEN) -> Option<String> {
assert!(!sp.is_null(), "{}longname_sp() : sp.is_null()", MODULE_PATH);
(bindings::longname_sp(sp) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn mcprint_sp(sp: SCREEN, data: *mut i8, len: i32) -> i32 {
assert!(!sp.is_null(), "{}mcprint_sp() : sp.is_null()", MODULE_PATH);
assert!(!data.is_null(), "{}mcprint_sp() : data.is_null()", MODULE_PATH);
assert!(len > 0, "{}mcprint_sp() : n = {}", MODULE_PATH, len);
bindings::mcprint_sp(sp, data, len)
}
pub unsafe fn mvcur_sp(sp: SCREEN, oldrow: i32, oldcol: i32, newrow: i32, newcol: i32) -> i32 {
assert!(!sp.is_null(), "{}mvcur_sp() : sp.is_null()", MODULE_PATH);
assert!(oldrow >= 0, "{}mvcur_sp() : oldrow = {}", MODULE_PATH, oldrow);
assert!(oldcol >= 0, "{}mvcur_sp() : oldcol = {}", MODULE_PATH, oldcol);
assert!(newrow >= 0, "{}mvcur_sp() : newrow = {}", MODULE_PATH, newrow);
assert!(newcol >= 0, "{}mvcur_sp() : newcol = {}", MODULE_PATH, newcol);
bindings::mvcur_sp(sp, oldrow, oldcol, newrow, newcol)
}
pub unsafe fn napms_sp(sp: SCREEN, ms: i32) -> i32 {
assert!(!sp.is_null(), "{}napms_sp() : sp.is_null()", MODULE_PATH);
bindings::napms_sp(sp, ms)
}
pub unsafe fn newpad_sp(sp: SCREEN, lines: i32, cols: i32) -> Option<WINDOW> {
assert!(!sp.is_null(), "{}newpad_sp() : sp.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}newpad() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}newpad() : cols = {}", MODULE_PATH, cols);
bindings::newpad_sp(sp, lines, cols).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn new_prescr() -> Option<SCREEN> {
bindings::new_prescr().as_mut().map(|ptr| ptr as SCREEN)
}
pub unsafe fn newterm_sp(sp: SCREEN, ty: Option<&[i8]>, outfd: FILE, infd: FILE) -> Option<SCREEN> {
assert!(!sp.is_null(), "{}newterm_sp() : sp.is_null()", MODULE_PATH);
assert!(!outfd.is_null(), "{}newterm_sp() : outfd.is_null()", MODULE_PATH);
assert!(!infd.is_null(), "{}newterm_sp() : infd.is_null()", MODULE_PATH);
let term_type = match ty {
Some(term) => term.as_ptr(),
None => ptr::null()
};
bindings::newterm_sp(sp, term_type, outfd, infd).as_mut().map(|ptr| ptr as SCREEN)
}
pub unsafe fn newwin_sp(sp: SCREEN, lines: i32, cols: i32, y: i32, x: i32) -> Option<WINDOW> {
assert!(!sp.is_null(), "{}newwin_sp() : sp.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}newwin_sp() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}newwin_sp() : cols = {}", MODULE_PATH, cols);
assert!(y >= 0, "{}newwin_sp() : y = {}", MODULE_PATH, y);
assert!(x >= 0, "{}newwin_sp() : x = {}", MODULE_PATH, x);
bindings::newwin_sp(sp, lines, cols, y, x).as_mut().map(|ptr| ptr as WINDOW)
}
pub unsafe fn nl_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}nl_sp() : sp.is_null()", MODULE_PATH);
bindings::nl_sp(sp)
}
pub unsafe fn nocbreak_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}nocbreak_sp() : sp.is_null()", MODULE_PATH);
bindings::nocbreak_sp(sp)
}
pub unsafe fn noecho_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}noecho_sp() : sp.is_null()", MODULE_PATH);
bindings::noecho_sp(sp)
}
pub unsafe fn nofilter_sp(sp: SCREEN) {
assert!(!sp.is_null(), "{}nofilter_sp() : sp.is_null()", MODULE_PATH);
bindings::nofilter_sp(sp)
}
pub unsafe fn nonl_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}nonl_sp() : sp.is_null()", MODULE_PATH);
bindings::nonl_sp(sp)
}
pub unsafe fn noqiflush_sp(sp: SCREEN) {
assert!(!sp.is_null(), "{}noqiflush_sp() : sp.is_null()", MODULE_PATH);
bindings::noqiflush_sp(sp)
}
pub unsafe fn noraw_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}noraw_sp() : sp.is_null()", MODULE_PATH);
bindings::noraw_sp(sp)
}
pub unsafe fn pair_content_sp(sp: SCREEN, pair: short_t, fg: *mut short_t, bg: *mut short_t) -> i32 {
assert!(!sp.is_null(), "{}pair_content_sp() : sp.is_null()", MODULE_PATH);
assert!(!fg.is_null(), "{}pair_content_sp() : fg.is_null()", MODULE_PATH);
assert!(!bg.is_null(), "{}pair_content_sp() : bg.is_null()", MODULE_PATH);
bindings::pair_content_sp(sp, pair, fg, bg)
}
pub unsafe fn qiflush_sp(sp: SCREEN) {
assert!(!sp.is_null(), "{}qiflush_sp() : sp.is_null()", MODULE_PATH);
bindings::qiflush_sp(sp)
}
pub unsafe fn raw_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}raw_sp() : sp.is_null()", MODULE_PATH);
bindings::raw_sp(sp)
}
pub unsafe fn reset_color_pairs_sp(sp: SCREEN) {
assert!(!sp.is_null(), "{}reset_color_pairs_sp() : sp.is_null()", MODULE_PATH);
bindings::reset_color_pairs_sp(sp)
}
pub unsafe fn reset_prog_mode_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}reset_prog_mode_sp() : sp.is_null()", MODULE_PATH);
bindings::reset_prog_mode_sp(sp)
}
pub unsafe fn reset_shell_mode_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}reset_shell_mode_sp() : sp.is_null()", MODULE_PATH);
bindings::reset_shell_mode_sp(sp)
}
pub unsafe fn resetty_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}resetty_sp() : sp.is_null()", MODULE_PATH);
bindings::resetty_sp(sp)
}
pub unsafe fn resize_term_sp(sp: SCREEN, lines: i32, cols: i32) -> i32 {
assert!(!sp.is_null(), "{}resize_term_sp() : sp.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}resize_term_sp() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}resize_term_sp() : cols = {}", MODULE_PATH, cols);
bindings::resize_term_sp(sp, lines, cols)
}
pub unsafe fn resizeterm_sp(sp: SCREEN, lines: i32, cols: i32) -> i32 {
assert!(!sp.is_null(), "{}resizeterm_sp() : sp.is_null()", MODULE_PATH);
assert!(lines >= 0, "{}resizeterm_sp() : lines = {}", MODULE_PATH, lines);
assert!(cols >= 0, "{}resizeterm_sp() : cols = {}", MODULE_PATH, cols);
bindings::resizeterm_sp(sp, lines, cols)
}
pub unsafe fn ripoffline_sp(sp: SCREEN, line: i32, init: bindings::RipoffInit) -> i32 {
assert!(!sp.is_null(), "{}ripoffline_sp() : sp.is_null()", MODULE_PATH);
bindings::ripoffline_sp(sp, line, init)
}
pub unsafe fn savetty_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}savetty_sp() : sp.is_null()", MODULE_PATH);
bindings::savetty_sp(sp)
}
pub unsafe fn scr_init_sp(sp: SCREEN, filename: &[i8]) -> i32 {
assert!(!sp.is_null(), "{}scr_init_sp() : sp.is_null()", MODULE_PATH);
bindings::scr_init_sp(sp, filename.as_ptr())
}
pub unsafe fn scr_restore_sp(sp: SCREEN, filename: &[i8]) -> i32 {
assert!(!sp.is_null(), "{}scr_restore_sp() : sp.is_null()", MODULE_PATH);
bindings::scr_restore_sp(sp, filename.as_ptr())
}
pub unsafe fn scr_set_sp(sp: SCREEN, filename: &[i8]) -> i32 {
assert!(!sp.is_null(), "{}scr_set_sp() : sp.is_null()", MODULE_PATH);
bindings::scr_set_sp(sp, filename.as_ptr())
}
pub unsafe fn set_escdelay_sp(sp: SCREEN, delay: i32) -> i32 {
assert!(!sp.is_null(), "{}set_escdelay_sp() : sp.is_null()", MODULE_PATH);
assert!(delay >= 0, "{}set_escdelay_sp() : delay = {}", MODULE_PATH, delay);
bindings::set_escdelay_sp(sp, delay)
}
pub unsafe fn set_tabsize_sp(sp: SCREEN, size: i32) -> i32 {
assert!(!sp.is_null(), "{}set_tabsize_sp() : sp.is_null()", MODULE_PATH);
assert!(size >= 0, "{}set_tabsize_sp() : size = {}", MODULE_PATH, size);
bindings::set_tabsize_sp(sp, size)
}
pub unsafe fn slk_attroff_sp(sp: SCREEN, ch: chtype) -> i32 {
assert!(!sp.is_null(), "{}slk_attroff_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_attroff_sp(sp, ch)
}
pub unsafe fn slk_attron_sp(sp: SCREEN, ch: chtype) -> i32 {
assert!(!sp.is_null(), "{}slk_attron_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_attron_sp(sp, ch)
}
pub unsafe fn slk_attr_set_sp(sp: SCREEN, attrs: attr_t, pair: short_t, opts: *mut libc::c_void) -> i32 {
assert!(!sp.is_null(), "{}slk_attr_set_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_attr_set_sp(sp, attrs, pair, opts)
}
pub unsafe fn slk_attrset_sp(sp: SCREEN, ch: chtype) -> i32 {
assert!(!sp.is_null(), "{}slk_attrset_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_attrset_sp(sp, ch)
}
pub unsafe fn slk_attr_sp(sp: SCREEN) -> attr_t {
assert!(!sp.is_null(), "{}slk_attr_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_attr_sp(sp)
}
pub unsafe fn slk_clear_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}slk_clear_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_clear_sp(sp)
}
pub unsafe fn slk_color_sp(sp: SCREEN, pair: short_t) -> i32 {
assert!(!sp.is_null(), "{}slk_color_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_color_sp(sp, pair)
}
pub unsafe fn slk_init_sp(sp: SCREEN, fmt: i32) -> i32 {
assert!(!sp.is_null(), "{}slk_init_sp() : sp.is_null()", MODULE_PATH);
assert!(fmt >= 0, "{}slk_init_sp() : fmt = {}", MODULE_PATH, fmt);
bindings::slk_init_sp(sp, fmt)
}
pub unsafe fn slk_label_sp(sp: SCREEN, n: i32) -> Option<String> {
assert!(!sp.is_null(), "{}slk_label_sp() : sp.is_null()", MODULE_PATH);
assert!(n > 0, "{}slk_label_sp() : n = {}", MODULE_PATH, n);
(bindings::slk_label_sp(sp, n) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn slk_noutrefresh_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}slk_noutrefresh_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_noutrefresh_sp(sp)
}
pub unsafe fn slk_refresh_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}slk_refresh_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_refresh_sp(sp)
}
pub unsafe fn slk_restore_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}slk_restore_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_restore_sp(sp)
}
pub unsafe fn slk_set_sp(sp: SCREEN, n: i32, label: &[i8], fmt: i32) -> i32 {
assert!(!sp.is_null(), "{}slk_set_sp() : sp.is_null()", MODULE_PATH);
assert!(n > 0, "{}slk_set_sp() : n = {}", MODULE_PATH, n);
assert!(fmt >= 0, "{}slk_set_sp() : fmt = {}", MODULE_PATH, fmt);
bindings::slk_set_sp(sp, n, label.as_ptr(), fmt)
}
pub unsafe fn slk_touch_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}slk_touch_sp() : sp.is_null()", MODULE_PATH);
bindings::slk_touch_sp(sp)
}
pub unsafe fn start_color_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}start_color_sp() : sp.is_null()", MODULE_PATH);
bindings::start_color_sp(sp)
}
pub unsafe fn term_attrs_sp(sp: SCREEN) -> attr_t {
assert!(!sp.is_null(), "{}term_attrs_sp() : sp.is_null()", MODULE_PATH);
bindings::term_attrs_sp(sp)
}
pub unsafe fn termattrs_sp(sp: SCREEN) -> chtype {
assert!(!sp.is_null(), "{}termattrs_sp() : sp.is_null()", MODULE_PATH);
bindings::termattrs_sp(sp)
}
pub unsafe fn termname_sp(sp: SCREEN) -> Option<String> {
assert!(!sp.is_null(), "{}termname_sp() : sp.is_null()", MODULE_PATH);
(bindings::termname() as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn typeahead_sp(sp: SCREEN, fd: i32) -> i32 {
assert!(!sp.is_null(), "{}typeahead_sp() : sp.is_null()", MODULE_PATH);
bindings::typeahead_sp(sp, fd)
}
pub unsafe fn unctrl_sp(sp: SCREEN, c: chtype) -> Option<String> {
assert!(!sp.is_null(), "{}unctrl_sp() : sp.is_null()", MODULE_PATH);
(bindings::unctrl_sp(sp, c) as *mut i8).as_mut().map(|ptr| FromCStr::from_c_str(ptr))
}
pub unsafe fn ungetch_sp(sp: SCREEN, ch: i32) -> i32 {
assert!(!sp.is_null(), "{}ungetch_sp() : sp.is_null()", MODULE_PATH);
bindings::ungetch_sp(sp, ch)
}
pub unsafe fn unget_wch_sp(sp: SCREEN, ch: wchar_t) -> i32 {
assert!(!sp.is_null(), "{}unget_wch_sp() : sp.is_null()", MODULE_PATH);
bindings::unget_wch_sp(sp, ch)
}
pub unsafe fn use_default_colors_sp(sp: SCREEN) -> i32 {
assert!(!sp.is_null(), "{}use_default_colors_sp() : sp.is_null()", MODULE_PATH);
bindings::use_default_colors_sp(sp)
}
pub unsafe fn use_env_sp(sp: SCREEN, f: bool) {
assert!(!sp.is_null(), "{}use_env_sp() : sp.is_null()", MODULE_PATH);
bindings::use_env_sp(sp, f)
}
pub unsafe fn use_tioctl_sp(sp: SCREEN, f: bool) {
assert!(!sp.is_null(), "{}use_tioctl_sp() : sp.is_null()", MODULE_PATH);
bindings::use_tioctl_sp(sp, f)
}
pub unsafe fn use_legacy_coding_sp(sp: SCREEN, level: i32) -> i32 {
assert!(!sp.is_null(), "{}use_legacy_coding_sp() : sp.is_null()", MODULE_PATH);
assert!(level >= 0, "{}use_legacy_coding_sp() : level = {}", MODULE_PATH, level);
bindings::use_legacy_coding_sp(sp, level)
}
pub unsafe fn vid_attr_sp(sp: SCREEN, attrs: attr_t, pair: short_t) -> i32 {
assert!(!sp.is_null(), "{}vid_attr_sp() : sp.is_null()", MODULE_PATH);
bindings::vid_attr_sp(sp, attrs, pair, ptr::null_mut())
}
pub unsafe fn vidattr_sp(sp: SCREEN, attrs: chtype) -> i32 {
assert!(!sp.is_null(), "{}vidattr_sp() : sp.is_null()", MODULE_PATH);
bindings::vidattr_sp(sp, attrs)
}
pub unsafe fn wunctrl_sp(sp: SCREEN, ch: *mut cchar_t) -> Option<*mut wchar_t> {
assert!(!sp.is_null(), "{}wunctrl_sp() : sp.is_null()", MODULE_PATH);
assert!(!ch.is_null(), "{}wunctrl_sp() : ch.is_null()", MODULE_PATH);
bindings::wunctrl_sp(sp, ch).as_mut().map(|ptr| ptr as *mut wchar_t)
}