CBMC
api.h File Reference
#include <memory>
#include <string>
#include <vector>
#include "api_options.h"
#include "verification_result.h"
+ Include dependency graph for api.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  api_sessiont
 

Typedefs

using api_call_back_contextt = void *
 The type of pointers to contextual data passed to the api_message_callback functions. More...
 
using api_message_callbackt = void(*)(const api_messaget &message, api_call_back_contextt call_back_context)
 The type of call back for feedback of status information and results. More...
 

Functions

const char * api_message_get_string (const api_messaget &message)
 Given a api_message, this function returns that message expressed as a C language string. More...
 
bool api_message_is_error (const api_messaget &message)
 

Typedef Documentation

◆ api_call_back_contextt

using api_call_back_contextt = void *

The type of pointers to contextual data passed to the api_message_callback functions.

These pointers point to api consumer data and are just passed through to the callback verbatim. These support users of the api to avoid using global variables.

Definition at line 40 of file api.h.

◆ api_message_callbackt

using api_message_callbackt = void (*)( const api_messaget &message, api_call_back_contextt call_back_context)

The type of call back for feedback of status information and results.

Parameters
messageA structured message object. The lifetime of this object is the duration of the call to the callback. So if any data from it is required to persist, then this data must be copied into the API consumers memory.
call_back_contextA pointer to the context for the function. This is passed through the API to the function and is for use like a capture group. Memory for this object is owned by the consumer of the API.

Definition at line 50 of file api.h.

Function Documentation

◆ api_message_get_string()

const char* api_message_get_string ( const api_messaget message)

Given a api_message, this function returns that message expressed as a C language string.

Note
The memory for the returned string is owned by the message and as such does not need to be freed by users of the API.

Definition at line 82 of file api.cpp.

◆ api_message_is_error()

bool api_message_is_error ( const api_messaget message)
Returns
true is message is an error message, or false otherwise.

Definition at line 87 of file api.cpp.