aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.h
diff options
context:
space:
mode:
authorNicolas Hillegeer <nicolas@hillegeer.com>2014-07-12 14:28:58 +0200
committerNicolas Hillegeer <nicolas@hillegeer.com>2014-07-12 14:28:58 +0200
commit5d53c51fae483b9a4cbb3636932f7d753d67c384 (patch)
tree87486e0f97b4252a6eb954ace05c47465daa2dfe /src/nvim/mbyte.h
parent77db0b2bba97603e59614bb95d6eab76e42f9288 (diff)
parenta32df5e734460dfdf9bc85aebf5252d64fcb99f5 (diff)
downloadrneovim-5d53c51fae483b9a4cbb3636932f7d753d67c384.tar.gz
rneovim-5d53c51fae483b9a4cbb3636932f7d753d67c384.tar.bz2
rneovim-5d53c51fae483b9a4cbb3636932f7d753d67c384.zip
Merge #837 'Move defines from vim.h - phase2'
Diffstat (limited to 'src/nvim/mbyte.h')
-rw-r--r--src/nvim/mbyte.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h
index d52f174152..0cfe2c4bab 100644
--- a/src/nvim/mbyte.h
+++ b/src/nvim/mbyte.h
@@ -3,6 +3,31 @@
#include <stdbool.h>
+/*
+ * Return byte length of character that starts with byte "b".
+ * Returns 1 for a single-byte character.
+ * MB_BYTE2LEN_CHECK() can be used to count a special key as one byte.
+ * Don't call MB_BYTE2LEN(b) with b < 0 or b > 255!
+ */
+#define MB_BYTE2LEN(b) mb_bytelen_tab[b]
+#define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : mb_bytelen_tab[b])
+
+/* properties used in enc_canon_table[] (first three mutually exclusive) */
+#define ENC_8BIT 0x01
+#define ENC_DBCS 0x02
+#define ENC_UNICODE 0x04
+
+#define ENC_ENDIAN_B 0x10 /* Unicode: Big endian */
+#define ENC_ENDIAN_L 0x20 /* Unicode: Little endian */
+
+#define ENC_2BYTE 0x40 /* Unicode: UCS-2 */
+#define ENC_4BYTE 0x80 /* Unicode: UCS-4 */
+#define ENC_2WORD 0x100 /* Unicode: UTF-16 */
+
+#define ENC_LATIN1 0x200 /* Latin1 */
+#define ENC_LATIN9 0x400 /* Latin9 */
+#define ENC_MACROMAN 0x800 /* Mac Roman (not Macro Man! :-) */
+
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mbyte.h.generated.h"
#endif