summaryrefslogtreecommitdiff
path: root/src/runtime/c/gu/utf8.h
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-10-09 08:37:42 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-10-09 08:37:42 +0000
commit20e4970ec19949da10b86facd3c6a5a4abb03acb (patch)
treed4383eab83d200dd8df6356afaff5489a3aeced8 /src/runtime/c/gu/utf8.h
parente7749d4a5b29d10eaed55705de3c9e5893f88d10 (diff)
added gu_is_space in gu/utf8.h. this helps to avoid the dependency on the broken unicode library for C.
Diffstat (limited to 'src/runtime/c/gu/utf8.h')
-rw-r--r--src/runtime/c/gu/utf8.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/c/gu/utf8.h b/src/runtime/c/gu/utf8.h
index 7674c6e02..3118c4071 100644
--- a/src/runtime/c/gu/utf8.h
+++ b/src/runtime/c/gu/utf8.h
@@ -37,4 +37,10 @@ gu_utf8_decode(const uint8_t** utf8);
void
gu_in_utf8_buf(uint8_t** buf, GuIn* in, GuExn* err);
+bool
+gu_is_space(uint8_t c) {
+ return (c == '\t' || c == '\n' || c == '\v' ||
+ c == '\f' || c == '\r' || c == ' ');
+}
+
#endif // GU_UTF8_H_