From: Grant Erickson <gerickson@nuovations.com>
To: ell@lists.linux.dev
Cc: Marcel Holtmann <marcel@holtmann.org>
Subject: [RFC PATCH v5] Line Editor
Date: Thu, 4 Apr 2024 17:20:03 -0700 [thread overview]
Message-ID: <20240405002011.3480886-1-gerickson@nuovations.com> (raw)
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.42.0
next reply other threads:[~2024-04-05 0:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 0:20 Grant Erickson [this message]
2024-04-05 0:20 ` [RFC PATCH v5] edit: Initial revision Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] ell: Add include directive for 'ell/edit.h' Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] ell/Makefile: Added 'edit.[ch]' to HEADERS and SOURCES Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] edit: Added 'l_edit_*' symbols Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] edit: pass the l_edit instance to the display and debug handlers Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] edit: change return signatures from 'bool' to 'int' Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] edit: change the 'l_edit_enter' return signature from 'char *' " Grant Erickson
2024-04-05 0:20 ` [RFC PATCH v5] edit: improve error handling of 'mbstowcs' and 'wcstombs' functions Grant Erickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240405002011.3480886-1-gerickson@nuovations.com \
--to=gerickson@nuovations.com \
--cc=ell@lists.linux.dev \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).