FIX: renamed functions, see previous commit.
This commit is contained in:
parent
48d0cbf049
commit
be03b202fe
|
@ -101,7 +101,7 @@ lw_terminal_parser, lw_terminal_vt100, and hl_vt100 are three modules used to em
|
||||||
Got data from | | | Recieve data from callbacks
|
Got data from | | | Recieve data from callbacks
|
||||||
lw_terminal_vt100_read_str | | lw_terminal_vt100 | And store an in-memory
|
lw_terminal_vt100_read_str | | lw_terminal_vt100 | And store an in-memory
|
||||||
give it to | | | state of the vt100 terminal
|
give it to | | | state of the vt100 terminal
|
||||||
lw_terminal_read_str V ----------------------
|
lw_terminal_parser_read_strV ----------------------
|
||||||
| ^
|
| ^
|
||||||
| |
|
| |
|
||||||
| |
|
| |
|
||||||
|
|
|
@ -4,22 +4,22 @@
|
||||||
.\" other parameters are allowed: see man(7), man(1)
|
.\" other parameters are allowed: see man(7), man(1)
|
||||||
.TH lw_terminal_parser 3 2011-09-27
|
.TH lw_terminal_parser 3 2011-09-27
|
||||||
.SH NAME
|
.SH NAME
|
||||||
lw_terminal_init, lw_terminal_read, lw_terminal_read_str, lw_terminal_destroy \- LW Terminal Parser
|
lw_terminal_parser_init, lw_terminal_read, lw_terminal_parser_read_str, lw_terminal_destroy \- LW Terminal Parser
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B #include <lw_terminal_parser.h>
|
.B #include <lw_terminal_parser.h>
|
||||||
.sp
|
.sp
|
||||||
.BI "struct lw_terminal *lw_terminal_init(void);"
|
.BI "struct lw_terminal *lw_terminal_parser_init(void);"
|
||||||
.br
|
.br
|
||||||
.BI "void lw_terminal_read(struct lw_terminal *" this ", char " c ");"
|
.BI "void lw_terminal_read(struct lw_terminal *" this ", char " c ");"
|
||||||
.br
|
.br
|
||||||
.BI "void lw_terminal_read_str(struct lw_terminal *" this " , char *" c ");"
|
.BI "void lw_terminal_parser_read_str(struct lw_terminal *" this " , char *" c ");"
|
||||||
.br
|
.br
|
||||||
.BI "void lw_terminal_destroy(struct lw_terminal* " this ");"
|
.BI "void lw_terminal_destroy(struct lw_terminal* " this ");"
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
lw_terminal_parser is a library to parse escape sequences commonly sent to terminals. The functions in lw_terminal_parser allows you to create, send data, and destroy a terminal parser. The function
|
lw_terminal_parser is a library to parse escape sequences commonly sent to terminals. The functions in lw_terminal_parser allows you to create, send data, and destroy a terminal parser. The function
|
||||||
.BR lw_terminal_init ()
|
.BR lw_terminal_parser_init ()
|
||||||
allocates and prepare a new struct lw_terminal for you. Once a lw_terminal initialized you should hook your callbacks for escape sequences and write in lw_terminal->callbacks and lw_terminal->write. The you should call
|
allocates and prepare a new struct lw_terminal for you. Once a lw_terminal initialized you should hook your callbacks for escape sequences and write in lw_terminal->callbacks and lw_terminal->write. The you should call
|
||||||
.BR lw_terminal_read_str()
|
.BR lw_terminal_parser_read_str()
|
||||||
or
|
or
|
||||||
.BR lw_terminal_read()
|
.BR lw_terminal_read()
|
||||||
to make the terminal parse them.
|
to make the terminal parse them.
|
||||||
|
@ -57,13 +57,13 @@ int main(void)
|
||||||
{
|
{
|
||||||
struct lw_terminal *lw_terminal;
|
struct lw_terminal *lw_terminal;
|
||||||
|
|
||||||
lw_terminal = lw_terminal_init();
|
lw_terminal = lw_terminal_parser_init();
|
||||||
if (lw_terminal == NULL)
|
if (lw_terminal == NULL)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
lw_terminal->write = vt100_write;
|
lw_terminal->write = vt100_write;
|
||||||
lw_terminal->callbacks.csi.f = csi_f;
|
lw_terminal->callbacks.csi.f = csi_f;
|
||||||
lw_terminal->callbacks.csi.K = csi_K;
|
lw_terminal->callbacks.csi.K = csi_K;
|
||||||
lw_terminal_read_str(lw_terminal, "\\033[2KHello world !\\033[f");
|
lw_terminal_parser_read_str(lw_terminal, "\\033[2KHello world !\\033[f");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
.fi
|
.fi
|
||||||
|
|
Loading…
Reference in New Issue