diff options
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; +			} +		} +	} +}  | 
