From 4d57539ffc2954e5c3b9c42da41511f69c4fcde9 Mon Sep 17 00:00:00 2001 From: pommicket Date: Wed, 18 Oct 2023 12:58:59 -0400 Subject: start editorconfig support --- util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index 1d60cf9..e190cd6 100644 --- a/util.h +++ b/util.h @@ -53,6 +53,8 @@ RcStr *rc_str_new(const char *s, i64 len); /// /// does nothing if `str` is `NULL`. void rc_str_incref(RcStr *str); +/// increases reference count of `str` (if non-NULL) and returns it. +RcStr *rc_str_copy(RcStr *str); /// decrease reference count of `*str` and set `*str` to `NULL`. /// /// this frees `*str` if the reference count hits 0. @@ -122,6 +124,8 @@ void str_trim_start(char *str); void str_trim_end(char *str); /// trim whitespace from both sides of a string void str_trim(char *str); +/// convert ASCII to lowercase +void str_ascii_to_lowercase(char *str); /// count occurences of `c` in `s` size_t str_count_char(const char *s, char c); /// equivalent to GNU function asprintf (like sprintf, but allocates the string with malloc). -- cgit v1.2.3