From 3d489fe502178d2d4e58eb8d5736be2fbda38077 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Thu, 8 Jan 2015 00:28:11 +0900 Subject: Bumped libterm version --- libterm/term.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'libterm/term.c') diff --git a/libterm/term.c b/libterm/term.c index 1aa7afa..f1dbf40 100644 --- a/libterm/term.c +++ b/libterm/term.c @@ -50,9 +50,7 @@ int term_init( term_screen *term ) if ( tcgetattr( term->ifd, &term->orig_i ) == -1 ) goto exit_error; term->raw_i = term->orig_i; - //if (term_set_raw_mode( term ) == -1 ) goto exit_error; - - term->mode = SCREEN_MODE_80x24; + term->mode = SCREEN_MODE_80x25; return ret; @@ -116,7 +114,6 @@ int term_get_maxrow( term_screen *ts ) goto exit_error; ret = cur_r; - //PNL(); /* restore position */ { char buf[32]; @@ -124,12 +121,9 @@ int term_get_maxrow( term_screen *ts ) write( ts->ofd, buf, strlen(buf) ); } - //PNL(); - return ret; exit_error: - //PNL(); return -1; } @@ -306,6 +300,53 @@ exit_error: } +//if there is no mode with some rows/columns , then just show that no mode setet +// up and user should decide by his own what to do +int term_mode_rows( term_screen *ts ) +{ + int ret = -1; + + if ( ts == NULL) return -1; + + switch ( ts->mode ) + { + //--------------------- + case SCREEN_MODE_80x25: + ret = 25; + break; + //-------------------- + case SCREEN_MODE_NONE: + default: + ret = -1; + } + + return ret; +} + + +//if there is no mode with some rows/columns , then just show that no mode setet +// up and user should decide by his own what to do +int term_mode_columns( term_screen *ts ) +{ + int ret = -1; + + if ( ts == NULL) return -1; + + switch ( ts->mode ) + { + //--------------------- + case SCREEN_MODE_80x25: + ret = 80; + break; + //-------------------- + case SCREEN_MODE_NONE: + default: + ret = -1; + } + + return ret; +} + void term_set_orig_mode( term_screen *ts ) { -- cgit v1.2.3