Exemplo n.º 1
0
NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0)
{
    int result;

    T((T_CALLED("baudrate(%p)"), (void *) SP_PARM));

    /*
     * In debugging, allow the environment symbol to override when we're
     * redirecting to a file, so we can construct repeatable test-cases
     * that take into account costs that depend on baudrate.
     */
#ifdef TRACE
    if (IsValidTIScreen(SP_PARM)
	&& !NC_ISATTY(fileno(SP_PARM ? SP_PARM->_ofp : stdout))
	&& getenv("BAUDRATE") != 0) {
	int ret;
	if ((ret = _nc_getenv_num("BAUDRATE")) <= 0)
	    ret = 9600;
	ospeed = (NCURSES_OSPEED) _nc_ospeed(ret);
	returnCode(ret);
    }
#endif

    if (IsValidTIScreen(SP_PARM)) {
#ifdef USE_OLD_TTY
	result = (int) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
	ospeed = (NCURSES_OSPEED) _nc_ospeed(result);
#else /* !USE_OLD_TTY */
#ifdef TERMIOS
	ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb));
#else
	ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed;
#endif
	result = _nc_baudrate(ospeed);
#endif
	TerminalOf(SP_PARM)->_baudrate = result;
    } else {
	result = ERR;
    }

    returnCode(result);
}
Exemplo n.º 2
0
NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t)
{
    T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t));

    if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM))
	returnCode(ERR);

    NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG);
    SP_PARM->_cbreak = t + 1;
    returnCode(OK);
}
Exemplo n.º 3
0
NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0)
{
    bool code = FALSE;
    T((T_CALLED("has_il(%p)"), (void *) SP_PARM));
    if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) {
	code = ((insert_line || parm_insert_line)
		&& (delete_line || parm_delete_line)) ? TRUE : FALSE;
    }

    returnCode(code);
}
Exemplo n.º 4
0
NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0)
{
    bool code = FALSE;

    T((T_CALLED("has_ic(%p)"), (void *) SP_PARM));

    if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) {
	code = ((insert_character || parm_ich
		 || (enter_insert_mode && exit_insert_mode))
		&& (delete_character || parm_dch)) ? TRUE : FALSE;
    }

    returnCode(code);
}
Exemplo n.º 5
0
NCURSES_SP_NAME(has_key) (SCREEN *sp, int keycode)
{
    T((T_CALLED("has_key(%p, %d)"), (void *) sp, keycode));
    returnCode(IsValidTIScreen(sp) ? CallDriver_1(sp, kyExist, keycode) : FALSE);
}