scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <assert.h>
 2#include <stdio.h>
 3#include <wchar.h>
 4
 5/*
 6output:
 7testing
 8done
 9end:
10*/
11
12int
13main()
14{
15	wchar_t buf[30];
16	wchar_t def[] = {'d', 'e', 'f', '\0'};
17	wchar_t abc[] = {'a', 'b', 'c', '\0'};
18	wchar_t abcdef[]  = {'a', 'b', 'c', 'd', 'e', 'f', '\0'};
19
20	puts("testing");
21
22	wmemcpy(buf, abcdef, 6);
23	assert(!wmemcmp(wmemmove(buf, buf+3, 3), def, 3));
24	wmemcpy(buf, abcdef, 6);
25	assert(!wmemcmp(wmemmove(buf, buf+3, 0), abc, 3));
26
27	puts("done");
28
29	return 0;
30}