diff options
author | Pixel <Pixel> | 2001-05-01 21:34:28 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-05-01 21:34:28 +0000 |
commit | 6e3a9d191ccb901823d8b1b5c1b789deabb57abb (patch) | |
tree | 6cf349aad7fb805e517b2df9ab9ac1d84bcb4b41 /lib | |
parent | fb8495ceb3e1ac078d3963b26f7bd5cae94249d3 (diff) |
Pouet
Diffstat (limited to 'lib')
-rw-r--r-- | lib/interface.c | 43 |
1 files changed, 43 insertions, 0 deletions
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 <string.h> #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; + } + } + } +} |