diff options
author | Michael Brown | 2012-02-28 23:45:32 +0100 |
---|---|---|
committer | Michael Brown | 2012-02-29 00:10:01 +0100 |
commit | 851b93fbc3d5d28851963bd412eb321742c5437f (patch) | |
tree | 1cd89da57441bb3808560424008a85187d98d716 /src/include/ipxe/lineconsole.h | |
parent | [syslog] Disable console when no syslog server is defined (diff) | |
download | ipxe-851b93fbc3d5d28851963bd412eb321742c5437f.tar.gz ipxe-851b93fbc3d5d28851963bd412eb321742c5437f.tar.xz ipxe-851b93fbc3d5d28851963bd412eb321742c5437f.zip |
[syslog] Separate out generic line-based console functionality
Abstract out the generic line-handling portions of the syslog
putchar() routine, to allow use by other console types.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/lineconsole.h')
-rw-r--r-- | src/include/ipxe/lineconsole.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/include/ipxe/lineconsole.h b/src/include/ipxe/lineconsole.h new file mode 100644 index 00000000..d53a0e9f --- /dev/null +++ b/src/include/ipxe/lineconsole.h @@ -0,0 +1,33 @@ +#ifndef _IPXE_LINECONSOLE_H +#define _IPXE_LINECONSOLE_H + +/** @file + * + * Line-based console + * + */ + +FILE_LICENCE ( GPL2_OR_LATER ); + +#include <stdint.h> + +/** A line-based console */ +struct line_console { + /** Data buffer + * + * Must initially be filled with NULs + */ + char *buffer; + /** Current index within buffer */ + size_t index; + /** Length of buffer + * + * The final character of the buffer will only ever be used as + * a potential terminating NUL. + */ + size_t len; +}; + +extern size_t line_putchar ( struct line_console *line, int character ); + +#endif /* _IPXE_LINECONSOLE_H */ |