X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fstkstring.c;h=d3c6d554af7b7657a3cc06ca3697d963dbe0e0e9;hb=6c4c397f94ec5f5df6bcc178fb5fa4e84d3505fc;hp=e501ba20fabe4d47f04e892d47a2d7b4c45e0214;hpb=733046c9a1a6ccc33617d73238c3c8f4865b34a4;p=libucw.git diff --git a/ucw/stkstring.c b/ucw/stkstring.c index e501ba20..d3c6d554 100644 --- a/ucw/stkstring.c +++ b/ucw/stkstring.c @@ -9,38 +9,27 @@ * of the GNU Lesser General Public License. */ -#include "ucw/lib.h" -#include "ucw/stkstring.h" -#include "ucw/string.h" +#include +#include +#include #include -#ifdef CONFIG_DARWIN -uns -strnlen(const char *str, uns n) +uint +stk_array_len(char **s, uint cnt) { - const char *end = str + n; - const char *c; - for (c = str; *c && c < end; c++); - return c - str; -} -#endif - -uns -stk_array_len(char **s, uns cnt) -{ - uns l = 1; + uint l = 1; while (cnt--) l += strlen(*s++); return l; } void -stk_array_join(char *x, char **s, uns cnt, uns sep) +stk_array_join(char *x, char **s, uint cnt, uint sep) { while (cnt--) { - uns l = strlen(*s); + uint l = strlen(*s); memcpy(x, *s, l); x += l; s++; @@ -50,10 +39,10 @@ stk_array_join(char *x, char **s, uns cnt, uns sep) *x = 0; } -uns +uint stk_printf_internal(const char *fmt, ...) { - uns len = 256; + uint len = 256; char *buf = alloca(len); va_list args, args2; va_start(args, fmt); @@ -73,10 +62,10 @@ stk_printf_internal(const char *fmt, ...) } } -uns +uint stk_vprintf_internal(const char *fmt, va_list args) { - uns len = 256; + uint len = 256; char *buf = alloca(len); va_list args2; for (;;) @@ -96,7 +85,7 @@ stk_vprintf_internal(const char *fmt, va_list args) } void -stk_hexdump_internal(char *dst, const byte *src, uns n) +stk_hexdump_internal(char *dst, const byte *src, uint n) { mem_to_hex(dst, src, n, ' '); }