FMI Library: part of JModelica.org
Functions
Constuction, destruction and error handling

Functions

FMILIB_EXPORT const char * fmi2_import_get_last_error (fmi2_import_t *fmu)
 Retrieve the last error message. More...
 
FMILIB_EXPORT int fmi2_import_clear_last_error (fmi2_import_t *fmu)
 Clear the error message. More...
 
FMILIB_EXPORT void fmi2_import_free (fmi2_import_t *fmu)
 Release the memory allocated. More...
 

Detailed Description

Function Documentation

FMILIB_EXPORT const char* fmi2_import_get_last_error ( fmi2_import_t *  fmu)

Retrieve the last error message.

Error handling:

Many functions in the library return pointers to struct. An error is indicated by returning NULL/0-pointer. If error is returned than fmi2_import_get_last_error() functions can be used to retrieve the error message. If logging callbacks were specified then the same information is reported via logger. Memory for the error string is allocated and deallocated in the module. Client code should not store the pointer to the string since it can become invalid.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
NULL-terminated string with an error message.
FMILIB_EXPORT int fmi2_import_clear_last_error ( fmi2_import_t *  fmu)

Clear the error message.

Parameters
fmuAn FMU object as returned by fmi2_import_parse_xml().
Returns
0 if further processing is possible. If it returns 1 then the error was not recoverable. The fmu object should then be freed and recreated.
FMILIB_EXPORT void fmi2_import_free ( fmi2_import_t *  fmu)

Release the memory allocated.

Parameters
fmuAn fmu object as returned by fmi2_import_parse_xml().