They were already present in dev-trans under different names.
* bigalloc
* gary
* mainloop
- - More exceptions
- - Fix documentation on fastbuf tying
- Finish documentation of ucw/string.h
#include "ucw/lib.h"
#include "ucw/string.h"
-#include <string.h>
-
#ifdef CONFIG_DARWIN
uns
strnlen(const char *str, uns n)
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);
-}
/** 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 */
/**