summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
author0x221E2026-04-22 20:50:43 +0200
committer0x221E2026-04-22 20:50:43 +0200
commit19d24559137697e683650dba099481abba7e703e (patch)
tree981f6190d6a08efd21daeb968d35f2318f9999f7 /include
parent1cc115db42def8470176daf758056a0193a1228a (diff)
lib: sv: add sv_equal() to sv.c and sv.h
Optimized and bug-prone equality operation for string_view struct. This function will replace the equality checks operations between char* + string_view, and string_view + string_view.
Diffstat (limited to 'include')
-rw-r--r--include/lib/sv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/lib/sv.h b/include/lib/sv.h
index dbc9c5d..115b877 100644
--- a/include/lib/sv.h
+++ b/include/lib/sv.h
@@ -10,6 +10,7 @@ struct string_view {
struct string_view sv_create(char *buf, size_t len);
struct string_view sv_copy(struct string_view *sv);
+int sv_equal(struct string_view *a, struct string_view *b);
#define SV(x) sv_create((x), sizeof(x) - 1)