5752054 [rkeene@sledge /home/rkeene/devel/old/billing]$ cat -n screenio.c
 1 #include <unistd.h>
 2 #include <stdio.h>
 3 
 4 void clear(void) {
 5     write(STDOUT_FILENO, "\033[2J\033[H", 7);
 6     fsync(STDOUT_FILENO);
 7 }
 8 
 9 void gohome(void) {
10     write(STDOUT_FILENO, "\033[H", 3);
11     fsync(STDOUT_FILENO);
12 }
13 
14 void locate(int x, int y) {
15     char message[9];
16     sprintf(message, "\033[%i;%iH", x, y);
17     write(STDOUT_FILENO, message, strlen(message));
18     fsync(STDOUT_FILENO);
19 }
5752055 [rkeene@sledge /home/rkeene/devel/old/billing]$

Click here to go back to the directory listing.
Click here to download this file.
last modified: 2000-03-03 22:28:06