Example #1
0
File: stuff.c Project: ptt/pttbbs
int
getdata_buf(int line, int col, const char *prompt, char *buf, int len, int echo)
{
    move(line, col); SOLVE_ANSI_CACHE();
    if(prompt && *prompt) outs(prompt);
    return vgetstr(buf, len, getdata2vgetflag(echo), buf);
}
Example #2
0
File: io.c Project: chage/formosa
int
getdata_str(int line, int col, const char *prompt, char *buf, int len, int echo, char *defaultstr)
{
    move(line, col);
    if(prompt && *prompt) outs(prompt);
    return vgetstr(buf, max_len(col, prompt, len), getdata2vgetflag(echo), defaultstr);
}
Example #3
0
static int
a_multi_search_num(char init, a_menu_session_t *sess)
{
    char buf[STRLEN - sizeof(MULTI_SEARCH_PROMPT) -1] = "";

    buf[0] = init;
    move(b_lines, 0);
    clrtoeol();
    outs(MULTI_SEARCH_PROMPT);
    sess->z_indexes[0] = sess->z_indexes[1] = 0;
    if (vgetstr(buf, sizeof(buf), VGET_DEFAULT, buf) < 1)
	return 0;

    a_parse_zindexes(buf, sess);
    if (!sess->z_indexes[1])
	return sess->z_indexes[0];
    return 0;
}
Example #4
0
/*
 * Write remote input out to stdout (and script file if enabled).
 */
static void
tipout_write(char *buf, size_t len)
{
	char *cp;

	for (cp = buf; cp < buf + len; cp++)
		*cp &= STRIP_PAR;

	write(STDOUT_FILENO, buf, len);

	if (vgetnum(SCRIPT) && fscript != NULL) {
		if (!vgetnum(BEAUTIFY))
			fwrite(buf, 1, len, fscript);
		else {
			for (cp = buf; cp < buf + len; cp++) {
				if ((*cp >= ' ' && *cp <= '~') ||
				    any(*cp, vgetstr(EXCEPTIONS)))
				    putc(*cp, fscript);
			}
		}
	}
}