Beispiel #1
0
int vt100_write(termstate_t *term, const char * buf, int count)
{
    const char * act;

    // hide the cursor --> this restores the window without cursor
    // stuff in it. we set the cursor to its new position later
    vt100_hide_cursor(term);

    // set virt back to phys. without that, the following could happen:
    // 1. The user scrolls up to the beginning of the history buffer
    // 2. The history becomes filled up.
    // 3. As we have a ring buffer, the user sees the new text coming
    //    in from above.

    term->vis_off = 0;

    for(act = buf; act < buf + count; act++)
    {
        parse_character(term, (l4_uint8_t)*act);
    }

    // show the cursor
    vt100_show_cursor(term);

    // redraw
    vt100_redraw(term);

    return count;
}
Beispiel #2
0
closure *parse_null(FILE *file, closure *accum)
{
    //printf("parse null\n");
    wchar_t c = fgetwc(file);
    if(iswspace(c)){
	return parse_null(file, nil());
    } else if(c == L'$'){
	return parse_character(file, nil());
    } else if(c == L'#'){
	parse_comment(file, nil());
	return parse_null(file, accum);
    } else if(c == L'\"'){
	return parse_string(file, nil());
    } else if(c == L'\''){
	wchar_t c = fgetwc(file);
	if (!iswspace(c)){
	    ungetwc(c, file);
	    closure *boo = parse_null(file, nil());
	    if (boo != NULL) return quote(boo);
	}
	return symbol(QUOTE);
    } else if(c == L'@'){
	wchar_t c = fgetwc(file);
	if (!iswspace(c)){
	    ungetwc(c, file);
	    closure *boo = parse_null(file, nil());
	    if (boo != NULL) return list(2, symbol(ATPEND), boo);
	}
	return symbol(ATPEND);
    } else if(c == L','){
	wchar_t c = fgetwc(file);
	if (!iswspace(c)){
	    ungetwc(c, file);
	    closure *boo = parse_null(file, nil());
	    if (boo != NULL) return list(2, symbol(COMMA), boo);
	}
	return symbol(COMMA);
    } else if(c == L'*'){
	wchar_t c = fgetwc(file);
	if (!iswspace(c)){
	    ungetwc(c, file);
	    closure *boo = parse_null(file, nil());
	    if (boo != NULL) return list(2, symbol(ASTERIX), boo);
	}
	return symbol(ASTERIX);
    } else if(iswdigit(c)){
	ungetwc(c, file);
	return parse_number(file, nil());
    } else if(c == L'('){
	return parse_list(file, nil());
    } else if(c == L')'){
	ungetwc(c, file);
	return NULL;
    } else if(c == WEOF || c == EOF){
	return NULL;
    } else {
	return parse_symbol(file, cons(character(c), nil()));
    }
}
Beispiel #3
0
skO *parse_character_literal (char **next, jmp_buf jmp)
{
	if (**next != '\'')
		return NULL;

	++*next;
	return parse_character(next, jmp);

}
void
blue_screen_putchar(char c)
{
	if (sScreen.ignore_output
		&& (in_command_invocation() || sScreen.boot_debug_output))
		return;

	sScreen.ignore_output = false;
	hide_cursor();

	parse_character(c);

	update_cursor(sScreen.x, sScreen.y);
}
void
blue_screen_puts(const char *text)
{
	if (sScreen.ignore_output
		&& (in_command_invocation() || sScreen.boot_debug_output))
		return;

	sScreen.ignore_output = false;
	hide_cursor();

	while (text[0] != '\0') {
		parse_character(text[0]);
		text++;
	}

	update_cursor(sScreen.x, sScreen.y);
}
Beispiel #6
0
skO *parse_string_literal (char **next, jmp_buf jmp)
{
	skO *list;

	if (**next != '"')
		return NULL;

	++*next;
	list = skO_list_new();

	while (**next != '"')
		sk_list_append(list, parse_character(next, jmp));
	++*next;

	#ifdef SK_PARSER_DEBUG
	printf("Parsed STRING\n");
	#endif
	return list;
}