Barrelfish
Functions
client.c File Reference

Non-blocking I/O API for terminal client library. More...

Functions

errval_t term_client_change_read_waitset (struct term_client *client, struct waitset *read_ws)
 Change the waitset used for incoming characters. More...
 
errval_t term_client_change_write_waitset (struct term_client *client, struct waitset *write_ws)
 Change the waitset used for outgoing characters. More...
 
errval_t term_client_change_config_waitset (struct term_client *client, struct waitset *conf_ws)
 Change the waitset used for configuration messages. More...
 
errval_t term_client_write (struct term_client *client, const char *data, size_t length, struct event_closure cont)
 Non-blocking write to a terminal. More...
 
errval_t term_client_config (struct term_client *client, terminal_config_option_t opt, char *arg, struct event_closure cont)
 Send a configuration command to the terminal server. More...
 
void term_client_set_err_handler (struct term_client *client, term_async_err_handler_fn err_cb)
 Set an error handler, called when an asynchronous error occurs. More...
 
void term_client_set_chars_handler (struct term_client *client, term_characters_handler_fn *chars_cb)
 Set handler that is called when new characters arrive. More...
 

Detailed Description

Non-blocking I/O API for terminal client library.

Function Documentation

errval_t term_client_change_config_waitset ( struct term_client client,
struct waitset conf_ws 
)

Change the waitset used for configuration messages.

Parameters
clientTerminal client state.
conf_wsNew waitset to use.
Returns
SYS_ERR_OK if successful. TERM_ERR_CHANGE_WAITSET on error.
errval_t term_client_change_read_waitset ( struct term_client client,
struct waitset read_ws 
)

Change the waitset used for incoming characters.

Parameters
clientTerminal client state.
read_wsNew waitset to use.
Returns
SYS_ERR_OK if successful. TERM_ERR_CHANGE_WAITSET on error.
errval_t term_client_change_write_waitset ( struct term_client client,
struct waitset write_ws 
)

Change the waitset used for outgoing characters.

Parameters
clientTerminal client state.
write_wsNew waitset to use.
Returns
SYS_ERR_OK if successful. TERM_ERR_CHANGE_WAITSET on error.
errval_t term_client_config ( struct term_client client,
terminal_config_option_t  opt,
char *  arg,
struct event_closure  cont 
)

Send a configuration command to the terminal server.

Parameters
clientTerminal client state.
optConfiguration option.
argOptional argument.
contContinuation invoked once the configuration message is sent.
Returns
SYS_ERR_OK if successful. TERM_ERR_TX_BUSY if another message is buffered but not yet sent. TERM_ERR_UNKNOWN_CONFIG_OPT if opt is unknown.
void term_client_set_chars_handler ( struct term_client client,
term_characters_handler_fn *  chars_cb 
)

Set handler that is called when new characters arrive.

Parameters
clientTerminal client state.
chars_cbCharacters handler.
void term_client_set_err_handler ( struct term_client client,
term_async_err_handler_fn  err_cb 
)

Set an error handler, called when an asynchronous error occurs.

Parameters
clientTerminal client state.
err_cbError handler.
errval_t term_client_write ( struct term_client client,
const char *  data,
size_t  length,
struct event_closure  cont 
)

Non-blocking write to a terminal.

Parameters
clientTerminal client state.
dataBuffer holding characters to write.
lengthThe number of characters to write.
contContinuation invoked once the write completes.
Returns
SYS_ERR_OK if successful. TERM_ERR_TX_BUSY if another message is buffered but not yet sent. TERM_ERR_IO if an I/O error occurred.