exit strfcpy, only use m_strcpy.
[apps/madmutt.git] / lib-lib / str.h
index 8850830..e319f2a 100644 (file)
 
 #define NONULL(x) (x?x:"")
 
+static inline int m_strisempty(const char *s) {
+    return !s || !*s;
+}
+
 static inline ssize_t m_strlen(const char *s) {
     return s ? strlen(s) : 0;
 }
@@ -45,6 +49,18 @@ static inline int m_strcmp(const char *a, const char *b) {
     return strcmp(NONULL(a), NONULL(b));
 }
 
+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) {
+    return strncmp (NONULL(a), NONULL(b), n);
+}
+
+static inline int m_strncasecmp(const char *a, const char *b, size_t n) {
+    return strncasecmp(NONULL(a), NONULL(b), n);
+}
+
 
 ssize_t m_strcpy(char *dst, ssize_t n, const char *src);
 ssize_t m_strncpy(char *dst, ssize_t n, const char *src, ssize_t l);