]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/string.c
strtonum: Added small bits of documentation
[libucw.git] / ucw / string.c
index d6dc7bd5188524f0698e9820217b100da19a7b1e..bb1fae1af01510e163f96dd630627ec5d1f08125 100644 (file)
 
 #undef LOCAL_DEBUG
 
-#include "ucw/lib.h"
-#include "ucw/string.h"
-
-#include <string.h>
+#include <ucw/lib.h>
+#include <ucw/string.h>
 
 #ifdef CONFIG_DARWIN
 uns
@@ -51,23 +49,3 @@ str_count_char(const char *str, uns chr)
       i++;
   return i;
 }
-
-int
-str_starts_with(const char *haystack, const char *needle)
-{
-  while (*needle)
-    if (*haystack++ != *needle++)
-      return 0;
-  return 1;
-}
-
-int
-str_ends_with(const char *haystack, const char *needle)
-{
-  int hlen = strlen(haystack);
-  int nlen = strlen(needle);
-  if (hlen < nlen)
-    return 0;
-  else
-    return !memcmp(haystack + hlen - nlen, needle, nlen);
-}