diff options
author | Eric Norum <WENorum@lbl.gov> | 1999-09-28 19:14:33 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 1999-09-28 19:14:33 +0000 |
commit | 28ed4d53a89a398b702d2b43714c8e0ad4d919a2 (patch) | |
tree | 63435835c4a7de017171e4c6f765fc5a33ba0a17 /examples | |
parent | 189655901bb02f8e8a0b75492d70b3701e25cd0f (diff) |
Useful add-on libraries
Diffstat (limited to 'examples')
-rw-r--r-- | examples/readline/rlgeneric.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/readline/rlgeneric.c b/examples/readline/rlgeneric.c new file mode 100644 index 0000000..2bb5da4 --- /dev/null +++ b/examples/readline/rlgeneric.c @@ -0,0 +1,30 @@ +/* + * Host version of readline test program. + * Works as RTEMS version when included in rlchk.c + */ +#include <stdio.h> +#include <stdlib.h> +#include <malloc.h> +#include <readline/readline.h> +#include <readline/history.h> + +int +main (int argc, char **argv) +{ + char *line; + + rl_bind_key ('\t', rl_insert); + stifle_history (10); + for (;;) { + line = readline ("Enter a line: "); + if (line && *line) + add_history (line); + printf ("Line: `%s'\n", line); + if (line && !strcmp (line, "dump")) { + rl_dump_variables (0,0); + rl_dump_functions (0,0); + } + free (line); + } + return 0; +} |