summaryrefslogtreecommitdiff
path: root/support/dktools/test-mbstr.c
blob: dd47c626adf0740fa4bf60af5974cfc5e3cfca48 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
	WARNING: This file was generated by dkct.
	Changes you make here will be lost if dkct is run again!
	You should modify the original source and run dkct on it.
	Original source: test-mbstr.ctr
*/

/**	@file test-mbstr.c The test-mbstr module.
*/


#line 1 "test-mbstr.ctr"

#include "dk4conf.h"
#include "dk4strm.h"
#include "dk4membuf.h"
#include "dk4mbstrm.h"


static const char test[] = { "0123456789ABCDEF" };

int main(int argc, char *argv[])
{
	dk4_membuf_t	*mb		= NULL;
	dk4_stream_t	*strm	= NULL;
	size_t			 i;

	mb = dk4membuf_open(NULL);
	if (NULL != mb) {
		strm = dk4stream_open_membuf_writer(mb, NULL);
		if (NULL != strm) {
			for (i = 0; i < 1024; i++) {
				dk4stream_write(strm, test, 16, NULL);
			}
			if (dk4membuf_size(&i, mb, NULL)) {
				printf("Bytes: %lu\n", (unsigned long)i);
			}
			dk4stream_close(strm, NULL);
		}
		else {
		}
		dk4membuf_close(mb);
	}
	else {
	}

	return 0;
}

/* vim: set ai sw=4 ts=4 : */