From eff9a3011c8e51817ebad468eef4b03e52e83626 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 9 Oct 2013 08:37:42 +0000 Subject: [PATCH] added gu_is_space in gu/utf8.h. this helps to avoid the dependency on the broken unicode library for C. --- src/runtime/c/gu/utf8.h | 6 ++++++ 1 file changed, 6 insertions(+) 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_