]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/Import/src/FMI2/fmi2_import_type.c
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / Import / src / FMI2 / fmi2_import_type.c
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
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.
11
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>.
14 */
15
16 #include <limits.h>
17 #include <float.h>
18 #include <string.h>
19
20 #include "fmi2_import_impl.h"
21
22 fmi2_import_display_unit_t* fmi2_import_get_type_display_unit(fmi2_import_real_typedef_t* t) {
23         return fmi2_xml_get_type_display_unit(t);
24 }
25
26 unsigned int fmi2_import_get_type_definition_number(fmi2_import_type_definitions_t* td) {
27         return fmi2_xml_get_type_definition_number(td);
28 }
29
30 fmi2_import_variable_typedef_t* fmi2_import_get_typedef(fmi2_import_type_definitions_t* td, unsigned int  index) {
31         return fmi2_xml_get_typedef(td, index);
32 }
33
34 const char* fmi2_import_get_type_name(fmi2_import_variable_typedef_t* t) {   
35         return fmi2_xml_get_type_name(t);
36 }
37
38 /* Note that NULL pointer is returned if the attribute is not present in the XML.*/
39 const char* fmi2_import_get_type_description(fmi2_import_variable_typedef_t* t) {
40         return fmi2_xml_get_type_description(t);
41 }
42
43 fmi2_base_type_enu_t fmi2_import_get_base_type(fmi2_import_variable_typedef_t* t) {
44         return fmi2_xml_get_base_type(t);
45 }
46
47 fmi2_import_real_typedef_t* fmi2_import_get_type_as_real(fmi2_import_variable_typedef_t* t) {
48         return fmi2_xml_get_type_as_real(t);
49 }
50
51 fmi2_import_integer_typedef_t* fmi2_import_get_type_as_int(fmi2_import_variable_typedef_t* t) {
52         return fmi2_xml_get_type_as_int(t);
53 }
54
55 fmi2_import_enumeration_typedef_t* fmi2_import_get_type_as_enum(fmi2_import_variable_typedef_t* t) {
56         return fmi2_xml_get_type_as_enum(t);
57 }
58
59 /* Note that 0-pointer is returned for strings and booleans, empty string quantity if not defined*/
60 const char* fmi2_import_get_type_quantity(fmi2_import_variable_typedef_t* t) {
61         return fmi2_xml_get_type_quantity(t);
62 }
63
64 fmi2_real_t fmi2_import_get_real_type_min(fmi2_import_real_typedef_t* t) {
65         return fmi2_xml_get_real_type_min(t);
66 }
67
68 fmi2_real_t fmi2_import_get_real_type_max(fmi2_import_real_typedef_t* t) {
69         return fmi2_xml_get_real_type_max(t);
70 }
71
72 fmi2_real_t fmi2_import_get_real_type_nominal(fmi2_import_real_typedef_t* t) {
73         return fmi2_xml_get_real_type_nominal(t);
74 }
75
76 fmi2_import_unit_t* fmi2_import_get_real_type_unit(fmi2_import_real_typedef_t* t) {    
77         return fmi2_xml_get_real_type_unit(t);
78 }
79
80 int fmi2_import_get_real_type_is_relative_quantity(fmi2_import_real_typedef_t* t) {
81         return fmi2_xml_get_real_type_is_relative_quantity(t);
82 }
83
84 int fmi2_import_get_real_type_is_unbounded(fmi2_import_real_typedef_t* t) {
85         return fmi2_xml_get_real_type_is_unbounded(t);
86 }
87
88 fmi2_integer_t fmi2_import_get_integer_type_min(fmi2_import_integer_typedef_t* t) {
89         return fmi2_xml_get_integer_type_min(t);
90 }
91
92 fmi2_integer_t fmi2_import_get_integer_type_max(fmi2_import_integer_typedef_t* t){
93         return fmi2_xml_get_integer_type_max(t);
94 }
95
96 unsigned int fmi2_import_get_enum_type_min(fmi2_import_enumeration_typedef_t* t){
97         return fmi2_xml_get_enum_type_min(t);
98 }
99
100  unsigned int fmi2_import_get_enum_type_max(fmi2_import_enumeration_typedef_t* t){
101         return fmi2_xml_get_enum_type_max(t);
102 }
103
104 unsigned int  fmi2_import_get_enum_type_size(fmi2_import_enumeration_typedef_t* t) {
105         return fmi2_xml_get_enum_type_size(t);
106 }
107
108 const char* fmi2_import_get_enum_type_item_name(fmi2_import_enumeration_typedef_t* t, unsigned int  item) {
109         return fmi2_xml_get_enum_type_item_name(t, item);
110 }
111
112 const char* fmi2_import_get_enum_type_item_description(fmi2_import_enumeration_typedef_t* t, unsigned int  item){
113         return fmi2_xml_get_enum_type_item_description(t, item);
114 }
115
116 int fmi2_import_get_enum_type_item_value(fmi2_import_enumeration_typedef_t* t, unsigned int  item) {
117         return fmi2_xml_get_enum_type_item_value(t, item);
118 }
119
120 const char* fmi2_import_get_enum_type_value_name(fmi2_import_enumeration_typedef_t* t, int value) {
121         return fmi2_xml_get_enum_type_value_name(t, value);
122 }
123