tblite
Light-weight tight-binding framework
|
Provides a persistent configuration object to modify the behaviour of a calculation. Acts as an error handler. More...
Go to the source code of this file.
Typedefs | |
typedef struct _tblite_context * | tblite_context |
Context manager for the library usage. | |
typedef void(* | tblite_logger_callback) (tblite_error, char *, int, void *) |
Define callback function for use in custom logger. | |
Functions | |
TBLITE_API_ENTRY tblite_context TBLITE_API_CALL | tblite_new_context (void) |
TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_delete_context (tblite_context *ctx) |
TBLITE_API_ENTRY int TBLITE_API_CALL | tblite_check_context (tblite_context ctx) |
TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_get_context_error (tblite_context ctx, char *buffer, const int *buffersize) |
TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_logger (tblite_context ctx, tblite_logger_callback callback, void *userdata) |
TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_color (tblite_context ctx, int color) |
TBLITE_API_ENTRY void TBLITE_API_CALL | tblite_set_context_verbosity (tblite_context ctx, int verbosity) |
Provides a persistent configuration object to modify the behaviour of a calculation. Acts as an error handler.
The environment context tblite_context can be considered a persistent setup for all calculations performed with the library, it is usually used together with calculator objects tblite_calculator. While the error handle can only contain a single error, multiple errors can be accumulated in a context object, which allows storing more complex error information like they can occur in an actual calculation.
TBLITE_API_ENTRY int TBLITE_API_CALL tblite_check_context | ( | tblite_context | ctx | ) |
Check calculation environment status
ctx | Context handle |
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_delete_context | ( | tblite_context * | ctx | ) |
Delete a calculation environment object
ctx | Context handle |
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_get_context_error | ( | tblite_context | ctx, |
char * | buffer, | ||
const int * | buffersize ) |
Get error message from calculation environment
ctx | Context handle |
buffer | Character buffer for writing error message to |
buffersize | Maximum length of buffer (optional) |
TBLITE_API_ENTRY tblite_context TBLITE_API_CALL tblite_new_context | ( | void | ) |
Create new calculation environment object
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_color | ( | tblite_context | ctx, |
int | color ) |
Enable colorful output
ctx | Context handle |
color | Set color support, 0: disabled, 1: enabled |
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_logger | ( | tblite_context | ctx, |
tblite_logger_callback | callback, | ||
void * | userdata ) |
Set custom logger function
ctx | Context handle |
callback | Procedure pointer implementing logger |
userdata | Passthrough data pointer |
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_verbosity | ( | tblite_context | ctx, |
int | verbosity ) |
Set verbosity level of printout
ctx | Context handle |
verbosity | Printout verbosity |