summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'util.h')
-rw-r--r--util.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.h b/util.h
index 0f8ca55..8c65b35 100644
--- a/util.h
+++ b/util.h
@@ -73,9 +73,11 @@ bool util_is_power_of_2(u64 x);
char32_t *util_mem32chr(char32_t *s, char32_t c, size_t n);
/// like memchr, but 32-bit, and constant.
const char32_t *util_mem32chr_const(const char32_t *s, char32_t c, size_t n);
-/// does `str` have this prefix?
+/// does `str` start with `prefix`?
bool str_has_prefix(const char *str, const char *prefix);
-/// like str_has_prefix, but for paths. "ab/cd" is a path-prefix of "ab/cd/ef", but not "ab/cde".
+/// does `str` end with `suffix`?
+bool str_has_suffix(const char *str, const char *suffix);
+/// like \ref str_has_prefix, but for paths. "ab/cd" is a path-prefix of "ab/cd/ef", but not "ab/cde".
/// also handles the fact that \ and / are the same on windows
bool str_has_path_prefix(const char *path, const char *prefix);
/// are these two strings equal?