Next: libcnx, Previous: mod-udp, 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_install (lw6cns_callback_func_t callback)

  callback: handler function.

  Installs a console handler.

  Return value: none.

Function: void lw6cns_handler_poll ()

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

  Return value: none.

Function: void lw6cns_handler_remove ()

  Remove console handler.

  Return value: none.

Function: void lw6cns_history_add_if_needed (char * line)

  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 ()

  Tells wether console is supported.

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

Function: int lw6cns_term_support ()

  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 (int mode)

  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 (int mode)

  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.