drop the old string API fully.
[apps/madmutt.git] / lib / str.c
diff --git a/lib/str.c b/lib/str.c
deleted file mode 100644 (file)
index 3d3f10e..0000000
--- a/lib/str.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright notice from original mutt:
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include <lib-lib/mem.h>
-#include <lib-lib/str.h>
-
-#include "str.h"
-
-/* convert all characters in the string to lowercase */
-char *str_tolower (char *s)
-{
-  char *p = s;
-
-  while (*p) {
-    *p = tolower ((unsigned char) *p);
-    p++;
-  }
-
-  return (s);
-}
-
-/* NULL-pointer aware string comparison functions */
-
-char *str_substrcpy (char *dest, const char *beg, const char *end,
-                      size_t destlen)
-{
-  size_t len;
-
-  len = end - beg;
-  if (len > destlen - 1)
-    len = destlen - 1;
-  memcpy (dest, beg, len);
-  dest[len] = 0;
-  return dest;
-}
-
-char *str_substrdup(const char *begin, const char *end)
-{
-    return p_dupstr(begin, (end ? end - begin : strlen(begin)));
-}
-
-const char *str_isstr (const char *haystack, const char *needle)
-{
-  const char *p, *q;
-
-  if (!haystack)
-    return NULL;
-  if (!needle)
-    return (haystack);
-
-  while (*(p = haystack)) {
-    for (q = needle;
-         *p && *q &&
-         tolower ((unsigned char) *p) == tolower ((unsigned char) *q);
-         p++, q++);
-    if (!*q)
-      return (haystack);
-    haystack++;
-  }
-  return NULL;
-}
-
-int str_eq (const char* s1, const char* s2) {
-  int l = m_strlen(s1);
-
-  if (l != m_strlen(s2))
-    return (0);
-  return (m_strncmp(s1, s2, l) == 0);
-}
-
-void str_skip_trailws (char *s) {
-  char *p;
-
-  for (p = s + m_strlen(s) - 1; p >= s && ISSPACE (*p); p--)
-    *p = 0;
-}