Next: libvox, Previous: libsys, Up: C API

### 5.41 libtsk

#### 5.41.1 Overview

View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/tsk/index.html.

#### 5.41.2 API

— Function: lw6tsk_loader_t * lw6tsk_loader_new (float sleep, char * user_dir, float * progress)

> sleep: how many seconds to wait between every poll

> user_dir: user directory

> progress: progress indicator to use

> Creates a new loader. This object is used to do some reputed slow calculus in the background, in a separated thread. Typical example is map loading. This is a high-level objects which encapsulates threads and other wizardry.

> Return value: a pointer to the loader, NULL if failed.

— Function: void lw6tsk_loader_free (lw6tsk_loader_t * loader)

> loader: the loader to free.

> Deletes a loader. Will automatically stop the child thread, free data, and so on.

> Return value: none.

— Function: char * lw6tsk_loader_repr (lw6tsk_loader_t * loader)

> loader: the loader to represent.

> Creates a string which briefly describes the loader.

> Return value: a dynamically allocated pointer, must be freed.

— Function: int lw6tsk_loader_get_stage (lw6tsk_loader_t * loader)

> loader: the loader to query.

> Returns the current stage of the loader.

> Return value: 0 if idle, 1 if loading the map from disk, 2 if build dynamic stuff such as game_state.

— Function: int lw6tsk_test (int mode)

> mode: 0 for check only, 1 for full test

> Runs the `tsk` module test suite.

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