blob: 8ebf0d064f9569e556d11b5658de567e75526712 [file] [log] [blame]
Eric Andersen03f9c812000-07-07 20:37:12 +00001#ifndef CMDEDIT_H
2#define CMDEDIT_H
Erik Andersenf0657d32000-04-12 17:49:52 +00003
Eric Andersen87559822000-12-01 19:02:24 +00004#ifdef BB_FEATURE_SH_COMMAND_EDITING
Erik Andersenf0657d32000-04-12 17:49:52 +00005/* unix systems can #define POSIX to use termios, otherwise
6 * the bsd or sysv interface will be used
Erik Andersen13456d12000-03-16 08:09:57 +00007 */
8
Erik Andersenf0657d32000-04-12 17:49:52 +00009#include <stddef.h>
Erik Andersen13456d12000-03-16 08:09:57 +000010
Erik Andersenf0657d32000-04-12 17:49:52 +000011typedef size_t (*cmdedit_strwidth_proc)(char *);
12
Erik Andersen1d1d9502000-04-21 01:26:49 +000013void cmdedit_init(void);
Eric Andersen501c88b2000-07-28 15:14:45 +000014void cmdedit_terminate(void);
Erik Andersenf0657d32000-04-12 17:49:52 +000015void cmdedit_read_input(char* promptStr, char* command); /* read a line of input */
16void cmdedit_setwidth(int); /* specify width of screen */
17void cmdedit_histadd(char *); /* adds entries to hist */
18void cmdedit_strwidth(cmdedit_strwidth_proc); /* to bind cmdedit_strlen */
19
20extern int (*cmdedit_in_hook)(char *);
21extern int (*cmdedit_out_hook)(char *);
22extern int (*cmdedit_tab_hook)(char *, int, int *);
23
Eric Andersen87559822000-12-01 19:02:24 +000024#endif /* BB_FEATURE_SH_COMMAND_EDITING */
Erik Andersenf0657d32000-04-12 17:49:52 +000025
Eric Andersen03f9c812000-07-07 20:37:12 +000026#endif /* CMDEDIT_H */