/*** main */
-void basic_char_loop(void)
-{
- char c;
-
- c = -1;
- /* XXX */
- while (1) {
- read(cl->s_in, &c, 1);
- if (cmdline_in(cl, &c, 1) < 0) {
- break;
- }
- }
- cmdline_free(cl);
- printf("\n");
-}
-
int main(void)
{
struct termios oldterm, term;
setbuf(stdin, NULL);
cl = cmdline_stdin_new(main_ctx, "root> ");
- basic_char_loop();
+ cmdline_interact(cl);
+ cmdline_free(cl);
tcsetattr(fileno(stdin), TCSANOW, &oldterm);
return 0;