FMI Library: part of JModelica.org
Functions
Utility functions supporting interactions with the library

Functions

FMILIB_EXPORT charfmi_import_mk_temp_dir (jm_callbacks *cb, const char *systemTempDir, const char *tempPrefix)
 Create a unique temporary directory. More...
 
FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir (jm_callbacks *cb, const char *dir)
 Remove directory and all it contents. More...
 
FMILIB_EXPORT charfmi_import_create_URL_from_abs_path (jm_callbacks *cb, const char *absPath)
 Create a file:// URL from absolute path. More...
 
FMILIB_EXPORT charfmi_import_get_dll_path (const char *fmu_unzipped_path, const char *model_identifier, jm_callbacks *callBackFunctions)
 
FMILIB_EXPORT charfmi_import_get_model_description_path (const char *fmu_unzipped_path, jm_callbacks *callBackFunctions)
 

Detailed Description

Function Documentation

FMILIB_EXPORT char* fmi_import_mk_temp_dir ( jm_callbacks cb,
const char systemTempDir,
const char tempPrefix 
)

Create a unique temporary directory.

Parameters
cb- callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.
systemTempDir- directory where the temp dir should be located both absolute and relative path are accepted. System-wide directory is used if this parameter is NULL.
tempPrefix- File name template prefix used when creating temporaty directories. "fmil" is used if this is NULL.
Returns
A pointer to the temporary directory name (absolute path, no terminating '/'). Caller is responsible for freeing the memory. The function returns NULL if there were errors in which case a message is send to the logger.
FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir ( jm_callbacks cb,
const char dir 
)

Remove directory and all it contents.

Parameters
cb- callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.
dir- path to be removed.
Returns
Statuc success or error.
FMILIB_EXPORT char* fmi_import_create_URL_from_abs_path ( jm_callbacks cb,
const char absPath 
)

Create a file:// URL from absolute path.

Parameters
cb- callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.
absPath- absolute path to be converted into the URL
Returns
A pointer to the URL. Caller is responsible for freeing the memory. The function returns NULL if there were errors in which case a message is send to the logger.
FMILIB_EXPORT char* fmi_import_get_dll_path ( const char fmu_unzipped_path,
const char model_identifier,
jm_callbacks callBackFunctions 
)

Given directory name fmu_unzipped_path and model identifier consturct Dll/so name

Returns
Pointer to a string with the file name. Caller is responsible for freeing the memory.
FMILIB_EXPORT char* fmi_import_get_model_description_path ( const char fmu_unzipped_path,
jm_callbacks callBackFunctions 
)

Given directory name fmu_unzipped_path and model identifier consturct XML file name

Returns
Pointer to a string with the file name. Caller is responsible for freeing the memory.