[RFC PATCH v5] Input/Output Terminal Abstraction
Grant Erickson <[email protected]> Sun, 31 Mar 2024 16:47:33 -0700
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
This expands on Marcel Holtman's 2023-12-22 RFCv4 patch for an
input/output terminal abstraction.
Substantive changes from the v4 version:
* 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.
* Makes 'l_term_set_{input,output}' public functions.
* Adds observer functions for the terminal rows and columns.
* Adds a modifier function for the terminal bounds.
* Adds:
- l_term_io_func_t
- l_term_set_io_handler
- l_term_process
- l_term_io_callback
Collectively, these make the abstraction run loop adaptable with a
default callback that can be easily used with ELL's run loop,
'l_term_io_callback'.
* Adds 'l_term_[v]print' which complete the output interface.
Of course, its always possible to perform this outside of an atop
the existing functions; however, this eliminates integrators from
having to manage the buffers necessary to do this.
This has proven to work well with the RFCv4 l_edit interfaces and the
corresponding demo-{cli,edit} applications.
Grant Erickson (4):
term: Initial revision.
ell: Add include directive for 'ell/term.h'.
ell/Makefile: Added 'term.[ch]' to HEADERS and SOURCES.
term: Added 'l_term_*' symbols.
Makefile.am | 2 +
ell/ell.h | 1 +
ell/ell.sym | 21 +++
ell/term.c | 487 ++++++++++++++++++++++++++++++++++++++++++++++++++++
ell/term.h | 69 ++++++++
5 files changed, 580 insertions(+)
create mode 100644 ell/term.c
create mode 100644 ell/term.h
--
2.42.0