require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&NO_BORDER)) {
    sub NO_BORDER () {	0;}
}
unless(defined(&BORDER)) {
    sub BORDER () {	1;}
}
unless(defined(&WS_NCOLS)) {
    sub WS_NCOLS {
	my($ws) = @_;
	eval q((($ws)-> ($scr_dconf->{scrdata}->{ncols})));
    }
}
unless(defined(&WS_NROWS)) {
    sub WS_NROWS {
	my($ws) = @_;
	eval q((($ws)-> ($scr_dconf->{scrdata}->{nrows})));
    }
}
unless(defined(&MAXCOL)) {
    sub MAXCOL () {	( &WS_NCOLS( ($sc->{sc_focus})) - 1);}
}
unless(defined(&MAXROW)) {
    sub MAXROW () {	( &WS_NROWS( ($sc->{sc_focus})) - 1);}
}
unless(defined(&N_COLS)) {
    sub N_COLS () {	( &WS_NCOLS( ($sc->{sc_focus})));}
}
unless(defined(&N_ROWS)) {
    sub N_ROWS () {	( &WS_NROWS( ($sc->{sc_focus})));}
}
unless(defined(&MOUSE)) {
    sub MOUSE () {	( ($sc->{sc_focus}->{mouse}));}
}
unless(defined(&CURSOR)) {
    sub CURSOR () {	( ($sc->{sc_focus}->{cursor}));}
}
unless(defined(&CPY_START)) {
    sub CPY_START () {	( ($sc->{sc_focus}->{cpy_start}));}
}
unless(defined(&CPY_END)) {
    sub CPY_END () {	( ($sc->{sc_focus}->{cpy_end}));}
}
unless(defined(&ORIG_START)) {
    sub ORIG_START () {	( ($sc->{sc_focus}->{orig_start}));}
}
unless(defined(&ORIG_END)) {
    sub ORIG_END () {	( ($sc->{sc_focus}->{orig_end}));}
}
unless(defined(&MOUSE_FLAGS)) {
    sub MOUSE_FLAGS () {	( ($sc->{sc_focus}->{mouse_flags}));}
}
unless(defined(&XY_TO_POS)) {
    sub XY_TO_POS {
	my($col, $row) = @_;
	eval q(((($row) *  &N_COLS) + ($col)));
    }
}
unless(defined(&POS_TO_X)) {
    sub POS_TO_X {
	my($pos) = @_;
	eval q((($pos) % ( &N_COLS)));
    }
}
unless(defined(&POS_TO_Y)) {
    sub POS_TO_Y {
	my($pos) = @_;
	eval q((($pos) / ( &N_COLS)));
    }
}
unless(defined(&GETCHAR)) {
    sub GETCHAR {
	my($pos, $cellp) = @_;
	eval q(((* ($sc->{sc_accessops}->{getchar})) ( ($sc->{sc_accesscookie}), ($pos) /  &N_COLS, ($pos) %  &N_COLS, $cellp)));
    }
}
unless(defined(&PUTCHAR)) {
    sub PUTCHAR {
	my($pos, $uc, $attr) = @_;
	eval q(((* ($sc->{sc_focus}->{scr_dconf}->{emulops}->{putchar})) ( ($sc->{sc_focus}->{scr_dconf}->{emulcookie}), (($pos) /  &N_COLS), (($pos) %  &N_COLS), ($uc), ($attr))));
    }
}
unless(defined(&MOUSE_COPY_BUTTON)) {
    sub MOUSE_COPY_BUTTON () {	0;}
}
unless(defined(&MOUSE_PASTE_BUTTON)) {
    sub MOUSE_PASTE_BUTTON () {	1;}
}
unless(defined(&MOUSE_EXTEND_BUTTON)) {
    sub MOUSE_EXTEND_BUTTON () {	2;}
}
unless(defined(&IS_ALPHANUM)) {
    sub IS_ALPHANUM {
	my($c) = @_;
	eval q((($c) != ord(' ')));
    }
}
unless(defined(&IS_SPACE)) {
    sub IS_SPACE {
	my($c) = @_;
	eval q((($c) == ord(' ')));
    }
}
1;
