]> mj.ucw.cz Git - libucw.git/commitdiff
Removed str_start_with() and str_end_with()
authorMartin Mares <mj@ucw.cz>
Sat, 11 Feb 2012 17:37:02 +0000 (18:37 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 11 Feb 2012 17:37:02 +0000 (18:37 +0100)
They were already present in dev-trans under different names.

TODO
ucw/string.c
ucw/string.h

diff --git a/TODO b/TODO
index 70ec845e436e54649c3881638ca9f1f04d9a4cba..f6537054127da57d4f63064049316c9bdecb1599 100644 (file)
--- a/TODO
+++ b/TODO
@@ -8,6 +8,4 @@
                * bigalloc
                * gary
                * mainloop
-       - More exceptions
-       - Fix documentation on fastbuf tying
 - Finish documentation of ucw/string.h
index d6dc7bd5188524f0698e9820217b100da19a7b1e..0ccbdfb5ff14625a114dc1e8a2bbfc91aad90823 100644 (file)
@@ -13,8 +13,6 @@
 #include "ucw/lib.h"
 #include "ucw/string.h"
 
-#include <string.h>
-
 #ifdef CONFIG_DARWIN
 uns
 strnlen(const char *str, uns n)
@@ -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);
-}
index 8ec579c7d3c382c1a8ceb6d25b3204f4987fd07b..9e9df4faa1ee054cbfd3aa746aeaeba8e859564e 100644 (file)
@@ -26,12 +26,6 @@ char *str_format_flags(char *dest, const char *fmt, uns flags);
 /** Counts occurrences of @chr in @str. **/
 uns str_count_char(const char *str, uns chr);
 
-/** Returns a non-zero value if @haystack starts with @needle. **/
-int str_starts_with(const char *haystack, const char *needle);
-
-/** Returns a non-zero value if @haystack ends with @needle. **/
-int str_ends_with(const char *haystack, const char *needle);
-
 /* str-esc.c */
 
 /**