vinix-ports / libedit / history.c
16 lines · 15 sloc · 454 bytes · 4f789b90d69371235c3b58ffef848451ef19f9b3
Raw
1#include <histedit.h>
2#include <string.h>
3
4int main(void) {
5 HistEvent event;
6 History *history_state = history_init();
7 if (!history_state)
8 return 1;
9 if (history(history_state, &event, H_SETSIZE, 4) < 0 ||
10 history(history_state, &event, H_ENTER, "vinix") < 0 ||
11 history(history_state, &event, H_FIRST) < 0 ||
12 strcmp(event.str, "vinix") != 0)
13 return 1;
14 history_end(history_state);
15 return 0;
16}
17