tblite
Light-weight tight-binding framework
Loading...
Searching...
No Matches
context.h
Go to the documentation of this file.
1/* This file is part of tblite.
2 * SPDX-Identifier: LGPL-3.0-or-later
3 *
4 * tblite is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * tblite is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with tblite. If not, see <https://www.gnu.org/licenses/>.
16**/
17
31#pragma once
32
33#include "tblite/macros.h"
34#include "tblite/error.h"
35
37typedef struct _tblite_context* tblite_context;
38
40typedef void (*tblite_logger_callback)(tblite_error, char*, int, void*);
41
42#ifdef TBLITE_CFFI
43extern "Python" void TBLITE_API_CALL
44logger_callback(tblite_error error, char* msg, int len, void* user_data);
45#endif
46
52
58
65
73 char* buffer,
74 const int* buffersize);
75
84 void* userdata);
85
92 int color);
93
100 int verbosity);
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_logger(tblite_context ctx, tblite_logger_callback callback, void *userdata)
TBLITE_API_ENTRY tblite_context TBLITE_API_CALL tblite_new_context(void)
TBLITE_API_ENTRY int TBLITE_API_CALL tblite_check_context(tblite_context ctx)
void(* tblite_logger_callback)(tblite_error, char *, int, void *)
Define callback function for use in custom logger.
Definition context.h:40
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_get_context_error(tblite_context ctx, char *buffer, const int *buffersize)
struct _tblite_context * tblite_context
Context manager for the library usage.
Definition context.h:37
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_delete_context(tblite_context *ctx)
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_verbosity(tblite_context ctx, int verbosity)
TBLITE_API_ENTRY void TBLITE_API_CALL tblite_set_context_color(tblite_context ctx, int color)
Provides a light-weight error handler for communicating with the library.
struct _tblite_error * tblite_error
Error instance.
Definition error.h:35
General macro definitions for the tblite C API bindings.
#define TBLITE_API_ENTRY
Definition macros.h:49
#define TBLITE_API_CALL
Definition macros.h:57
Proxy module for the calculation context related data types.
Definition context.f90:59