summaryrefslogtreecommitdiff
path: root/util/sbase/libutf/isspacerune.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/sbase/libutf/isspacerune.c')
-rw-r--r--util/sbase/libutf/isspacerune.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/sbase/libutf/isspacerune.c b/util/sbase/libutf/isspacerune.c
new file mode 100644
index 00000000..8583f932
--- /dev/null
+++ b/util/sbase/libutf/isspacerune.c
@@ -0,0 +1,31 @@
+/* Automatically generated by mkrunetype.awk */
+#include <stdlib.h>
+
+#include "../utf.h"
+#include "runetype.h"
+
+static const Rune space2[][2] = {
+ { 0x0009, 0x000D },
+ { 0x001C, 0x0020 },
+ { 0x2000, 0x200A },
+ { 0x2028, 0x2029 },
+};
+
+static const Rune space1[] = {
+ 0x0085,
+ 0x00A0,
+ 0x1680,
+ 0x202F,
+ 0x205F,
+ 0x3000,
+};
+
+int
+isspacerune(Rune r)
+{
+ if(bsearch(&r, space2, nelem(space2), sizeof *space2, &rune2cmp))
+ return 1;
+ if(bsearch(&r, space1, nelem(space1), sizeof *space1, &rune1cmp))
+ return 1;
+ return 0;
+}