}
void
-mem_to_hex(char *dest, const byte *src, uns bytes, uns flags)
+mem_to_hex(char *dest, const byte *src, size_t bytes, uns flags)
{
uns sep = flags & 0xff;
}
const char *
-hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags)
+hex_to_mem(byte *dest, const char *src, size_t max_bytes, uns flags)
{
uns sep = flags & 0xff;
while (max_bytes-- && Cxdigit(src[0]) && Cxdigit(src[1]))
#include <ucw/string.h>
#ifdef CONFIG_DARWIN
-uns
-strnlen(const char *str, uns n)
+size_t
+strnlen(const char *str, size_t n)
{
const char *end = str + n;
const char *c;
return start;
}
-uns
+size_t
str_count_char(const char *str, uns chr)
{
const byte *s = str;
- uns i = 0;
+ size_t i = 0;
while (*s)
if (*s++ == chr)
i++;
/* string.c */
#ifdef CONFIG_DARWIN
-uns strnlen(const char *str, uns n); // NOAPI
+size_t strnlen(const char *str, size_t n); // NOAPI
#endif
/**
char *str_format_flags(char *dest, const char *fmt, uns flags);
/** Counts occurrences of @chr in @str. **/
-uns str_count_char(const char *str, uns chr);
+size_t str_count_char(const char *str, uns chr);
/* str-esc.c */
* not be separated), possibly OR-ed with `MEM_TO_HEX_UPCASE` when upper-case
* characters should be used.
**/
-void mem_to_hex(char *dest, const byte *src, uns bytes, uns flags);
+void mem_to_hex(char *dest, const byte *src, size_t bytes, uns flags);
/**
* An inverse function to @mem_to_hex(). Takes a hexdump of at most @max_bytes
* bytes and stores the bytes to a buffer starting at @dest. Returns a pointer
* at the first character after the dump.
**/
-const char *hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags);
+const char *hex_to_mem(byte *dest, const char *src, size_t max_bytes, uns flags);
// Bottom 8 bits of flags are an optional separator of bytes, the rest is:
#define MEM_TO_HEX_UPCASE 0x100