X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lib%2Futf8.h;h=72bf7043027e1a639fce46931bfed2ee292171f1;hp=2f1e0da39e76c8e8c3b05211a0903f30bd09ccef;hb=11ebd35cdf53f877efb11ed1ce9ccb771d2a091c;hpb=c2ac9f23deba034e50cd3babc843d589d0b62d1b diff --git a/lib-lib/utf8.h b/lib-lib/utf8.h index 2f1e0da..72bf704 100644 --- a/lib-lib/utf8.h +++ b/lib-lib/utf8.h @@ -23,6 +23,22 @@ /** \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 */