Browse Source

vt100: Begin vt100 refactoring

Serj Kalichev 1 month ago
parent
commit
6335d39817
5 changed files with 188 additions and 232 deletions
  1. 0 16
      tinyrl/README
  2. 95 119
      tinyrl/vt100.h
  3. 0 4
      tinyrl/vt100/module.am
  4. 0 7
      tinyrl/vt100/private.h
  5. 93 86
      tinyrl/vt100/vt100.c

+ 0 - 16
tinyrl/README

@@ -1,16 +0,0 @@
-/**
-\defgroup tinyrl "Tiny Readline Library"
-@{
-
-This library provides a simple replacement of the "readline" functionality.
-
-The readline interface and implementation has some fundamental flaws when
-it comes to try and run it within a single memory space envrioment. e.g. vxWorks
-- The use of global variables prevents multiple sessions from co-existing.
-- The comprehensiveness of the library makes it large, and it contains 
-  more features than are needed in an embedded system.
-- It relies on other (large) libraries which are not typically available on an
-  embedded system e.g. termcap.
-
-@}
-*/

+ 95 - 119
tinyrl/vt100.h

@@ -1,20 +1,6 @@
-/*
- * vt100.h
+/** @file vt100.h
  *
- * A simple class representing a vt100 terminal
  */
-  /**
-\ingroup tinyrl
-\defgroup tinyrl_vt100 vt100
-@{
-
-\brief A simple class for controlling and interacting with a VT100 compatible
-terminal.
-
-This class has been implemented pragmatically in an as needed fashion, so 
-doesn't support all the features of a VT100 terminal.
-
-*/
 
 #ifndef _tinyrl_vt100_h
 #define _tinyrl_vt100_h
@@ -22,120 +8,110 @@ doesn't support all the features of a VT100 terminal.
 #include <stdio.h>
 #include <stdarg.h>
 
-#include "lub/c_decl.h"
-#include "lub/types.h"
-
-_BEGIN_C_DECL typedef struct _tinyrl_vt100 tinyrl_vt100_t;
+typedef struct vt100_s vt100_t;
 
-/* define the Key codes */
-#define KEY_NUL	0	/**< ^@	Null character */
-#define KEY_SOH	1	/**< ^A	Start of heading, = console interrupt */
-#define KEY_STX	2	/**< ^B	Start of text, maintenance mode on HP console */
-#define KEY_ETX	3	/**< ^C	End of text */
-#define KEY_EOT	4	/**< ^D	End of transmission, not the same as ETB */
-#define KEY_ENQ	5	/**< ^E	Enquiry, goes with ACK; old HP flow control */
-#define KEY_ACK	6	/**< ^F	Acknowledge, clears ENQ logon hand */
-#define KEY_BEL	7	/**< ^G	Bell, rings the bell... */
-#define KEY_BS	8	/**< ^H	Backspace, works on HP terminals/computers */
-#define KEY_HT	9	/**< ^I	Horizontal tab, move to next tab stop */
-#define KEY_LF	10	/**< ^J	Line Feed */
-#define KEY_VT	11	/**< ^K	Vertical tab */
-#define KEY_FF	12	/**< ^L	Form Feed, page eject */
-#define KEY_CR	13	/**< ^M	Carriage Return*/
-#define KEY_SO	14	/**< ^N	Shift Out, alternate character set */
-#define KEY_SI	15	/**< ^O	Shift In, resume defaultn character set */
-#define KEY_DLE	16	/**< ^P	Data link escape */
-#define KEY_DC1	17	/**< ^Q	XON, with XOFF to pause listings; "okay to send". */
-#define KEY_DC2	18	/**< ^R	Device control 2, block-mode flow control */
-#define KEY_DC3	19	/**< ^S	XOFF, with XON is TERM=18 flow control */
-#define KEY_DC4	20	/**< ^T	Device control 4 */
-#define KEY_NAK	21	/**< ^U	Negative acknowledge */
-#define KEY_SYN	22	/**< ^V	Synchronous idle */
-#define KEY_ETB	23	/**< ^W	End transmission block, not the same as EOT */
-#define KEY_CAN	24	/**< ^X	Cancel line, MPE echoes !!! */
-#define KEY_EM	25	/**< ^Y	End of medium, Control-Y interrupt */
-#define KEY_SUB	26	/**< ^Z	Substitute */
-#define KEY_ESC	27	/**< ^[	Escape, next character is not echoed */
-#define KEY_FS	28	/**< ^\	File separator */
-#define KEY_GS	29	/**< ^]	Group separator */
-#define KEY_RS	30	/**< ^^	Record separator, block-mode terminator */
-#define KEY_US	31	/**< ^_	Unit separator */
+C_DECL_BEGIN
 
-#define KEY_DEL 127 /**< Delete (not a real control character...) */
+// Key codes
+#define KEY_NUL	0	// ^@ Null character
+#define KEY_SOH	1	// ^A Start of heading, = console interrupt
+#define KEY_STX	2	// ^B Start of text, maintenance mode on HP console
+#define KEY_ETX	3	// ^C End of text
+#define KEY_EOT	4	// ^D End of transmission, not the same as ETB
+#define KEY_ENQ	5	// ^E Enquiry, goes with ACK; old HP flow control
+#define KEY_ACK	6	// ^F Acknowledge, clears ENQ logon hand
+#define KEY_BEL	7	// ^G Bell, rings the bell
+#define KEY_BS	8	// ^H Backspace, works on HP terminals/computers
+#define KEY_HT	9	// ^I Horizontal tab, move to next tab stop
+#define KEY_LF	10	// ^J Line Feed
+#define KEY_VT	11	// ^K Vertical tab
+#define KEY_FF	12	// ^L Form Feed, page eject
+#define KEY_CR	13	// ^M Carriage Return
+#define KEY_SO	14	// ^N Shift Out, alternate character set
+#define KEY_SI	15	// ^O Shift In, resume defaultn character set
+#define KEY_DLE	16	// ^P Data link escape
+#define KEY_DC1	17	// ^Q XON, with XOFF to pause listings; "okay to send"
+#define KEY_DC2	18	// ^R Device control 2, block-mode flow control
+#define KEY_DC3	19	// ^S XOFF, with XON is TERM=18 flow control
+#define KEY_DC4	20	// ^T Device control 4
+#define KEY_NAK	21	// ^U Negative acknowledge
+#define KEY_SYN	22	// ^V Synchronous idle
+#define KEY_ETB	23	// ^W End transmission block, not the same as EOT
+#define KEY_CAN	24	// ^X Cancel line, MPE echoes !!!
+#define KEY_EM	25	// ^Y End of medium, Control-Y interrupt
+#define KEY_SUB	26	// ^Z Substitute
+#define KEY_ESC	27	// ^[ Escape, next character is not echoed
+#define KEY_FS	28	// ^\ File separator
+#define KEY_GS	29	// ^] Group separator
+#define KEY_RS	30	// ^^ Record separator, block-mode terminator
+#define KEY_US	31	// ^_ Unit separator
+#define KEY_DEL	127	// Delete (not a real control character)
 
-/**
- * This enumeration is used to identify the types of escape code 
- */
+// Types of escape code
 typedef enum {
-	tinyrl_vt100_UNKNOWN, /**< Undefined escape sequence */
-	tinyrl_vt100_CURSOR_UP, /**< Move the cursor up */
-	tinyrl_vt100_CURSOR_DOWN, /**< Move the cursor down */
-	tinyrl_vt100_CURSOR_LEFT, /**< Move the cursor left */
-	tinyrl_vt100_CURSOR_RIGHT, /**< Move the cursor right */
-	tinyrl_vt100_HOME, /**< Move the cursor to the beginning of the line */
-	tinyrl_vt100_END, /**< Move the cursor to the end of the line */
-	tinyrl_vt100_INSERT, /**< No action at the moment */
-	tinyrl_vt100_DELETE, /**< Delete character on the right */
-	tinyrl_vt100_PGUP, /**< No action at the moment */
-	tinyrl_vt100_PGDOWN /**< No action at the moment */
-} tinyrl_vt100_escape_e;
+	VT100_UNKNOWN,		// Undefined escape sequence
+	VT100_CURSOR_UP,	// Move the cursor up
+	VT100_CURSOR_DOWN,	// Move the cursor down
+	VT100_CURSOR_LEFT,	// Move the cursor left
+	VT100_CURSOR_RIGHT,	// Move the cursor right
+	VT100_HOME,		// Move the cursor to the beginning of the line
+	VT100_END,		// Move the cursor to the end of the line
+	VT100_INSERT,		// No action at the moment
+	VT100_DELETE,		// Delete character on the right
+	VT100_PGUP,		// No action at the moment
+	VT100_PGDOWN		// No action at the moment
+} vt100_esc_e;
 
 /* Return values from vt100_getchar() */
 #define VT100_EOF	-1
 #define VT100_TIMEOUT	-2
 #define VT100_ERR	-3
 
-extern tinyrl_vt100_t *tinyrl_vt100_new(FILE * instream, FILE * outstream);
-extern void tinyrl_vt100_delete(tinyrl_vt100_t * instance);
+vt100_t *vt100_new(FILE *istream, FILE *ostream);
+void vt100_free(vt100_t *vt100);
+
+FILE *vt100_istream(const vt100_t *vt100);
+void vt100_set_istream(vt100_t *vt100, FILE *istream);
+FILE *vt100_ostream(const vt100_t *vt100);
+void vt100_set_ostream(vt100_t *vt100, FILE *ostream);
+void vt100_timeout(vt100_t *vt100, int timeout);
+void vt100_set_timeout(vt100_t *vt100, int timeout);
+
+size_t vt100_width(const vt100_t *vt100);
+size_t vt100_height(const vt100_t *vt100);
+
+int vt100_printf(const vt100_t *vt100, const char *fmt, ...);
+int vt100_vprintf(const vt100_t *vt100, const char *fmt, va_list args);
+int vt100_oflush(const vt100_t *vt100);
+int vt100_ierror(const vt100_t *vt100);
+int vt100_oerror(const vt100_t *vt100);
+int vt100_ieof(const vt100_t *vt100);
+int vt100_getchar(const vt100_t *vt100);
+vt100_esc_e vt100_esc_decode(const vt100_t *vt100, const char *esc_seq);
 
-/*lint -esym(534,tinyrl_vt100_printf) Ignoring return value of function */
-extern int tinyrl_vt100_printf(const tinyrl_vt100_t * instance, const char *fmt, ...
-    );
-extern int
-tinyrl_vt100_vprintf(const tinyrl_vt100_t * instance,
-		     const char *fmt, va_list args);
+void vt100_ding(const vt100_t *vt100);
+void vt100_attribute_reset(const vt100_t *vt100);
+void vt100_attribute_bright(const vt100_t *vt100);
+void vt100_attribute_dim(const vt100_t *vt100);
+void vt100_attribute_underscore(const vt100_t *vt100);
+void vt100_attribute_blink(const vt100_t *vt100);
+void vt100_attribute_reverse(const vt100_t *vt100);
+void vt100_attribute_hidden(const vt100_t *vt100);
+void vt100_erase_line(const vt100_t *vt100);
+void vt100_clear_screen(const vt100_t *vt100);
+void vt100_cursor_back(const vt100_t *vt100, size_t count);
+void vt100_cursor_forward(const vt100_t *vt100, size_t count);
+void vt100_cursor_up(const vt100_t *vt100, size_t count);
+void vt100_cursor_down(const vt100_t *vt100, size_t count);
+void vt100_scroll_up(const vt100_t *instance);
+void vt100_scroll_down(const vt100_t *instance);
+void vt100_next_line(const vt100_t *instance);
+void vt100_cursor_home(const vt100_t *vt100);
+void vt100_cursor_save(const vt100_t *vt100);
+void vt100_cursor_restore(const vt100_t *vt100);
+void vt100_erase(const vt100_t *vt100, size_t count);
+void vt100_erase_down(const vt100_t *vt100);
 
-extern int tinyrl_vt100_oflush(const tinyrl_vt100_t * instance);
-extern int tinyrl_vt100_ierror(const tinyrl_vt100_t * instance);
-extern int tinyrl_vt100_oerror(const tinyrl_vt100_t * instance);
-extern int tinyrl_vt100_ieof(const tinyrl_vt100_t * instance);
-extern int tinyrl_vt100_getchar(const tinyrl_vt100_t * instance);
-extern unsigned tinyrl_vt100__get_width(const tinyrl_vt100_t * instance);
-extern unsigned tinyrl_vt100__get_height(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100__set_timeout(tinyrl_vt100_t *instance, int timeout);
-extern void
-tinyrl_vt100__set_istream(tinyrl_vt100_t * instance, FILE * istream);
-extern FILE *tinyrl_vt100__get_istream(const tinyrl_vt100_t * instance);
-extern FILE *tinyrl_vt100__get_ostream(const tinyrl_vt100_t * instance);
+C_DECL_END
 
-extern tinyrl_vt100_escape_e
-tinyrl_vt100_escape_decode(const tinyrl_vt100_t * instance, const char *esc_seq);
-extern void tinyrl_vt100_ding(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_reset(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_bright(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_dim(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_underscore(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_blink(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_reverse(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_attribute_hidden(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_erase_line(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_clear_screen(const tinyrl_vt100_t * instance);
-extern void
-tinyrl_vt100_cursor_back(const tinyrl_vt100_t * instance, unsigned count);
-extern void
-tinyrl_vt100_cursor_forward(const tinyrl_vt100_t * instance, unsigned count);
-extern void
-tinyrl_vt100_cursor_up(const tinyrl_vt100_t * instance, unsigned count);
-extern void
-tinyrl_vt100_cursor_down(const tinyrl_vt100_t * instance, unsigned count);
-extern void tinyrl_vt100_scroll_up(const tinyrl_vt100_t *instance);
-extern void tinyrl_vt100_scroll_down(const tinyrl_vt100_t *instance);
-extern void tinyrl_vt100_next_line(const tinyrl_vt100_t *instance);
-extern void tinyrl_vt100_cursor_home(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_cursor_save(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_cursor_restore(const tinyrl_vt100_t * instance);
-extern void tinyrl_vt100_erase(const tinyrl_vt100_t * instance, unsigned count);
-extern void tinyrl_vt100_erase_down(const tinyrl_vt100_t * instance);
-_END_C_DECL
-#endif				/* _tinyrl_vt100_h */
-/** @} tinyrl_vt100 */
+#endif // _tinyrl_vt100_h

+ 0 - 4
tinyrl/vt100/module.am

@@ -1,4 +0,0 @@
-## Process this file with automake to produce Makefile.in
-libtinyrl_la_SOURCES += \
-	tinyrl/vt100/vt100.c \
-	tinyrl/vt100/private.h

+ 0 - 7
tinyrl/vt100/private.h

@@ -1,7 +0,0 @@
-#include "tinyrl/vt100.h"
-
-struct _tinyrl_vt100 {
-	FILE *istream;
-	FILE *ostream;
-	int   timeout; /* Input timeout in seconds */
-};

+ 93 - 86
tinyrl/vt100/vt100.c

@@ -1,4 +1,3 @@
-#undef __STRICT_ANSI__		/* we need to use fileno() */
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -10,34 +9,42 @@
 #include <sys/select.h>
 #include <errno.h>
 
+#include <tinyrl/vt100.h>
+
+struct vt100 {
+	FILE *istream;
+	FILE *ostream;
+	int   timeout; /* Input timeout in seconds */
+};
+
 #include "private.h"
 
 typedef struct {
 	const char* sequence;
-	tinyrl_vt100_escape_e code;
+	vt100_escape_e code;
 } vt100_decode_t;
 
 /* This table maps the vt100 escape codes to an enumeration */
 static vt100_decode_t cmds[] = {
-	{"[A", tinyrl_vt100_CURSOR_UP},
-	{"[B", tinyrl_vt100_CURSOR_DOWN},
-	{"[C", tinyrl_vt100_CURSOR_RIGHT},
-	{"[D", tinyrl_vt100_CURSOR_LEFT},
-	{"[H", tinyrl_vt100_HOME},
-	{"[1~", tinyrl_vt100_HOME},
-	{"[F", tinyrl_vt100_END},
-	{"[4~", tinyrl_vt100_END},
-	{"[2~", tinyrl_vt100_INSERT},
-	{"[3~", tinyrl_vt100_DELETE},
-	{"[5~", tinyrl_vt100_PGUP},
-	{"[6~", tinyrl_vt100_PGDOWN},
+	{"[A", vt100_CURSOR_UP},
+	{"[B", vt100_CURSOR_DOWN},
+	{"[C", vt100_CURSOR_RIGHT},
+	{"[D", vt100_CURSOR_LEFT},
+	{"[H", vt100_HOME},
+	{"[1~", vt100_HOME},
+	{"[F", vt100_END},
+	{"[4~", vt100_END},
+	{"[2~", vt100_INSERT},
+	{"[3~", vt100_DELETE},
+	{"[5~", vt100_PGUP},
+	{"[6~", vt100_PGDOWN},
 };
 
 /*--------------------------------------------------------- */
-tinyrl_vt100_escape_e tinyrl_vt100_escape_decode(const tinyrl_vt100_t *this,
+vt100_escape_e vt100_escape_decode(const vt100_t *this,
 	const char *esc_seq)
 {
-	tinyrl_vt100_escape_e result = tinyrl_vt100_UNKNOWN;
+	vt100_escape_e result = vt100_UNKNOWN;
 	unsigned int i;
 
 	/* Decode the sequence to macros */
@@ -54,7 +61,7 @@ tinyrl_vt100_escape_e tinyrl_vt100_escape_decode(const tinyrl_vt100_t *this,
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_printf(const tinyrl_vt100_t * this, const char *fmt, ...)
+int vt100_printf(const vt100_t * this, const char *fmt, ...)
 {
 	va_list args;
 	int len;
@@ -62,7 +69,7 @@ int tinyrl_vt100_printf(const tinyrl_vt100_t * this, const char *fmt, ...)
 	if (!this->ostream)
 		return 0;
 	va_start(args, fmt);
-	len = tinyrl_vt100_vprintf(this, fmt, args);
+	len = vt100_vprintf(this, fmt, args);
 	va_end(args);
 
 	return len;
@@ -70,7 +77,7 @@ int tinyrl_vt100_printf(const tinyrl_vt100_t * this, const char *fmt, ...)
 
 /*-------------------------------------------------------- */
 int
-tinyrl_vt100_vprintf(const tinyrl_vt100_t * this, const char *fmt, va_list args)
+vt100_vprintf(const vt100_t * this, const char *fmt, va_list args)
 {
 	if (!this->ostream)
 		return 0;
@@ -78,7 +85,7 @@ tinyrl_vt100_vprintf(const tinyrl_vt100_t * this, const char *fmt, va_list args)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_getchar(const tinyrl_vt100_t *this)
+int vt100_getchar(const vt100_t *this)
 {
 	unsigned char c;
 	int istream_fd;
@@ -127,7 +134,7 @@ int tinyrl_vt100_getchar(const tinyrl_vt100_t *this)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_oflush(const tinyrl_vt100_t * this)
+int vt100_oflush(const vt100_t * this)
 {
 	if (!this->ostream)
 		return 0;
@@ -135,7 +142,7 @@ int tinyrl_vt100_oflush(const tinyrl_vt100_t * this)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_ierror(const tinyrl_vt100_t * this)
+int vt100_ierror(const vt100_t * this)
 {
 	if (!this->istream)
 		return 0;
@@ -143,7 +150,7 @@ int tinyrl_vt100_ierror(const tinyrl_vt100_t * this)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_oerror(const tinyrl_vt100_t * this)
+int vt100_oerror(const vt100_t * this)
 {
 	if (!this->ostream)
 		return 0;
@@ -151,7 +158,7 @@ int tinyrl_vt100_oerror(const tinyrl_vt100_t * this)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_ieof(const tinyrl_vt100_t * this)
+int vt100_ieof(const vt100_t * this)
 {
 	if (!this->istream)
 		return 0;
@@ -159,7 +166,7 @@ int tinyrl_vt100_ieof(const tinyrl_vt100_t * this)
 }
 
 /*-------------------------------------------------------- */
-int tinyrl_vt100_eof(const tinyrl_vt100_t * this)
+int vt100_eof(const vt100_t * this)
 {
 	if (!this->istream)
 		return 0;
@@ -167,7 +174,7 @@ int tinyrl_vt100_eof(const tinyrl_vt100_t * this)
 }
 
 /*-------------------------------------------------------- */
-unsigned int tinyrl_vt100__get_width(const tinyrl_vt100_t *this)
+unsigned int vt100__get_width(const vt100_t *this)
 {
 #ifdef TIOCGWINSZ
 	struct winsize ws;
@@ -189,7 +196,7 @@ unsigned int tinyrl_vt100__get_width(const tinyrl_vt100_t *this)
 }
 
 /*-------------------------------------------------------- */
-unsigned int tinyrl_vt100__get_height(const tinyrl_vt100_t *this)
+unsigned int vt100__get_height(const vt100_t *this)
 {
 #ifdef TIOCGWINSZ
 	struct winsize ws;
@@ -212,7 +219,7 @@ unsigned int tinyrl_vt100__get_height(const tinyrl_vt100_t *this)
 
 /*-------------------------------------------------------- */
 static void
-tinyrl_vt100_init(tinyrl_vt100_t * this, FILE * istream, FILE * ostream)
+vt100_init(vt100_t * this, FILE * istream, FILE * ostream)
 {
 	this->istream = istream;
 	this->ostream = ostream;
@@ -220,188 +227,188 @@ tinyrl_vt100_init(tinyrl_vt100_t * this, FILE * istream, FILE * ostream)
 }
 
 /*-------------------------------------------------------- */
-static void tinyrl_vt100_fini(tinyrl_vt100_t * this)
+static void vt100_fini(vt100_t * this)
 {
 	/* nothing to do yet... */
 	this = this;
 }
 
 /*-------------------------------------------------------- */
-tinyrl_vt100_t *tinyrl_vt100_new(FILE * istream, FILE * ostream)
+vt100_t *vt100_new(FILE * istream, FILE * ostream)
 {
-	tinyrl_vt100_t *this = NULL;
+	vt100_t *this = NULL;
 
-	this = malloc(sizeof(tinyrl_vt100_t));
+	this = malloc(sizeof(vt100_t));
 	if (this) {
-		tinyrl_vt100_init(this, istream, ostream);
+		vt100_init(this, istream, ostream);
 	}
 
 	return this;
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_delete(tinyrl_vt100_t * this)
+void vt100_delete(vt100_t * this)
 {
-	tinyrl_vt100_fini(this);
+	vt100_fini(this);
 	/* release the memory */
 	free(this);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_ding(const tinyrl_vt100_t * this)
+void vt100_ding(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c", KEY_BEL);
-	(void)tinyrl_vt100_oflush(this);
+	vt100_printf(this, "%c", KEY_BEL);
+	(void)vt100_oflush(this);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_reset(const tinyrl_vt100_t * this)
+void vt100_attribute_reset(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[0m", KEY_ESC);
+	vt100_printf(this, "%c[0m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_bright(const tinyrl_vt100_t * this)
+void vt100_attribute_bright(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[1m", KEY_ESC);
+	vt100_printf(this, "%c[1m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_dim(const tinyrl_vt100_t * this)
+void vt100_attribute_dim(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[2m", KEY_ESC);
+	vt100_printf(this, "%c[2m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_underscore(const tinyrl_vt100_t * this)
+void vt100_attribute_underscore(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[4m", KEY_ESC);
+	vt100_printf(this, "%c[4m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_blink(const tinyrl_vt100_t * this)
+void vt100_attribute_blink(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[5m", KEY_ESC);
+	vt100_printf(this, "%c[5m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_reverse(const tinyrl_vt100_t * this)
+void vt100_attribute_reverse(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[7m", KEY_ESC);
+	vt100_printf(this, "%c[7m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_attribute_hidden(const tinyrl_vt100_t * this)
+void vt100_attribute_hidden(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[8m", KEY_ESC);
+	vt100_printf(this, "%c[8m", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_erase_line(const tinyrl_vt100_t * this)
+void vt100_erase_line(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[2K", KEY_ESC);
+	vt100_printf(this, "%c[2K", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_clear_screen(const tinyrl_vt100_t * this)
+void vt100_clear_screen(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[2J", KEY_ESC);
+	vt100_printf(this, "%c[2J", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_save(const tinyrl_vt100_t * this)
+void vt100_cursor_save(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c7", KEY_ESC); /* VT100 */
-/*	tinyrl_vt100_printf(this, "%c[s", KEY_ESC); */ /* ANSI */
+	vt100_printf(this, "%c7", KEY_ESC); /* VT100 */
+/*	vt100_printf(this, "%c[s", KEY_ESC); */ /* ANSI */
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_restore(const tinyrl_vt100_t * this)
+void vt100_cursor_restore(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c8", KEY_ESC); /* VT100 */
-/*	tinyrl_vt100_printf(this, "%c[u", KEY_ESC); */ /* ANSI */
+	vt100_printf(this, "%c8", KEY_ESC); /* VT100 */
+/*	vt100_printf(this, "%c[u", KEY_ESC); */ /* ANSI */
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_forward(const tinyrl_vt100_t * this, unsigned count)
+void vt100_cursor_forward(const vt100_t * this, unsigned count)
 {
-	tinyrl_vt100_printf(this, "%c[%dC", KEY_ESC, count);
+	vt100_printf(this, "%c[%dC", KEY_ESC, count);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_back(const tinyrl_vt100_t * this, unsigned count)
+void vt100_cursor_back(const vt100_t * this, unsigned count)
 {
-	tinyrl_vt100_printf(this, "%c[%dD", KEY_ESC, count);
+	vt100_printf(this, "%c[%dD", KEY_ESC, count);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_up(const tinyrl_vt100_t * this, unsigned count)
+void vt100_cursor_up(const vt100_t * this, unsigned count)
 {
-	tinyrl_vt100_printf(this, "%c[%dA", KEY_ESC, count);
+	vt100_printf(this, "%c[%dA", KEY_ESC, count);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_down(const tinyrl_vt100_t * this, unsigned count)
+void vt100_cursor_down(const vt100_t * this, unsigned count)
 {
-	tinyrl_vt100_printf(this, "%c[%dB", KEY_ESC, count);
+	vt100_printf(this, "%c[%dB", KEY_ESC, count);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_scroll_up(const tinyrl_vt100_t *this)
+void vt100_scroll_up(const vt100_t *this)
 {
-	tinyrl_vt100_printf(this, "%cD", KEY_ESC);
+	vt100_printf(this, "%cD", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_scroll_down(const tinyrl_vt100_t *this)
+void vt100_scroll_down(const vt100_t *this)
 {
-	tinyrl_vt100_printf(this, "%cM", KEY_ESC);
+	vt100_printf(this, "%cM", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_next_line(const tinyrl_vt100_t *this)
+void vt100_next_line(const vt100_t *this)
 {
-	tinyrl_vt100_printf(this, "%cE", KEY_ESC);
+	vt100_printf(this, "%cE", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_cursor_home(const tinyrl_vt100_t * this)
+void vt100_cursor_home(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[H", KEY_ESC);
+	vt100_printf(this, "%c[H", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_erase(const tinyrl_vt100_t * this, unsigned count)
+void vt100_erase(const vt100_t * this, unsigned count)
 {
-	tinyrl_vt100_printf(this, "%c[%dP", KEY_ESC, count);
+	vt100_printf(this, "%c[%dP", KEY_ESC, count);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100__set_timeout(tinyrl_vt100_t *this, int timeout)
+void vt100__set_timeout(vt100_t *this, int timeout)
 {
 	this->timeout = timeout;
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100_erase_down(const tinyrl_vt100_t * this)
+void vt100_erase_down(const vt100_t * this)
 {
-	tinyrl_vt100_printf(this, "%c[J", KEY_ESC);
+	vt100_printf(this, "%c[J", KEY_ESC);
 }
 
 /*-------------------------------------------------------- */
-void tinyrl_vt100__set_istream(tinyrl_vt100_t * this, FILE * istream)
+void vt100__set_istream(vt100_t * this, FILE * istream)
 {
 	this->istream = istream;
 }
 
 /*-------------------------------------------------------- */
-FILE *tinyrl_vt100__get_istream(const tinyrl_vt100_t * this)
+FILE *vt100__get_istream(const vt100_t * this)
 {
 	return this->istream;
 }
 
 /*-------------------------------------------------------- */
-FILE *tinyrl_vt100__get_ostream(const tinyrl_vt100_t * this)
+FILE *vt100__get_ostream(const vt100_t * this)
 {
 	return this->ostream;
 }