Treelite
Macros | Functions | Variables
c_api_error.cc File Reference

C error handling. More...

#include <treelite/thread_local.h>
#include <treelite/c_api_error.h>
#include <treelite/version.h>
#include <string>
#include <sstream>
Include dependency graph for c_api_error.cc:

Go to the source code of this file.

Macros

#define STR_IMPL_(x)   #x
 
#define STR(x)   STR_IMPL_(x)
 

Functions

const char * TreeliteGetLastError ()
 display last error; can be called by multiple threads Note. Each thread will get the last error occured in its own context. More...
 
void TreeliteAPISetLastError (const char *msg)
 Set the last error message needed by C API. More...
 
const char * TreeliteQueryTreeliteVersion ()
 Get the version string for the Treelite library. More...
 

Variables

const char * TREELITE_VERSION
 

Detailed Description

C error handling.

Copyright (c) 2017-2021 by Contributors

Author
Hyunsu Cho

Definition in file c_api_error.cc.

Function Documentation

◆ TreeliteAPISetLastError()

void TreeliteAPISetLastError ( const char *  msg)

Set the last error message needed by C API.

Parameters
msgThe error message to set.

Definition at line 32 of file c_api_error.cc.

◆ 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 28 of file c_api_error.cc.

◆ TreeliteQueryTreeliteVersion()

const char* TreeliteQueryTreeliteVersion ( void  )

Get the version string for the Treelite library.

Returns
version string, of form MAJOR.MINOR.PATCH

Definition at line 36 of file c_api_error.cc.

Variable Documentation

◆ TREELITE_VERSION

const char* TREELITE_VERSION
Initial value:
= "TREELITE_VERSION_" STR(TREELITE_VER_MAJOR) "."
STR(TREELITE_VER_MINOR) "." STR(TREELITE_VER_PATCH)

Definition at line 44 of file c_api_error.cc.