use core::ffi::c_ushort;

pub const _ISspace: c_ushort = 1 << 0;
pub const _ISprint: c_ushort = 1 << 1;
pub const _IScntrl: c_ushort = 1 << 2;
pub const _ISupper: c_ushort = 1 << 3;
pub const _ISlower: c_ushort = 1 << 4;
pub const _ISalpha: c_ushort = 1 << 5;
pub const _ISdigit: c_ushort = 1 << 6;
// regex_word: 1 << 7
pub const _ISpunct: c_ushort = 1 << 8;
pub const _ISxdigit: c_ushort = 1 << 9;
pub const _ISblank: c_ushort = 1 << 10;

include!(concat!(env!("OUT_DIR"), "/ctype_b.rs"));

// # define __isctype(c, type) \
//   ((*__ctype_b_loc ())[(int) (c)] & (unsigned short int) type)

static mut __ctype_b_ptr: *const c_ushort = unsafe { __ctype_b_table.as_ptr().add(128) };

#[no_mangle]
unsafe extern "C" fn __ctype_b_loc() -> *mut *mut c_ushort {
    (&raw mut __ctype_b_ptr).cast()
}
