Table of Contents


tsci2_get_default_context, - get a copy of tsci2 librarie’s default context.


#include <tsci2.h>

int tsci2_get_default_context(tsci2_context context);


tsci2 library maintains a default context which contains the conversion table, daemon statitistics etc. This function makes a copy of the default context and put it in the space pointed to by context. Memory pointed to by context must be preallocated. Most applications never call this function, and instead rely on the implicit default current context.

Return Values

tsci2_get_default_context() returns 0 when the default context is successfully copied. Otherwise, TSCI2_ERROR is returned.


The following code shows how to use tsci2_init() and tsci2_shutdown().

#include <stdio.h>

#include <tsci2.h>

int main(int argc, char **argv) {

int preferred_methods, method;

tsci2_context context;

preferred_methods = TSCI2_DAEMON | TSCI2_FALLBACK;

method = tsci2_init(preferred_methods);

if ( method == TSCI2_ERROR )

printf("Error initializing tsci2 library!\n");


printf("default context is at address %p\n", cxt);




Xun Luo (

See Also

tsci2d(8) , tsci2demo(1) , tsci2measure(1) , tsci2_init(3) , tsci2_shutdown(3) , tsci2_alloc_context(3) , tsci2_free_context(3) , tsci2_gettimeofday(3) , tsci2_getticks(3) , tsci2_ticks2timeval(3) .

Table of Contents