2 Copyright (C) 2012 Modelon AB
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the BSD style license.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 FMILIB_License.txt file for more details.
12 You should have received a copy of the FMILIB_License.txt file
13 along with this program. If not, contact Modelon AB <http://www.modelon.com>.
19 #include <FMI/fmi_util.h>
\r
21 char* fmi_construct_dll_dir_name(jm_callbacks* callbacks, const char* fmu_unzipped_path) {
\r
25 assert( fmu_unzipped_path && callbacks);
\r
28 strlen(fmu_unzipped_path) + strlen(FMI_FILE_SEP)
\r
29 + strlen(FMI_BINARIES) + strlen(FMI_FILE_SEP)
\r
30 + strlen(FMI_PLATFORM) + strlen(FMI_FILE_SEP) + 1;
\r
32 dir_path = (char*)callbacks->malloc(len);
\r
33 if (dir_path == NULL) {
\r
34 jm_log_fatal(callbacks, "FMIUT", "Failed to allocate memory.");
\r
38 sprintf(dir_path, "%s%s%s%s%s%s", fmu_unzipped_path, FMI_FILE_SEP, FMI_BINARIES, FMI_FILE_SEP, FMI_PLATFORM, FMI_FILE_SEP);/*safe */
\r
43 char* fmi_construct_dll_file_name(jm_callbacks* callbacks, const char* dll_dir_name, const char* model_identifier) {
46 assert(callbacks && model_identifier);
48 strlen(dll_dir_name) +
49 strlen(model_identifier)
50 + strlen(FMI_DLL_EXT) + 1;
51 fname = (char*)callbacks->malloc(len);
\r
52 if (fname == NULL) {
\r
53 jm_log_fatal(callbacks, "FMIUT", "Failed to allocate memory.");
\r
56 sprintf(fname, "%s%s%s", dll_dir_name, model_identifier, FMI_DLL_EXT);/*safe */
\r