From 5d80825bf6ea1af744ee851efab853bc66fb8255 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 11 Feb 2012 18:37:02 +0100 Subject: [PATCH] Removed str_start_with() and str_end_with() They were already present in dev-trans under different names. --- TODO | 2 -- ucw/string.c | 22 ---------------------- ucw/string.h | 6 ------ 3 files changed, 30 deletions(-) diff --git a/TODO b/TODO index 70ec845e..f6537054 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,4 @@ * bigalloc * gary * mainloop - - More exceptions - - Fix documentation on fastbuf tying - Finish documentation of ucw/string.h diff --git a/ucw/string.c b/ucw/string.c index d6dc7bd5..0ccbdfb5 100644 --- a/ucw/string.c +++ b/ucw/string.c @@ -13,8 +13,6 @@ #include "ucw/lib.h" #include "ucw/string.h" -#include - #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); -} diff --git a/ucw/string.h b/ucw/string.h index 8ec579c7..9e9df4fa 100644 --- a/ucw/string.h +++ b/ucw/string.h @@ -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 */ /** -- 2.39.2