Browse code

tty_flush

John Hawthorn authored on 17/08/2014 03:34:16
Showing 3 changed files

  • fzy.c index e44154b..7d09c5f 100644
  • tty.c index be3e388..05edd76 100644
  • tty.h index a339a71..3ee64f6 100644
... ...
@@ -139,7 +139,7 @@ void draw(tty_t *tty){
139 139
 	}
140 140
 	tty_moveup(tty, line + 1);
141 141
 	tty_setcol(tty, strlen(prompt) + strlen(search) + 1);
142
-	fflush(tty->fout);
142
+	tty_flush(tty);
143 143
 }
144 144
 
145 145
 void emit(tty_t *tty){
... ...
@@ -78,3 +78,7 @@ void tty_printf(tty_t *tty, const char *fmt, ...){
78 78
 	va_end(args);
79 79
 }
80 80
 
81
+void tty_flush(tty_t *tty){
82
+	fflush(tty->fout);
83
+}
84
+
... ...
@@ -38,5 +38,6 @@ void tty_moveup(tty_t *tty, int i);
38 38
 void tty_setcol(tty_t *tty, int col);
39 39
 
40 40
 void tty_printf(tty_t *tty, const char *fmt, ...);
41
+void tty_flush(tty_t *tty);
41 42
 
42 43
 #endif