From f24912296c473ac15c12e65c97007fe3ece87dfa Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 25 Feb 2024 15:08:54 -0800 Subject: Add function to check for empty string. --- cstring/include/cstring.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cstring') diff --git a/cstring/include/cstring.h b/cstring/include/cstring.h index de85b43..991d742 100644 --- a/cstring/include/cstring.h +++ b/cstring/include/cstring.h @@ -94,6 +94,8 @@ return (a.length == strlen(b)) && strncmp(a.str, b, a.length) == 0; \ } \ \ + static inline bool STRING##_empty(STRING a) { return a.length == 0; } \ + \ static inline STRING STRING##_itoa(int n) { \ STRING str = (STRING){0}; \ const int written = snprintf(str.str, SIZE, "%d", n); \ -- cgit v1.2.3