]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/unicode.h
Mapping of whole files: Converted to size_t.
[libucw.git] / ucw / unicode.h
index 8d8fc46e9bc7c9a26c925a81c51e7df67194be1d..c9d6a0c1cde12477e1e88b0f0601272d179d1122 100644 (file)
 
 #include <ucw/unaligned.h>
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define utf8_strlen ucw_utf8_strlen
+#define utf8_strnlen ucw_utf8_strnlen
+#endif
+
 /* Macros for handling UTF-8 */
 
 #define UNI_REPLACEMENT 0xfffc /** Unicode value used as a default replacement of invalid characters. **/
@@ -168,7 +173,7 @@ get1: UTF8_GET_NEXT;
 }
 
 /**
- * Decode a value from the range `[0, 0xFFFF]` (basic multilignual plane)
+ * Decode a value from the range `[0, 0xFFFF]` (basic multilingual plane)
  * or return `UNI_REPLACEMENT` if the encoding has been corrupted.
  **/
 static inline byte *utf8_get(const byte *p, uns *uu)
@@ -352,11 +357,11 @@ static inline uns unicode_sanitize_char(uns u)
  * Count the number of Unicode characters in a zero-terminated UTF-8 string.
  * Returned value for corrupted encoding is undefined, but is never greater than strlen().
  **/
-uns utf8_strlen(const byte *str);
+size_t utf8_strlen(const byte *str);
 
 /**
  * Same as @utf8_strlen(), but returns at most @n characters.
  **/
-uns utf8_strnlen(const byte *str, uns n);
+size_t utf8_strnlen(const byte *str, size_t n);
 
 #endif