]> git.ipfire.org Git - thirdparty/util-linux.git/blame - include/mbsedit.h
libmount: fix comment referring to passno field
[thirdparty/util-linux.git] / include / mbsedit.h
CommitLineData
299ef2c4
KZ
1#ifndef UTIL_LINUX_MBSEDIT_H
2# define UTIL_LINUX_MBSEDIT_H
3
4#include "mbsalign.h"
5#include "widechar.h"
6
7struct mbs_editor {
8 char *buf; /* buffer */
9 size_t max_bytes; /* size of the buffer */
10 size_t max_cells; /* maximal allowed number of cells */
11 size_t cur_cells; /* number of cells to print the buffer */
12 size_t cur_bytes; /* number of chars in bytes */
13 size_t cursor; /* cursor position in bytes */
14 size_t cursor_cells; /* cursor position in cells */
15};
16
17enum {
18 MBS_EDIT_LEFT,
19 MBS_EDIT_RIGHT,
20 MBS_EDIT_END,
21 MBS_EDIT_HOME
22};
23
24struct mbs_editor *mbs_new_edit(char *buf, size_t bufsz, size_t ncells);
25char *mbs_free_edit(struct mbs_editor *edit);
26
27int mbs_edit_goto(struct mbs_editor *edit, int where);
28int mbs_edit_delete(struct mbs_editor *edit);
29int mbs_edit_backspace(struct mbs_editor *edit);
30int mbs_edit_insert(struct mbs_editor *edit, wint_t c);
31
32#endif /* UTIL_LINUX_MBSEDIT_H */