summaryrefslogtreecommitdiff
path: root/libterm/term.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-01-08 00:28:11 +0900
committerFreeArtMan <dos21h@gmail.com>2015-01-08 00:28:11 +0900
commit3d489fe502178d2d4e58eb8d5736be2fbda38077 (patch)
tree153d134b43fb8929e0725bb923742466b6e2f1cd /libterm/term.c
parent03e459e7dff84c44644b1eccc0e00b73d846fe2a (diff)
downloadmicrobbs-3d489fe502178d2d4e58eb8d5736be2fbda38077.tar.gz
microbbs-3d489fe502178d2d4e58eb8d5736be2fbda38077.zip
Bumped libterm version
Diffstat (limited to 'libterm/term.c')
-rw-r--r--libterm/term.c55
1 files changed, 48 insertions, 7 deletions
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 )
{