1 #!/usr/local/bin/rune -x
5 import "stdio" as self;
7 typedef const char *string_p;
10 main(int ac, char **av)
14 show("how are you doing", 1,
15 "oclock", 2UB, 3, 4, 5,
16 NULL, (const char *).NULL, a, 0);
17 show("should be: 1 oclock (unknown-int) 3 4 5 (vnull) (null) 4 0");
20 stdout->show("how are you doing ", 1,
21 "oclock ", 2UB, 3, 4, 5,
22 (const void *).NULL, (const char *).NULL, " ", a, 0);
23 show("should be: 1 oclock 2 3 4 5 ? (null) 4 0");
25 #show2("should be: 1 2 3", 1, 2, 3);
36 for (i = 0; i < self.__varcount; ++i) {
40 switch(typeof(self.__vardata[i])) {
43 int v = self.__vardata[i];
58 buf[--j] = (char)(vv % 10U) + '0';
64 fd.write(&buf[j], arysize(buf) - (size_t)j);
67 const char *str = self.__vardata[i];
69 fd.write("(null)", 6);
71 fd.write(str, Str.strlen(str));
74 const void *data = self.__vardata[i];
76 fd.write("(vnull)", 7);
78 fd.write("(not-null)", 10);
80 case typeof(SInteger):
84 fd.write("(unknown-int)", 13);
98 # stdout->format("show2: varcount %d\n", self.__varcount);
105 # stdout->format("show3: varcount %d\n", self.__varcount);