Next: , Previous: , Up: C API   [Contents][Index]


5.12 libcns

5.12.1 Overview

View lcov test coverage results on http://www.ufoot.org/liquidwar/v6/doc/coverage/src/lib/cns/index.html.

5.12.2 API

Function: void lw6cns_handler_callback (char * line)

line: the input line

The global console handler. Because readline does not, or at least, because I did not find any proper way to pass it a general pointer along with the string, and since we need sys_context pretty much everywhere, we rely on using this handler which, in turn, calls the handler passed to lw6cns_handler_install with sys_context added as a first argument.

Return value: none.

Function: void lw6cns_handler_install (lw6sys_context_t * sys_context, lw6cns_callback_func_t callback)

sys_context: global system context

callback: handler function.

Installs a console handler.

Return value: none.

Function: void lw6cns_handler_poll (lw6sys_context_t * sys_context)

sys_context: global system context

Polling function for console, must be called on a regular basis.

Return value: none.

Function: void lw6cns_handler_remove (lw6sys_context_t * sys_context)

sys_context: global system context

Remove console handler.

Return value: none.

Function: void lw6cns_history_add_if_needed (lw6sys_context_t * sys_context, char * line)

sys_context: global system context

line: line to add

Adds a line to the console history, won’t add it if it’s NULL or empty.

Return value: none.

Function: int lw6cns_console_support (lw6sys_context_t * sys_context)

sys_context: global system context

Tells wether console is supported.

Return value: 1 if console can be enabled, 0 if not

Function: int lw6cns_term_support (lw6sys_context_t * sys_context)

sys_context: global system context

Tells wether program is likely to have proper term (xterm, Linux console) support.

Return value: 1 if has validated TERM support, 0 if not

Function: int lw6cns_test_register (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Registers all tests for the libcns module.

Return value: 1 if test is successfull, 0 on error.

Function: int lw6cns_test_run (lw6sys_context_t * sys_context, int mode)

sys_context: global system context

mode: test mode (bitmask)

Runs the cns module test suite, testing most (if not all...) functions.

Return value: 1 if test is successfull, 0 on error.


Next: , Previous: , Up: C API   [Contents][Index]