5
#ifndef _CSTRING_UNIMPL
7
%cwstring_input_binary(wchar_t *in, int n);
8
%cwstring_bounded_output(wchar_t *out1, 512);
9
%cwstring_chunk_output(wchar_t *out2, 64);
10
%cwstring_bounded_mutable(wchar_t *out3, 512);
11
%cwstring_mutable(wchar_t *out4, 32);
12
%cwstring_output_maxsize(wchar_t *out5, int max);
13
%cwstring_output_withsize(wchar_t *out6, int *size);
16
%cwstring_output_allocate(wchar_t **out7, delete [] *$1);
17
%cwstring_output_allocate_size(wchar_t **out8, int *size, delete [] *$1);
19
%cwstring_output_allocate(wchar_t **out7, free(*$1));
20
%cwstring_output_allocate_size(wchar_t **out8, int *size, free(*$1));
25
int count(wchar_t *in, int n, wchar_t c) {
37
void test1(wchar_t *out1) {
38
wcscpy(out1,L"Hello World");
41
void test2(wchar_t *out2) {
43
for (i = 0; i < 64; i++) {
44
*out2 = (wchar_t) i + 32;
49
void test3(wchar_t *out3) {
50
wcscat(out3,L"-suffix");
53
void test4(wchar_t *out4) {
54
wcscat(out4,L"-suffix");
57
void test5(wchar_t *out5, int max) {
59
for (i = 0; i < max; i++) {
65
void test6(wchar_t *out6, int *size) {
67
for (i = 0; i < (*size/2); i++) {
73
void test7(wchar_t **out7) {
75
*out7 = new wchar_t[64];
77
*out7 = malloc(64*sizeof(wchar_t));
80
wcscat(*out7,L"Hello world!");
83
void test8(wchar_t **out8, int *size) {
86
*out8 = new wchar_t[64];
88
*out8 = malloc(64*sizeof(wchar_t));
90
for (i = 0; i < 64; i++) {
91
(*out8)[i] = (wchar_t) i + 32;