2 #include "lib/stkstring.h"
7 stk_array_len(char **s, uns cnt)
16 stk_array_join(char *x, char **s, uns cnt, uns sep)
31 stk_printf_internal(const char *fmt, ...)
34 char *buf = alloca(len);
40 int l = vsnprintf(buf, len, fmt, args2);
54 stk_vprintf_internal(const char *fmt, va_list args)
57 char *buf = alloca(len);
62 int l = vsnprintf(buf, len, fmt, args2);
76 stk_hexdump_internal(char *dst, const byte *src, uns n)
78 for (uns i=0; i<n; i++)
82 dst += sprintf(dst, "%02x", *src++);
91 char *a = stk_strndup("are!",3);
92 a = stk_strcat(a, " the ");
93 a = stk_strmulticat(a, stk_strdup("Jabberwock, "), "my", NULL);
94 char *arr[] = { a, " son" };
95 a = stk_strarraycat(arr, 2);
96 a = stk_printf("Bew%s!", a);
98 puts(stk_hexdump(a, 3));
99 char *ary[] = { "The", "jaws", "that", "bite" };
100 puts(stk_strjoin(ary, 4, ' '));