[PATCH v6 0/8] Line Editor
Grant Erickson <[email protected]> Sun, 6 Apr 2025 15:12:07 -0700
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
This expands on Marcel Holtman's 2023-12-22 RFCv4 patch for a line
editor.
* pass the l_edit instance to the display and debug handlers.
l_edit integrations are made easier when they have access to the
instance pointer in their callbacks.
* Return status is 'int' rather than 'bool' with 0 as success and <
0 as failure where the failures are negated POSIX error
numbers. This removes the need for system integrators to intuit
their own errors on a previously-false Boolean return status.
* improve error handling of 'mbstowcs' and 'wcstombs' functions.
On error, the 'mbstowcs' and 'wcstombs' functions could return
'SIZE_MAX' when uncountering unconvertable character sequences.
Ensure that such errors are not obscured and are passed along to the
caller.
This has proven to work well with the RFCv4 and the corresponding
demo-{cli,edit} applications.
Grant Erickson (8):
edit: Initial revision.
ell: Add include directive for 'ell/edit.h'.
ell/Makefile: Added 'edit.[ch]' to HEADERS and SOURCES.
edit: Added 'l_edit_*' symbols.
edit: pass the l_edit instance to the display and debug handlers.
edit: change return signatures from 'bool' to 'int'
edit: change the 'l_edit_enter' return signature from 'char *' to
'int'
edit: improve error handling of 'mbstowcs' and 'wcstombs' functions.
Makefile.am | 2 +
ell/edit.c | 826 ++++++++++++++++++++++++++++++++++++++++++++++++++++
ell/edit.h | 59 ++++
ell/ell.h | 1 +
ell/ell.sym | 25 ++
5 files changed, 913 insertions(+)
create mode 100644 ell/edit.c
create mode 100644 ell/edit.h
--
2.45.0