diff options
author | Jefferson Delfes <jefferson.delfes@gmail.com> | 2013-10-21 10:32:16 -0400 |
---|---|---|
committer | Jefferson Delfes <jefferson.delfes@gmail.com> | 2013-10-21 14:30:06 -0400 |
commit | 1cf6f20a6ed77e7677405d798a3c8b355664b9f7 (patch) | |
tree | 54aa74ad99821fca5c28acfbb65c739327f41616 /rl_helper.h | |
parent | 2e9d705c155203af66c72dd70af3c363c88415a5 (diff) |
rl_helper: implement a minimal line editing prompt
With this helper, we can replace fgets and printf, so we are able to do
editing line and command history.
Diffstat (limited to 'rl_helper.h')
-rw-r--r-- | rl_helper.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rl_helper.h b/rl_helper.h new file mode 100644 index 0000000..3da3406 --- /dev/null +++ b/rl_helper.h @@ -0,0 +1,13 @@ +#ifndef __RL_HELPER_H__ +#define __RL_HELPER_H__ + +typedef void (*line_process_callback)(char *line); + +/* initializes buffers and set line process callback */ +void rl_init(line_process_callback cb); +/* close resources */ +void rl_quit(); +/* add char to line buffer */ +void rl_feed(int c); + +#endif // __RL_HELPER_H__ |