summaryrefslogtreecommitdiffstats
path: root/libterm/term.c
diff options
context:
space:
mode:
Diffstat (limited to 'libterm/term.c')
-rw-r--r--libterm/term.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/libterm/term.c b/libterm/term.c
index 412253b..532dc92 100644
--- a/libterm/term.c
+++ b/libterm/term.c
@@ -37,6 +37,23 @@ exit_error:
return -1;
}
+//set terminal speed return 0 if OK and 1 if not
+//im trust to input arguments that they are ok
+int term_set_speed( term_screen *ts, speed_t speed)
+{
+ int ret = cfsetospeed( &ts->raw_i, speed );
+ if ( ret != 0 )
+ return 1;
+
+ //if baudrate set to there then input speed same as
+ //output speed
+ cfsetispeed( &ts->raw_i, B0);
+ ret = tcsetattr(1, TCSANOW, &ts->raw_i );
+ if ( ret != 0 )
+ return 1;
+ return 0;
+}
+
//get maximal number of columns setting up cursor to 999 column
//and getting on with place terminal have placed cursor and getting
//column on with terminal putted cursor
@@ -233,12 +250,6 @@ exit_error:
}
-int term_set_speed( term_screen *ts )
-{
- int ret = -1;
- return ret;
-}
-
//clean terminal with escape command
int term_clr_scr( term_screen *ts )