Barrelfish
Macros | Functions
client_blocking.h File Reference

Blocking I/O API for terminal client library. More...

Macros

#define TERM_CLIENT_EOL_CHAR   '\n'
 

Functions

errval_t term_client_blocking_init (struct term_client *client, struct capref sessionid)
 Initialize a connection to a terminal server and block until connection is established. More...
 
void term_client_blocking_exit (struct term_client *client)
 Tear down connection to terminal server. More...
 
errval_t term_client_blocking_read (struct term_client *client, char *data, size_t length, size_t *read)
 Blocking read from a terminal. More...
 
errval_t term_client_blocking_write (struct term_client *client, const char *data, size_t length, size_t *written)
 Blocking write to a terminal. More...
 
errval_t term_client_blocking_config (struct term_client *client, enum TerminalConfig opt, size_t arg)
 Send a configuration command to the terminal server. More...
 

Detailed Description

Blocking I/O API for terminal client library.

Macro Definition Documentation

#define TERM_CLIENT_EOL_CHAR   '\n'

Character that is used by libterm_client to determine end of line.

Function Documentation

errval_t term_client_blocking_config ( struct term_client client,
enum TerminalConfig  opt,
size_t  arg 
)

Send a configuration command to the terminal server.

Parameters
clientTerminal client state.
optConfiguration option.
argOptional argument.
Returns
SYS_ERR_OK if successful. TERM_ERR_UNKNOWN_CONFIG_OPT if opt is unknown.

Dispatches the config waitset until configuration message is sent.

void term_client_blocking_exit ( struct term_client client)

Tear down connection to terminal server.

Parameters
clientTerminal client state.

Dispatches the control waitset until the message is sent.

errval_t term_client_blocking_init ( struct term_client client,
struct capref  session_id 
)

Initialize a connection to a terminal server and block until connection is established.

Parameters
clientTerminal client state, initialized by function to default values.
session_idThe session the domain is part of.

Dispatches the monitor waitset until all the bindings to the terminal server are established.

errval_t term_client_blocking_read ( struct term_client client,
char *  data,
size_t  length,
size_t *  read 
)

Blocking read from a terminal.

Parameters
clientTerminal client state.
dataBuffer to hold read characters.
lengthThe number of characters to read.
readNumber of characters read. This might be less than length if line_mode is enabled and the end of line was reached or if an error occurred.
Returns
SYS_ERR_OK if successful. TERM_ERR_IO if an I/O error occurred.

Dispatches the read if no data is available.

errval_t term_client_blocking_write ( struct term_client client,
const char *  data,
size_t  length,
size_t *  written 
)

Blocking write to a terminal.

Parameters
clientTerminal client state.
dataBuffer holding characters to write.
lengthThe number of characters to write.
writtenNumber of characters written. This might be less than length if an error occurred.
Returns
SYS_ERR_OK if successful. TERM_ERR_IO if an I/O error occurred.

Dispatches the write waitset until data is sent.