summaryrefslogtreecommitdiff
path: root/src/libwapcaplet.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-01-30 11:50:24 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2016-01-30 12:17:21 +0000
commit43b2081b8d5e23c8582e2729f18ccd7555be8a40 (patch)
tree6c08f1930b7045606ee3138aa3c664d4d8eff99c /src/libwapcaplet.c
parent86508f207b5fbb26db06dd9411d08bb0b9bfa6c8 (diff)
downloadlibwapcaplet-43b2081b8d5e23c8582e2729f18ccd7555be8a40.tar.gz
libwapcaplet-43b2081b8d5e23c8582e2729f18ccd7555be8a40.tar.bz2
Add lwc_string_tolower() API.
Diffstat (limited to 'src/libwapcaplet.c')
-rw-r--r--src/libwapcaplet.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libwapcaplet.c b/src/libwapcaplet.c
index 9360f23..9521e96 100644
--- a/src/libwapcaplet.c
+++ b/src/libwapcaplet.c
@@ -164,6 +164,25 @@ lwc_intern_substring(lwc_string *str,
return lwc_intern_string(CSTR_OF(str) + ssoffset, sslen, ret);
}
+lwc_error
+lwc_string_tolower(lwc_string *str, lwc_string **ret)
+{
+ assert(str);
+ assert(ret);
+
+ /* Internally make use of knowledge that insensitive strings
+ * are lower case. */
+ if (str->insensitive == NULL) {
+ lwc_error error = lwc__intern_caseless_string(str);
+ if (error != lwc_error_ok) {
+ return error;
+ }
+ }
+
+ *ret = lwc_string_ref(str->insensitive);
+ return lwc_error_ok;
+}
+
void
lwc_string_destroy(lwc_string *str)
{