#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.
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");
tsci2_get_default_context(context);
printf("default context is at address %p\n", cxt);
tsci2_shutdown();
}