19int main(
int argc,
char **argv) {
24 "SDDS Example",
"example.sdds")) {
25 fprintf(stderr,
"Error initializing SDDS output.\n");
113 "shortParam", (
short)10,
114 "ushortParam", (
unsigned short)11,
115 "longParam", (int32_t)1000,
116 "ulongParam", (uint32_t)1001,
117 "long64Param", (int64_t)1002,
118 "ulong64Param", (uint64_t)1003,
119 "floatParam", (
float)3.14f,
120 "doubleParam", (
double)2.71828,
121 "longdoubleParam", (
long double)1.1L,
122 "stringParam",
"FirstPage",
134 int32_t dimension[1] = {3};
135 int32_t dimensionB[2] = {4, 2};
136 short shortArrayData[3] = {1, 2, 3};
137 unsigned short ushortArrayData[3] = {4, 5, 6};
138 int32_t longArrayData[3] = {1000, 2000, 3000};
139 uint32_t ulongArrayData[3] = {1001, 2001, 3001};
140 int64_t long64ArrayData[8] = {1002, 2002, 3002, 4002, 5002, 6002, 7002, 8002};
141 uint64_t ulong64ArrayData[8] = {1003, 2003, 3003, 4003, 5003, 6003, 7003, 8003};
142 float floatArrayData[8] = {1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f};
143 double doubleArrayData[8] = {1.2, 2.2, 3.2, 4.2, 5.2, 6.2, 7.2, 8.2};
144 long double longdoubleArrayData[8] = {1.3L, 2.3L, 3.3L, 4.3L, 5.3L, 6.3L, 7.3L, 8.3L};
145 char *stringArrayData[8] = {
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight"};
146 char charArrayData[8] = {
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H'};
150 !
SDDS_SetArray(&SDDS_table,
"shortArray", SDDS_CONTIGUOUS_DATA, shortArrayData, dimension) ||
151 !
SDDS_SetArray(&SDDS_table,
"ushortArray", SDDS_CONTIGUOUS_DATA, ushortArrayData, dimension) ||
152 !
SDDS_SetArray(&SDDS_table,
"longArray", SDDS_CONTIGUOUS_DATA, longArrayData, dimension) ||
153 !
SDDS_SetArray(&SDDS_table,
"ulongArray", SDDS_CONTIGUOUS_DATA, ulongArrayData, dimension) ||
154 !
SDDS_SetArray(&SDDS_table,
"long64Array", SDDS_CONTIGUOUS_DATA, long64ArrayData, dimensionB) ||
155 !
SDDS_SetArray(&SDDS_table,
"ulong64Array", SDDS_CONTIGUOUS_DATA, ulong64ArrayData, dimensionB) ||
156 !
SDDS_SetArray(&SDDS_table,
"floatArray", SDDS_CONTIGUOUS_DATA, floatArrayData, dimensionB) ||
157 !
SDDS_SetArray(&SDDS_table,
"doubleArray", SDDS_CONTIGUOUS_DATA, doubleArrayData, dimensionB) ||
158 !
SDDS_SetArray(&SDDS_table,
"longdoubleArray", SDDS_CONTIGUOUS_DATA, longdoubleArrayData, dimensionB) ||
159 !
SDDS_SetArray(&SDDS_table,
"stringArray", SDDS_CONTIGUOUS_DATA, stringArrayData, dimensionB) ||
160 !
SDDS_SetArray(&SDDS_table,
"charArray", SDDS_CONTIGUOUS_DATA, charArrayData, dimensionB)
172 short shortColData[5] = {1, 2, 3, 4, 5};
173 unsigned short ushortColData[5] = {1, 2, 3, 4, 5};
174 int32_t longColData[5] = {100, 200, 300, 400, 500};
175 uint32_t ulongColData[5] = {100, 200, 300, 400, 500};
176 int64_t long64ColData[5] = {100, 200, 300, 400, 500};
177 uint64_t ulong64ColData[5] = {100, 200, 300, 400, 500};
178 float floatColData[5] = {1.1f, 2.2f, 3.3f, 4.4f, 5.5f};
179 double doubleColData[5] = {10.01, 20.02, 30.03, 40.04, 50.05};
180 long double longdoubleColData[5] = {10.01L, 20.02L, 30.03L, 40.04L, 50.05L};
181 char *stringColData[5] = {
"one",
"two",
"three",
"four",
"five"};
182 char charColData[5] = {
'a',
'b',
'c',
'd',
'e'};
186 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, shortColData, rows,
"shortCol") ||
187 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ushortColData, rows,
"ushortCol") ||
188 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, longColData, rows,
"longCol") ||
189 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ulongColData, rows,
"ulongCol") ||
190 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, long64ColData, rows,
"long64Col") ||
191 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ulong64ColData, rows,
"ulong64Col") ||
192 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, floatColData, rows,
"floatCol") ||
193 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, doubleColData, rows,
"doubleCol") ||
194 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, longdoubleColData, rows,
"longdoubleCol") ||
195 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, stringColData, rows,
"stringCol") ||
196 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, charColData, rows,
"charCol")
218 "shortParam", (
short)20,
219 "ushortParam", (
unsigned short)21,
220 "longParam", (int32_t)2000,
221 "ulongParam", (uint32_t)2001,
222 "long64Param", (int64_t)2002,
223 "ulong64Param", (uint64_t)2003,
224 "floatParam", (
float)6.28f,
225 "doubleParam", (
double)1.41421,
226 "longdoubleParam", (
long double)2.2L,
227 "stringParam",
"SecondPage",
240 short shortArrayData2[2] = {7, 8};
241 unsigned short ushortArrayData2[2] = {9, 10};
242 int32_t longArrayData2[2] = {4000, 5000};
243 uint32_t ulongArrayData2[2] = {4001, 5001};
244 int64_t long64ArrayData2[4] = {4002, 5002, 6002, 7002};
245 uint64_t ulong64ArrayData2[4] = {4003, 5003, 6003, 7003};
246 float floatArrayData2[4] = {11.11f, 22.22f, 33.33f, 44.44f};
247 double doubleArrayData2[4] = {33.33, 44.44, 55.55, 66.66};
248 long double longdoubleArrayData2[4] = {55.55L, 66.66L, 77.77L, 88.88L};
249 char *stringArrayData2[4] = {
"blue",
"red",
"yellow",
"gold"};
250 char charArrayData2[4] = {
'W',
'X',
'Y',
'Z'};
254 !
SDDS_SetArray(&SDDS_table,
"shortArray", SDDS_CONTIGUOUS_DATA, shortArrayData2, dimension) ||
255 !
SDDS_SetArray(&SDDS_table,
"ushortArray", SDDS_CONTIGUOUS_DATA, ushortArrayData2, dimension) ||
256 !
SDDS_SetArray(&SDDS_table,
"longArray", SDDS_CONTIGUOUS_DATA, longArrayData2, dimension) ||
257 !
SDDS_SetArray(&SDDS_table,
"ulongArray", SDDS_CONTIGUOUS_DATA, ulongArrayData2, dimension) ||
258 !
SDDS_SetArray(&SDDS_table,
"long64Array", SDDS_CONTIGUOUS_DATA, long64ArrayData2, dimensionB) ||
259 !
SDDS_SetArray(&SDDS_table,
"ulong64Array", SDDS_CONTIGUOUS_DATA, ulong64ArrayData2, dimensionB) ||
260 !
SDDS_SetArray(&SDDS_table,
"floatArray", SDDS_CONTIGUOUS_DATA, floatArrayData2, dimensionB) ||
261 !
SDDS_SetArray(&SDDS_table,
"doubleArray", SDDS_CONTIGUOUS_DATA, doubleArrayData2, dimensionB) ||
262 !
SDDS_SetArray(&SDDS_table,
"longdoubleArray", SDDS_CONTIGUOUS_DATA, longdoubleArrayData2, dimensionB) ||
263 !
SDDS_SetArray(&SDDS_table,
"stringArray", SDDS_CONTIGUOUS_DATA, stringArrayData2, dimensionB) ||
264 !
SDDS_SetArray(&SDDS_table,
"charArray", SDDS_CONTIGUOUS_DATA, charArrayData2, dimensionB)
274 short shortColData2[3] = {6, 7, 8};
275 unsigned short ushortColData2[3] = {6, 7, 8};
276 int32_t longColData2[3] = {600, 700, 800};
277 uint32_t ulongColData2[3] = {600, 700, 800};
278 int64_t long64ColData2[3] = {600, 700, 800};
279 uint64_t ulong64ColData2[3] = {600, 700, 800};
280 float floatColData2[3] = {6.6f, 7.7f, 8.8f};
281 double doubleColData2[3] = {60.06, 70.07, 80.08};
282 long double longdoubleColData2[3] = {60.06L, 70.07L, 80.08L};
283 char *stringColData2[3] = {
"six",
"seven",
"eight"};
284 char charColData2[3] = {
'f',
'g',
'h'};
288 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, shortColData2, rows,
"shortCol") ||
289 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ushortColData2, rows,
"ushortCol") ||
290 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, longColData2, rows,
"longCol") ||
291 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ulongColData2, rows,
"ulongCol") ||
292 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, long64ColData2, rows,
"long64Col") ||
293 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, ulong64ColData2, rows,
"ulong64Col") ||
294 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, floatColData2, rows,
"floatCol") ||
295 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, doubleColData2, rows,
"doubleCol") ||
296 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, longdoubleColData2, rows,
"longdoubleCol") ||
297 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, stringColData2, rows,
"stringCol") ||
298 !
SDDS_SetColumn(&SDDS_table, SDDS_SET_BY_NAME, charColData2, rows,
"charCol")