tickit_term_set_output_func - Man Page

manage terminal output via a callback function


#include <tickit.h>

typedef void TickitTermOutputFunc(TickitTerm *tt, const char *bytes,
    size_t len, void *user);

void tickit_term_set_output_func(TickitTerm *tt,
    TickitTermOutputFunc *fn, void *user);

Link with -ltickit.


tickit_term_set_output_func() associates an output function with the terminal instance. If set, this function will be used to send bytes to the user's terminal even if an output file descriptor is also set. When the function is invoked, it will be passed the terminal instance, a byte buffer and size, and the user data pointer it was installed with.

When an output function is replaced by another or the terminal is destroyed, an existing function is invoked one final time to inform it. In this case, the len argument will be 0 and bytes will be NULL.

After both an input and output method have been defined, it is recommended to call tickit_term_await_started(3) to wait for the terminal to be set up.

Return Value

tickit_term_set_output_func() returns no value.

See Also

tickit_term_new(3), tickit_term_set_output_fd(3), tickit_term_await_started(3), tickit_term_print(3), tickit_term(7), tickit(7)

Referenced By

tickit_term(7), tickit_term_await_started_msec(3), tickit_term_chpen(3), tickit_term_clear(3), tickit_term_erasech(3), tickit_term_flush(3), tickit_term_new(3), tickit_term_print(3), tickit_term_set_output_buffer(3), tickit_term_set_output_fd(3).