1.1 --- a/ucx/string.c Thu Oct 15 14:59:25 2015 +0200 1.2 +++ b/ucx/string.c Thu Oct 15 16:52:53 2015 +0200 1.3 @@ -339,3 +339,35 @@ 1.4 suffix.ptr, suffix.length) == 0; 1.5 } 1.6 } 1.7 + 1.8 +sstr_t sstrlower(sstr_t string) { 1.9 + sstr_t ret = sstrdup(string); 1.10 + for (size_t i = 0; i < ret.length ; i++) { 1.11 + ret.ptr[i] = tolower(ret.ptr[i]); 1.12 + } 1.13 + return ret; 1.14 +} 1.15 + 1.16 +sstr_t sstrlower_a(UcxAllocator *allocator, sstr_t string) { 1.17 + sstr_t ret = sstrdup_a(allocator, string); 1.18 + for (size_t i = 0; i < ret.length ; i++) { 1.19 + ret.ptr[i] = tolower(ret.ptr[i]); 1.20 + } 1.21 + return ret; 1.22 +} 1.23 + 1.24 +sstr_t sstrupper(sstr_t string) { 1.25 + sstr_t ret = sstrdup(string); 1.26 + for (size_t i = 0; i < ret.length ; i++) { 1.27 + ret.ptr[i] = toupper(ret.ptr[i]); 1.28 + } 1.29 + return ret; 1.30 +} 1.31 + 1.32 +sstr_t sstrupper_a(UcxAllocator *allocator, sstr_t string) { 1.33 + sstr_t ret = sstrdup_a(allocator, string); 1.34 + for (size_t i = 0; i < ret.length ; i++) { 1.35 + ret.ptr[i] = toupper(ret.ptr[i]); 1.36 + } 1.37 + return ret; 1.38 +}