1+ #ifndef MODELICAHDF5FUNCTIONS_H_
2+ #define MODELICAHDF5FUNCTIONS_H_
3+
4+ #ifndef MODELICA_SDF_API
5+
6+ #ifdef _WIN32
7+ #define MODELICA_SDF_API __declspec(dllexport)
8+ #else
9+ #define MODELICA_SDF_API
10+ #endif
11+
12+ #endif
13+
14+
15+ #ifdef __cplusplus
16+ extern "C" {
17+ #endif
18+
19+ void read_dsres (const char * filename , const int ndatasets , const char * * dataset_names , const char * * dataset_units , const char * scale_unit , int nsamples , double * data );
20+
21+ void get_time_series_size_dsres (const char * filename , const char * * dataset_names , int * size );
22+
23+ //extern char *error_message;
24+
25+ #define MAX_MESSAGE_LENGTH 4096
26+
27+ extern char error_message [MAX_MESSAGE_LENGTH ];
28+
29+ void set_error_message (const char * msg , ...);
30+
31+
32+ MODELICA_SDF_API const char * ModelicaSDF_get_table_data_size (const char * filename , const char * dataset_name , int * size );
33+
34+ MODELICA_SDF_API const char * ModelicaSDF_read_table_data (const char * filename , const char * dataset_name , const int ndims , const char * unit , const char * * scale_units , double * data );
35+
36+
37+ MODELICA_SDF_API const char * ModelicaSDF_get_time_series_size (const char * filename , const char * * dataset_names , int * size );
38+
39+ MODELICA_SDF_API const char * ModelicaSDF_read_time_series (const char * filename , const int ndatasets , const char * * dataset_names , const char * * dataset_units , const char * scale_unit , int nsamples , double * data );
40+
41+
42+ MODELICA_SDF_API const char * ModelicaSDF_create_group (const char * filename , const char * group_name , const char * comment );
43+
44+ /*! Retrieves the dimensions of a dataset
45+ *
46+ * @param [in] filename the file name
47+ * @param [in] dataset_name the dataset name
48+ * @param [out] dims an int[32] for the dimensions
49+ *
50+ * @return the error message ("" on success)
51+ */
52+ MODELICA_SDF_API const char * ModelicaSDF_get_dataset_dims (const char * filename , const char * dataset_name , int dims []);
53+
54+ /*! Reads the values of a double dataset
55+ *
56+ * @param [in] filename the file name
57+ * @param [in] dataset_name the dataset name
58+ * @param [in] unit the expected unit
59+ * @param [out] buffer a buffer for the values
60+ *
61+ * @return the error message ("" on success)
62+ */
63+ MODELICA_SDF_API const char * ModelicaSDF_read_dataset_double (const char * filename , const char * dataset_name , const char * unit , double * buffer );
64+
65+ /*! Reads the values of a integer dataset
66+ *
67+ * @param [in] filename the file name
68+ * @param [in] dataset_name the dataset name
69+ * @param [in] unit the expected unit
70+ * @param [out] buffer a buffer for the values
71+ *
72+ * @return the error message ("" on success)
73+ */
74+ MODELICA_SDF_API const char * ModelicaSDF_read_dataset_int (const char * filename , const char * dataset_name , const char * unit , int * buffer );
75+
76+ /*! Writes a double dataset with unit and comment
77+ *
78+ * @param [in] filename the file name
79+ * @param [in] dataset_name the dataset name
80+ * @param [in] ndims the number of dimensions
81+ * @param [in] dims the dimensions
82+ * @param [in] data a buffer for the values
83+ * @param [in] relative_quantity absolute if 0, otherwise relative
84+ * @param [in] unit the unit (optional)
85+ * @param [in] display_unit the display unit (optional)
86+ * @param [in] comment the comment (optional)
87+ *
88+ * @return the error message ("" on success)
89+ */
90+ MODELICA_SDF_API const char * ModelicaSDF_make_dataset_double (
91+ const char * filename ,
92+ const char * dataset_name ,
93+ int ndims ,
94+ const int dims [],
95+ const double * data ,
96+ const char * comment ,
97+ const char * display_name ,
98+ const char * unit ,
99+ const char * display_unit ,
100+ int relative_quantity );
101+
102+ /*! Writes an integer dataset with unit and comment
103+ *
104+ * @param [in] filename the file name
105+ * @param [in] dataset_name the dataset name
106+ * @param [in] ndims the number of dimensions
107+ * @param [in] dims the dimensions
108+ * @param [in] data a buffer for the values
109+ * @param [in] relative_quantity absolute if 0, otherwise relative
110+ * @param [in] unit the unit (optional)
111+ * @param [in] display_unit the display unit (optional)
112+ * @param [in] comment the comment (optional)
113+ *
114+ * @return the error message ("" on success)
115+ */
116+ MODELICA_SDF_API const char * ModelicaSDF_make_dataset_int (
117+ const char * filename ,
118+ const char * dataset_name ,
119+ int ndims ,
120+ const int dims [],
121+ const int * data ,
122+ const char * comment ,
123+ const char * display_name ,
124+ const char * unit ,
125+ const char * display_unit ,
126+ int relative_quantity );
127+
128+ /*! Sets a dataset as the scale for the dimension of another dataset
129+ *
130+ * @param [in] filename the file name
131+ * @param [in] dataset_name the name of the dataset
132+ * @param [in] scale_name the name of the scale dataset
133+ * @param [in] dim_name the name of the dimension
134+ * @param [in] dim the index of the dimension
135+ *
136+ * @return the error message ("" on success)
137+ */
138+ MODELICA_SDF_API const char * ModelicaSDF_attach_scale (const char * filename , const char * dataset_name , const char * scale_name , const char * dim_name , int dim );
139+
140+ /*! Gets the length of a string attribute's value
141+ *
142+ * @param [in] filename the file name
143+ * @param [in] dataset_name the name of the dataset
144+ * @param [in] attr_name the name of the attribute
145+ * @param [out] size the length of the string attribute's value
146+ *
147+ * @return the error message ("" on success)
148+ */
149+ MODELICA_SDF_API const char * ModelicaSDF_get_attribute_string_length (const char * filename , const char * dataset_name , const char * attr_name , int * size );
150+
151+ /*! Gets the value of a string attribute of a dataset
152+ *
153+ * @param [in] filename the file name
154+ * @param [in] dataset_name the name of the dataset
155+ * @param [in] attr_name the name of the attribute
156+ * @param [out] data the value of the attribute
157+ *
158+ * @return the error message ("" on success)
159+ */
160+ MODELICA_SDF_API const char * ModelicaSDF_get_attribute_string (const char * filename , const char * dataset_name , const char * attr_name , char * * data );
161+
162+ /*! Sets the value of a string attribute of a dataset
163+ *
164+ * @param [in] filename the file name
165+ * @param [in] dataset_name the name of the dataset
166+ * @param [in] attr_name the name of the attribute
167+ * @param [in] data the value of the attribute
168+ *
169+ * @return the error message ("" on success)
170+ */
171+ MODELICA_SDF_API const char * ModelicaSDF_set_attribute_string (const char * filename , const char * dataset_name , const char * attr_name , const char * data );
172+
173+
174+ #ifdef __cplusplus
175+ }
176+ #endif
177+
178+ #endif /*MODELICAHDF5FUNCTIONS_H_*/
0 commit comments