X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-lib%2Fstr.h;h=c9c8c90eaa0714770b6db39831cffee4b49b12ff;hb=1ee89902de184a640c171ae3285bff6882a791bd;hp=bb2d822d63feec2a33c0d3301556373024ffc942;hpb=93b012884de4ca5e1f2550f767d0b8680b9c0e9f;p=apps%2Fmadmutt.git diff --git a/lib-lib/str.h b/lib-lib/str.h index bb2d822..c9c8c90 100644 --- a/lib-lib/str.h +++ b/lib-lib/str.h @@ -20,11 +20,6 @@ #ifndef MUTT_LIB_LIB_STR_H #define MUTT_LIB_LIB_STR_H -#include -#include - -#include "mem.h" - #define HUGE_STRING 5120 #define LONG_STRING 1024 #define STRING 256 @@ -86,11 +81,11 @@ static inline int m_strcasecmp(const char *a, const char *b) { return strcasecmp(NONULL(a), NONULL(b)); } -static inline int m_strncmp(const char *a, const char *b, size_t n) { +static inline int m_strncmp(const char *a, const char *b, ssize_t n) { return strncmp (NONULL(a), NONULL(b), n); } -static inline int m_strncasecmp(const char *a, const char *b, size_t n) { +static inline int m_strncasecmp(const char *a, const char *b, ssize_t n) { return strncasecmp(NONULL(a), NONULL(b), n); } @@ -130,6 +125,18 @@ m_strncat(char *dst, ssize_t n, const char *src, ssize_t l) { /* parsing related */ /****************************************************************************/ +static inline const char *m_strchrnul(const char *s, int c) { + while (*s && *s != c) + s++; + return s; +} + +static inline const char *m_strnextsp(const char *s) { + while (*s && !isspace((unsigned char)*s)) + s++; + return s; +} + static inline const char *skipspaces(const char *s) { while (*s && isspace((unsigned char)*s)) s++;