]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - include/mbsedit.h
2 * SPDX-License-Identifier: LGPL-2.1-or-later
4 * This file may be distributed under the terms of the
5 * GNU Lesser General Public License.
7 #ifndef UTIL_LINUX_MBSEDIT_H
8 # define UTIL_LINUX_MBSEDIT_H
14 char *buf
; /* buffer */
15 size_t max_bytes
; /* size of the buffer */
16 size_t max_cells
; /* maximal allowed number of cells */
17 size_t cur_cells
; /* number of cells to print the buffer */
18 size_t cur_bytes
; /* number of chars in bytes */
19 size_t cursor
; /* cursor position in bytes */
20 size_t cursor_cells
; /* cursor position in cells */
30 struct mbs_editor
*mbs_new_edit(char *buf
, size_t bufsz
, size_t ncells
);
31 char *mbs_free_edit(struct mbs_editor
*edit
);
33 int mbs_edit_goto(struct mbs_editor
*edit
, int where
);
34 int mbs_edit_delete(struct mbs_editor
*edit
);
35 int mbs_edit_backspace(struct mbs_editor
*edit
);
36 int mbs_edit_insert(struct mbs_editor
*edit
, wint_t c
);
38 #endif /* UTIL_LINUX_MBSEDIT_H */