More string and buffer functions.
[apps/madmutt.git] / lib-lib / utf8.h
index 2f1e0da..72bf704 100644 (file)
 /** \addtogroup mutt_strings */
 /*@{*/
 
+int m_ustrlen(const char *s);
+int m_ustrgetc(const char *s, const char **outp);
+int m_ustrputc(char *dst, ssize_t n, int c);
+
+static inline char *m_vustrskipc(char *s) {
+    if (*s++ & 0x80) {
+        while ((*s & 0xc0) == 0x80)
+            s++;
+    }
+    return s;
+}
+
+static inline const char *m_ustrskipc(const char *s) {
+    return m_vustrskipc((char *)s);
+}
+
 
 /*@}*/
 #endif /* MUTT_LIB_LIB_UTF8_H */