1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include "dk4conf.h"
#include <math.h>
#include "dk4strm.h"
#include "dk4strmw.h"
#include "dk4strms.h"
static const char t1[] = { "Dies ist ein Test-String." };
int main(void)
{
dk4_stream_t *wrstr;
wrstr = dk4stream_open_file_writer("/tmp/test.dat.gz", NULL);
if (NULL != wrstr) {
dk4stream_serialize_u32(wrstr, 25UL, NULL);
dk4stream_serialize_i32(wrstr, -16L, NULL);
dk4stream_serialize_string(wrstr, t1, NULL);
dk4stream_serialize_u16(wrstr, 50U, NULL);
dk4stream_serialize_double(wrstr, M_PI, 1.0e-6, NULL);
dk4stream_serialize_i16(wrstr, -32, NULL);
dk4stream_serialize_double_0(wrstr, NULL);
dk4stream_serialize_u8(wrstr, 100, NULL);
dk4stream_serialize_i8(wrstr, -64, NULL);
dk4stream_close(wrstr, NULL);
}
else {
}
return 0;
}
/* vim: set ai sw=4 ts=4 : */
|