summaryrefslogtreecommitdiff
path: root/src/utf8.h
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2017-09-17 22:24:37 +0200
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2017-09-17 22:24:37 +0200
commitec10077b9f943212a9c0c634d79ada4f88b0d0c1 (patch)
tree96f1e3e0be013484bd500290946deea19971b564 /src/utf8.h
parentca1ed401ddfc1ab88b532c3f955c2ee02435be42 (diff)
downloadratpoison-ec10077b9f943212a9c0c634d79ada4f88b0d0c1.zip
Move RP_IS_UTF8_* macros in utf8.h
Only used in editor.c when introduced, but they're used elsewhere since.
Diffstat (limited to 'src/utf8.h')
-rw-r--r--src/utf8.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utf8.h b/src/utf8.h
index 2847b5a..20e33bd 100644
--- a/src/utf8.h
+++ b/src/utf8.h
@@ -1,6 +1,11 @@
#ifndef UTF8_H
#define UTF8_H
+/* UTF-8 handling macros */
+#define RP_IS_UTF8_CHAR(c) (utf8_locale && (c) & 0xC0)
+#define RP_IS_UTF8_START(c) (utf8_locale && ((c) & 0xC0) == 0xC0)
+#define RP_IS_UTF8_CONT(c) (utf8_locale && ((c) & 0xC0) == 0x80)
+
extern int utf8_locale;
int utf8_check_locale(void);