Treelite
Macros | Functions
c_api_common.h File Reference

C API of Treelite, used for interfacing with other languages This header is used by both the runtime and the main package. More...

#include <stdio.h>
#include <stdint.h>
Include dependency graph for c_api_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TREELITE_EXTERN_C
 
#define TREELITE_DLL   TREELITE_EXTERN_C
 

Functions

const char * TreeliteGetLastError (void)
 display last error; can be called by multiple threads Note. Each thread will get the last error occured in its own context. More...
 
int TreeliteRegisterLogCallback (void(*callback)(const char *))
 register callback function for LOG(INFO) messages – helpful messages that are not errors. Note: this function can be called by multiple threads. The callback function will run on the thread that registered it More...
 

Detailed Description

C API of Treelite, used for interfacing with other languages This header is used by both the runtime and the main package.

Copyright (c) 2017-2020 by Contributors

Author
Hyunsu Cho

Definition in file c_api_common.h.

Function Documentation

◆ TreeliteGetLastError()

const char* TreeliteGetLastError ( void  )

display last error; can be called by multiple threads Note. Each thread will get the last error occured in its own context.

Returns
error string

Definition at line 16 of file c_api_error.cc.

◆ TreeliteRegisterLogCallback()

int TreeliteRegisterLogCallback ( void(*)(const char *)  callback)

register callback function for LOG(INFO) messages – helpful messages that are not errors. Note: this function can be called by multiple threads. The callback function will run on the thread that registered it

Returns
0 for success, -1 for failure

Definition at line 14 of file c_api_common.cc.