summaryrefslogtreecommitdiff
path: root/libterm/term_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'libterm/term_io.c')
-rw-r--r--libterm/term_io.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/libterm/term_io.c b/libterm/term_io.c
new file mode 100644
index 0000000..1a934f9
--- /dev/null
+++ b/libterm/term_io.c
@@ -0,0 +1,67 @@
+#include "term_io.h"
+
+int term_fprint( screen_mode_e mode, FILE *f )
+{
+ int ret=-1;
+ if (f == NULL)
+ return -1;
+
+ switch ( mode )
+ {
+ case SCREEN_MODE_80x25:
+ {
+ }
+ break;
+ default:
+ printf("Unknown screen mode\n");
+ }
+
+ return ret;
+}
+
+
+//print data to terminal starting from x,y
+int term_print( term_screen *ts, const char *buf, size_t size,
+ int init_column, int init_row )
+{
+ int pos_column=0, pos_row=0;
+ int ret=-1;
+ if ( buf == NULL )
+ {
+ return -1;
+ }
+
+ if ( size <= 0 )
+ {
+ return -1;
+ }
+
+ switch ( ts->mode )
+ {
+ case SCREEN_MODE_80x25:
+ {
+
+ }
+ break;
+ default:
+ printf("Unknown mode\n");
+ }
+
+ return ret;
+}
+
+//read one character from stream
+int term_getc( term_screen *ts )
+{
+ int ret=-1;
+ int fret=-1;
+ char buf;
+
+ fret = read( ts->ifd, &buf, 1 );
+ if ( fret == 1 )
+ ret = buf;
+
+ return ret;
+}
+
+