diff options
| author | Johnny Richard <johnny@johnnyrichard.com> | 2025-04-14 23:22:57 +0200 |
|---|---|---|
| committer | Johnny Richard <johnny@johnnyrichard.com> | 2025-04-14 23:22:57 +0200 |
| commit | b3bd068f614a46580ee3e5688dd9cfd40694d75b (patch) | |
| tree | 45183f99a8373527caa03ff473c4e40fe07cd459 /src/string_view.h | |
| parent | 63104d34e1c1772131f6366f825e67f38d027dba (diff) | |
Signed-off-by: Johnny Richard <johnny@johnnyrichard.com>
Diffstat (limited to 'src/string_view.h')
| -rw-r--r-- | src/string_view.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/string_view.h b/src/string_view.h index 38142b0..0f0a72b 100644 --- a/src/string_view.h +++ b/src/string_view.h @@ -16,19 +16,20 @@ */ #ifndef STRING_VIEW_H #define STRING_VIEW_H -#include <stddef.h> #include <stdbool.h> +#include <stddef.h> #define PRIsv "%.*s" -#define PRIsvARG(sv) (int) (sv).size, (sv).chars +#define PRIsvARG(sv) (int)(sv).size, (sv).chars -typedef struct string_view { +typedef struct string_view +{ size_t size; - char *chars; + char* chars; } string_view_t; string_view_t -string_view_from_cstr(char *cstr); +string_view_from_cstr(char* cstr); bool string_view_eq(string_view_t s1, string_view_t s2); |
