Eric Andersen | 03f9c81 | 2000-07-07 20:37:12 +0000 | [diff] [blame] | 1 | #ifndef CMDEDIT_H |
| 2 | #define CMDEDIT_H |
Erik Andersen | f0657d3 | 2000-04-12 17:49:52 +0000 | [diff] [blame] | 3 | |
| 4 | /* unix systems can #define POSIX to use termios, otherwise |
| 5 | * the bsd or sysv interface will be used |
Erik Andersen | 13456d1 | 2000-03-16 08:09:57 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
Erik Andersen | f0657d3 | 2000-04-12 17:49:52 +0000 | [diff] [blame] | 8 | #ifdef __STDC__ |
| 9 | #include <stddef.h> |
Erik Andersen | 13456d1 | 2000-03-16 08:09:57 +0000 | [diff] [blame] | 10 | |
Erik Andersen | f0657d3 | 2000-04-12 17:49:52 +0000 | [diff] [blame] | 11 | typedef size_t (*cmdedit_strwidth_proc)(char *); |
| 12 | |
Erik Andersen | 1d1d950 | 2000-04-21 01:26:49 +0000 | [diff] [blame] | 13 | void cmdedit_init(void); |
Eric Andersen | 501c88b | 2000-07-28 15:14:45 +0000 | [diff] [blame] | 14 | void cmdedit_terminate(void); |
Erik Andersen | f0657d3 | 2000-04-12 17:49:52 +0000 | [diff] [blame] | 15 | void cmdedit_read_input(char* promptStr, char* command); /* read a line of input */ |
| 16 | void cmdedit_setwidth(int); /* specify width of screen */ |
| 17 | void cmdedit_histadd(char *); /* adds entries to hist */ |
| 18 | void cmdedit_strwidth(cmdedit_strwidth_proc); /* to bind cmdedit_strlen */ |
| 19 | |
| 20 | extern int (*cmdedit_in_hook)(char *); |
| 21 | extern int (*cmdedit_out_hook)(char *); |
| 22 | extern int (*cmdedit_tab_hook)(char *, int, int *); |
| 23 | |
| 24 | #else /* not __STDC__ */ |
| 25 | |
Erik Andersen | 1d1d950 | 2000-04-21 01:26:49 +0000 | [diff] [blame] | 26 | void cmdedit_init(void); |
Erik Andersen | f0657d3 | 2000-04-12 17:49:52 +0000 | [diff] [blame] | 27 | void cmdedit_read_input(char* promptStr, char* command); |
| 28 | void cmdedit_setwidth(); |
| 29 | void cmdedit_histadd(); |
| 30 | void cmdedit_strwidth(); |
| 31 | |
| 32 | extern int (*cmdedit_in_hook)(); |
| 33 | extern int (*cmdedit_out_hook)(); |
| 34 | extern int (*cmdedit_tab_hook)(); |
| 35 | |
| 36 | #endif /* __STDC__ */ |
| 37 | |
Eric Andersen | 03f9c81 | 2000-07-07 20:37:12 +0000 | [diff] [blame] | 38 | #endif /* CMDEDIT_H */ |