]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/native/FMUSimulator/include/fmi1_cs.h
Improvements to FMI-support to support 2.0 FMU's
[simantics/fmil.git] / org.simantics.fmil.core / native / FMUSimulator / include / fmi1_cs.h
index 65072e1f41f311a1c750eba72259ffcd292fca01..40d942b15f531e2d64b2b9ccf7a13dae7409cfbe 100644 (file)
@@ -1,55 +1,66 @@
-#ifndef __FMI1_CS_H__\r
-#define __FMI1_CS_H__\r
-\r
-#ifdef __cplusplus\r
-extern "C" {\r
-#endif\r
-\r
-typedef struct {\r
-       char *name;\r
-       char *description;\r
-       char *declaredType;\r
-       long vr;\r
-       // 0 = real\r
-       // 1 = integer\r
-       // 2 = boolean\r
-       // 3 = string\r
-       // 4 = enumeration\r
-       int type;\r
-       // 0 = constant\r
-       // 1 = parameter\r
-       // 2 = discrete\r
-       // 3 = continuous\r
-       // 4 = unknown\r
-       int variability;\r
-       // 0 = input\r
-       // 1 = output\r
-       // 2 = internal\r
-       // 3 = none\r
-       // 4 = unknown\r
-       int causality;\r
-} FMIL_Variable;\r
-\r
-typedef struct {\r
-       char *name;\r
-       char *description;\r
-       char *quantity;\r
-       char *unit;\r
-} FMIL_DeclaredType;\r
-\r
-__declspec(dllexport) void* FMI1_CS_LOAD(const char *zipFilePath, const char *unzipFolder);\r
-__declspec(dllexport) int FMI1_CS_UNLOAD(void* fmu);\r
-__declspec(dllexport) FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count);\r
-__declspec(dllexport) FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count);\r
-__declspec(dllexport) int FMI1_CS_INSTANTIATE(void* fmu);\r
-__declspec(dllexport) int FMI1_CS_INITIALIZE(void* fmu);\r
-__declspec(dllexport) int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize);\r
-__declspec(dllexport) double FMI1_CS_SET_REAL(void* fmu, int vr, double value);\r
-__declspec(dllexport) int FMI1_CS_GET_REALS(void* fmu, int *vrs, double *values, int count);\r
-__declspec(dllexport) double FMI1_CS_GET_REAL(void* fmu, int vr);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
+#ifndef __FMI1_CS_H__
+#define __FMI1_CS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+       char *name;
+       char *description;
+       char *declaredType;
+       long vr;
+       // 0 = real
+       // 1 = integer
+       // 2 = boolean
+       // 3 = string
+       // 4 = enumeration
+       int type;
+       // 0 = constant
+       // 1 = parameter
+       // 2 = discrete
+       // 3 = continuous
+       // 4 = unknown
+       int variability;
+       // 0 = input
+       // 1 = output
+       // 2 = internal
+       // 3 = none
+       // 4 = unknown
+       int causality;
+} FMIL_Variable;
+
+typedef struct {
+       char *name;
+       char *description;
+       char *quantity;
+       char *unit;
+} FMIL_DeclaredType;
+
+__declspec(dllexport) int FMI_CS_LOAD(const char *zipFilePath, const char *unzipFolder, void **fmuPointer, int *fmuVersion, const char **error);
+
+__declspec(dllexport) int FMI1_CS_UNLOAD(void* fmu, const char **error);
+__declspec(dllexport) FMIL_Variable *FMI1_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
+__declspec(dllexport) FMIL_DeclaredType *FMI1_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
+__declspec(dllexport) int FMI1_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
+__declspec(dllexport) int FMI1_CS_INITIALIZE(void* fmu, const char **error);
+__declspec(dllexport) int FMI1_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
+__declspec(dllexport) int FMI1_CS_SET_REAL(void* fmu, int vr, double value, const char **error);
+__declspec(dllexport) double FMI1_CS_GET_REAL(void* fmu, int vr, const char **error);
+__declspec(dllexport) int FMI1_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error);
+
+__declspec(dllexport) int FMI2_CS_UNLOAD(void* fmu, const char **error);
+__declspec(dllexport) FMIL_Variable *FMI2_CS_GET_VARIABLES(void* fmu, int *count, const char **error);
+__declspec(dllexport) FMIL_DeclaredType *FMI2_CS_GET_DECLARED_TYPES(void* fmu, int *count, const char **error);
+__declspec(dllexport) int FMI2_CS_INSTANTIATE(void* fmu, const char *instanceName, const char **error);
+__declspec(dllexport) int FMI2_CS_INITIALIZE(void* fmu, const char **error);
+__declspec(dllexport) int FMI2_CS_STEP(void* fmu, double masterTime, double stepSize, const char **error);
+__declspec(dllexport) int FMI2_CS_SET_REAL(void* fmu, int vr, double value, const char **error);
+__declspec(dllexport) double FMI2_CS_GET_REAL(void* fmu, int vr, const char **error);
+__declspec(dllexport) int FMI2_CS_GET_REALS(void* fmu, int *vrs, double *values, int count, const char **error);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
\ No newline at end of file