20 #include <config_test.h> 27 static void fmi1logger(fmi1_component_t
c, fmi1_string_t instanceName,
fmi1_status_t status, fmi1_string_t category, fmi1_string_t message, ...)
32 va_start(argp, message);
34 printf(
"fmiStatus = %d; %s (%s): %s\n", status, instanceName, category, msg);
41 const char* modelIdentifier;
42 const char* modelName;
55 printf(
"Error parsing XML, exiting\n");
56 return (CTEST_RETURN_FAIL);
62 printf(
"Model name: %s\n", modelName);
63 printf(
"Model identifier: %s\n", modelIdentifier);
64 printf(
"Model GUID: %s\n", GUID);
68 printf(
"Could not create the DLL loading mechanism(C-API).\n");
69 return(CTEST_RETURN_FAIL);
78 return (CTEST_RETURN_SUCCESS);
int fmi1_test(fmi_import_context_t *context, const char *dirPath)
FMILIB_EXPORT const char * fmi1_import_get_GUID(fmi1_import_t *fmu)
Get FMU GUID.
FMILIB_EXPORT const char * fmi1_import_get_model_name(fmi1_import_t *fmu)
Get model name.
fmi1_callback_logger_ft logger
fmi1_callback_allocate_memory_ft allocateMemory
FMILIB_EXPORT void fmi1_import_destroy_dllfmu(fmi1_import_t *fmu)
Free a C-API struct. All memory allocated since the struct was created is freed.
FMILIB_EXPORT jm_status_enu_t fmi1_import_create_dllfmu(fmi1_import_t *fmu, fmi1_callback_functions_t callBackFunctions, int registerGlobally)
Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.
FMILIB_EXPORT fmi1_import_t * fmi1_import_parse_xml(fmi_import_context_t *c, const char *dirName)
Parse FMI 1.0 XML file found in the directory dirName.
FMILIB_EXPORT const char * fmi1_import_get_model_identifier(fmi1_import_t *fmu)
Get model identifier.
Include file to be used in client applications of the FMI Library.
struct fmi_xml_context_t fmi_import_context_t
FMI version independent library context. Opaque struct returned from fmi_import_allocate_context() ...
FMILIB_EXPORT const char * fmi1_import_get_version(fmi1_import_t *fmu)
Wrapper for the FMI function fmiGetVersion()
fmi1_callback_free_memory_ft freeMemory
struct fmi1_import_t fmi1_import_t
FMU version 1.0 object.
jm_status_enu_t
Return status codes.
FMILIB_EXPORT void fmi1_import_free(fmi1_import_t *fmu)
Release the memory allocated.
static void fmi1logger(fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)
FMILIB_EXPORT int jm_vsnprintf(char *str, size_t size, const char *fmt, va_list al)
C89 compatible implementation of C99 vsnprintf.