-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmbdynFMI_config.cc
49 lines (38 loc) · 1.27 KB
/
mbdynFMI_config.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
AUTHOR: Devyesh Tandon <[email protected]>
Copyright (C) 2016(-2016) all rights reserved.
The copyright of this patch is transferred
to Pierangelo Masarati and Paolo Mantegazza
for use in the software MBDyn as described
in the GNU Public License version 2.1
*/
#include "mbdynFMI_config.h"
#include <stdio.h>
#include <string.h>
void importlogger(jm_callbacks* c, jm_string module, jm_log_level_enu_t log_level, jm_string message)
{
printf("module = %s, log level = %d: %s\n", module, log_level, message);
}
void setup_callbacks(jm_callbacks* callbacks){
callbacks->malloc = malloc;
callbacks->calloc = calloc;
callbacks->realloc = realloc;
callbacks->free = free;
callbacks->logger = importlogger;
callbacks->log_level = jm_log_level_debug;
callbacks->context = 0;
printf("Callback Setup Done! \n");
}
std::string UncompressLocation(const char* location){
int length = strlen(location);
int i;
for (i=length; i>0; i--){
if(location[i]==47){
break;
}
}
std::string destination(location);
// char* destination = (char*) malloc(length*sizeof(char) );
destination.resize(i+1);
return destination.c_str();
}