2 Copyright Jonathan Wright 2007
9 char prompt
[] = "test> ";
11 char *promptCallback(EditLine
*e
)
18 History
*h
= history_init();
19 EditLine
*e
= el_init("edittest", stdin
, stdout
, stderr
);
20 el_set(e
, EL_PROMPT
, promptCallback
);
21 el_set(e
, EL_HIST
, history
, h
);
22 el_set(e
, EL_SIGNAL
, 1);
23 el_set(e
, EL_EDITOR
, "emacs");
27 history(h
, &ev
, H_SETSIZE
, 1024);
33 const char *str
= el_gets(e
, &count
);
35 if (!str
|| count
<= 0)
42 history(h
, &ev
, H_ENTER
, str
);