diff options
| author | Tyge Løvset <[email protected]> | 2022-08-08 16:13:05 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-08 16:29:43 +0200 |
| commit | fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd (patch) | |
| tree | e62f48c37a87a732e83f1dc336ba697b47443f9d /src | |
| parent | 1954c6aa34aae6301f90e81e546db6fb666c517a (diff) | |
| download | STC-modified-fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd.tar.gz STC-modified-fea47e9b0b1f1137944a446d0d7e4b413f7bc2dd.zip | |
Changed *cstr_tolower*/*cstr_toupper* arg from `const cstr*` to `csview`.
Diffstat (limited to 'src')
| -rw-r--r-- | src/utf8code.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/utf8code.c b/src/utf8code.c index 6a5e513f..394597e1 100644 --- a/src/utf8code.c +++ b/src/utf8code.c @@ -177,8 +177,7 @@ fn_tolower = {tolower, utf8_tolower}, fn_toupper = {toupper, utf8_toupper}; -static cstr cstr_tocase(const cstr* self, struct fncase fn) { - csview sv = cstr_sv(self); +static cstr cstr_tocase(csview sv, struct fncase fn) { cstr out = cstr_null; char *buf = cstr_reserve(&out, sv.size*3/2); uint32_t cp; size_t sz = 0; @@ -198,26 +197,14 @@ static cstr cstr_tocase(const cstr* self, struct fncase fn) { return out; } -cstr cstr_tofold(const cstr* self) { - return cstr_tocase(self, fn_tofold); +cstr cstr_casefold_sv(csview sv) { + return cstr_tocase(sv, fn_tofold); } -cstr cstr_tolower(const cstr* self) { - return cstr_tocase(self, fn_tolower); +cstr cstr_tolower_sv(csview sv) { + return cstr_tocase(sv, fn_tolower); } -cstr cstr_toupper(const cstr* self) { - return cstr_tocase(self, fn_toupper); +cstr cstr_toupper_sv(csview sv) { + return cstr_tocase(sv, fn_toupper); } - -void cstr_casefold(cstr* self) { - cstr_take(self, cstr_tocase(self, fn_tofold)); -} - -void cstr_lowercase(cstr* self) { - cstr_take(self, cstr_tocase(self, fn_tolower)); -} - -void cstr_uppercase(cstr* self) { - cstr_take(self, cstr_tocase(self, fn_toupper)); -}
\ No newline at end of file |
