]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/Import/src/FMI1/fmi1_import_type.c
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / Import / src / FMI1 / fmi1_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 "fmi1_import_impl.h"
21
22 fmi1_import_display_unit_t* fmi1_import_get_type_display_unit(fmi1_import_real_typedef_t* t) {
23         return fmi1_xml_get_type_display_unit(t);
24 }
25
26 size_t fmi1_import_get_type_definition_number(fmi1_import_type_definitions_t* td) {
27         return fmi1_xml_get_type_definition_number(td);
28 }
29
30 fmi1_import_variable_typedef_t* fmi1_import_get_typedef(fmi1_import_type_definitions_t* td, unsigned int  index) {
31         return fmi1_xml_get_typedef(td, index);
32 }
33
34 const char* fmi1_import_get_type_name(fmi1_import_variable_typedef_t* t) {   
35         return fmi1_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* fmi1_import_get_type_description(fmi1_import_variable_typedef_t* t) {
40         return fmi1_xml_get_type_description(t);
41 }
42
43 fmi1_base_type_enu_t fmi1_import_get_base_type(fmi1_import_variable_typedef_t* t) {
44         return fmi1_xml_get_base_type(t);
45 }
46
47 fmi1_import_real_typedef_t* fmi1_import_get_type_as_real(fmi1_import_variable_typedef_t* t) {
48         return fmi1_xml_get_type_as_real(t);
49 }
50
51 fmi1_import_integer_typedef_t* fmi1_import_get_type_as_int(fmi1_import_variable_typedef_t* t) {
52         return fmi1_xml_get_type_as_int(t);
53 }
54
55 fmi1_import_enumeration_typedef_t* fmi1_import_get_type_as_enum(fmi1_import_variable_typedef_t* t) {
56         return fmi1_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* fmi1_import_get_type_quantity(fmi1_import_variable_typedef_t* t) {
61         return fmi1_xml_get_type_quantity(t);
62 }
63
64 fmi1_real_t fmi1_import_get_real_type_min(fmi1_import_real_typedef_t* t) {
65         return fmi1_xml_get_real_type_min(t);
66 }
67
68 fmi1_real_t fmi1_import_get_real_type_max(fmi1_import_real_typedef_t* t) {
69         return fmi1_xml_get_real_type_max(t);
70 }
71
72 fmi1_real_t fmi1_import_get_real_type_nominal(fmi1_import_real_typedef_t* t) {
73         return fmi1_xml_get_real_type_nominal(t);
74 }
75
76 fmi1_import_unit_t* fmi1_import_get_real_type_unit(fmi1_import_real_typedef_t* t) {    
77         return fmi1_xml_get_real_type_unit(t);
78 }
79
80 int fmi1_import_get_real_type_is_relative_quantity(fmi1_import_real_typedef_t* t) {
81         return fmi1_xml_get_real_type_is_relative_quantity(t);
82 }
83
84 fmi1_integer_t fmi1_import_get_integer_type_min(fmi1_import_integer_typedef_t* t) {
85         return fmi1_xml_get_integer_type_min(t);
86 }
87
88 fmi1_integer_t fmi1_import_get_integer_type_max(fmi1_import_integer_typedef_t* t){
89         return fmi1_xml_get_integer_type_max(t);
90 }
91
92 unsigned int fmi1_import_get_enum_type_min(fmi1_import_enumeration_typedef_t* t){
93         return fmi1_xml_get_enum_type_min(t);
94 }
95
96  unsigned int fmi1_import_get_enum_type_max(fmi1_import_enumeration_typedef_t* t){
97         return fmi1_xml_get_enum_type_max(t);
98 }
99
100 unsigned int  fmi1_import_get_enum_type_size(fmi1_import_enumeration_typedef_t* t) {
101         return fmi1_xml_get_enum_type_size(t);
102 }
103
104 const char* fmi1_import_get_enum_type_item_name(fmi1_import_enumeration_typedef_t* t, unsigned int  item) {
105         return fmi1_xml_get_enum_type_item_name(t, item);
106 }
107
108 const char* fmi1_import_get_enum_type_item_description(fmi1_import_enumeration_typedef_t* t, unsigned int  item){
109         return fmi1_xml_get_enum_type_item_description(t, item);
110 }