MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
mbdynFMI_config.cc File Reference
#include "mbdynFMI_config.h"
#include <stdio.h>
#include <string.h>
Include dependency graph for mbdynFMI_config.cc:

Go to the source code of this file.

Functions

void importlogger (jm_callbacks *c, jm_string module, jm_log_level_enu_t log_level, jm_string message)
 
void setup_callbacks (jm_callbacks *callbacks)
 
std::string UncompressLocation (const char *location)
 

Function Documentation

void importlogger ( jm_callbacks *  c,
jm_string  module,
jm_log_level_enu_t  log_level,
jm_string  message 
)

Definition at line 46 of file mbdynFMI_config.cc.

Referenced by setup_callbacks().

47 {
48 
49  printf("module = %s, log level = %d: %s\n", module, log_level, message);
50 
51 }
void setup_callbacks ( jm_callbacks *  callbacks)

Definition at line 53 of file mbdynFMI_config.cc.

References importlogger().

Referenced by ModuleFMU::ModuleFMU().

53  {
54  callbacks->malloc = malloc;
55  callbacks->calloc = calloc;
56  callbacks->realloc = realloc;
57  callbacks->free = free;
58  callbacks->logger = importlogger;
59  callbacks->log_level = jm_log_level_debug;
60  callbacks->context = 0;
61  printf("Callback Setup Done! \n");
62 }
void importlogger(jm_callbacks *c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Here is the call graph for this function:

std::string UncompressLocation ( const char *  location)

Definition at line 64 of file mbdynFMI_config.cc.

Referenced by ModuleFMU::ModuleFMU().

64  {
65  int length = strlen(location);
66  int i;
67 
68  for (i=length; i>0; i--){
69  if(location[i]==47){
70  break;
71  }
72  }
73 
74  std::string destination(location);
75 // char* destination = (char*) malloc(length*sizeof(char) );
76  destination.resize(i+1);
77  return destination.c_str();
78 }