blob: 1cc4dbebc08875ad329e8777466fa5ff7df0dee6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#pragma once
#include "list.h"
#include "wchar.h"
#define HISTORY_MAX 100
struct inputln {
wchar_t *buf;
int len, cap;
int cur;
struct link link;
};
struct history {
struct link list;
struct inputln *sel, *input;
};
void history_init(struct history *history);
void history_free(struct history *history);
void history_submit(struct history *history);
void history_prev(struct history *history);
void history_next(struct history *history);
void history_add(struct history *history, struct inputln *line);
struct inputln *inputln_alloc(void);
void inputln_init(struct inputln *ln);
void inputln_resize(struct inputln *ln, size_t size);
void inputln_free(struct inputln *ln);
void inputln_left(struct inputln *line);
void inputln_right(struct inputln *line);
void inputln_addch(struct inputln *line, wchar_t c);
void inputln_del(struct inputln *line, int n);
void inputln_copy(struct inputln *dst, struct inputln *src);
void inputln_replace(struct inputln *line, const wchar_t *str);
|