From 6e3a9d191ccb901823d8b1b5c1b789deabb57abb Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 1 May 2001 21:34:28 +0000 Subject: Pouet --- lib/interface.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'lib') diff --git a/lib/interface.c b/lib/interface.c index 8a89c8e..fc238b5 100644 --- a/lib/interface.c +++ b/lib/interface.c @@ -2,5 +2,48 @@ #include #include "config.h" #include "interface.h" +#include "terminal.h" #include "exceptions.h" +void supprime(char * ch) { + for (; *ch; ch++) { + *ch = *(ch + 1); + } +} + +void insert(char * ch, char c) { + int i; + + for (i = strlen(ch) - 1; i; i--) { + *(ch + i + 1) = *(ch + i); + } + + *ch = c; +} + +void ifloop(void) { + int cread; + int gotesc = 0; + char buffer[BUFSIZ]; + int position; + + while (1) { + cread = fgetc(input); + printf("%u\n", cread); + + if (gotesc) { + } else { + switch(cread) { + case 27: /* Caractère ESC */ + gotesc = 1; + break; + case 8: /* Caractère <--- */ + if (position) { + } + break; + case 127: /* Caractère Suppr */ + break; + } + } + } +} -- cgit v1.2.3