aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.h
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-19 12:26:08 -0600
committerJosh Rahm <rahm@google.com>2022-08-19 13:06:41 -0600
commita7237662f96933efe29eed8212464571e3778cd0 (patch)
tree27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/mbyte.h
parent02292344929069ea63c0bb872cc22d552d86b67f (diff)
parentb2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff)
downloadrneovim-tmp.tar.gz
rneovim-tmp.tar.bz2
rneovim-tmp.zip
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/mbyte.h')
-rw-r--r--src/nvim/mbyte.h49
1 files changed, 2 insertions, 47 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h
index 1e5e332ad9..2a9afcbd03 100644
--- a/src/nvim/mbyte.h
+++ b/src/nvim/mbyte.h
@@ -5,8 +5,9 @@
#include <stdint.h>
#include <string.h>
+#include "nvim/eval/typval.h"
#include "nvim/func_attr.h"
-#include "nvim/iconv.h"
+#include "nvim/mbyte_defs.h"
#include "nvim/os/os_defs.h" // For indirect
#include "nvim/types.h" // for char_u
@@ -19,52 +20,6 @@
#define MB_BYTE2LEN(b) utf8len_tab[b]
#define MB_BYTE2LEN_CHECK(b) (((b) < 0 || (b) > 255) ? 1 : utf8len_tab[b])
-// max length of an unicode char
-#define MB_MAXCHAR 6
-
-// 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! :-)
-
-/// Flags for vimconv_T
-typedef enum {
- CONV_NONE = 0,
- CONV_TO_UTF8 = 1,
- CONV_9_TO_UTF8 = 2,
- CONV_TO_LATIN1 = 3,
- CONV_TO_LATIN9 = 4,
- CONV_ICONV = 5,
-} ConvFlags;
-
-#define MBYTE_NONE_CONV { \
- .vc_type = CONV_NONE, \
- .vc_factor = 1, \
- .vc_fail = false, \
-}
-
-/// Structure used for string conversions
-typedef struct {
- int vc_type; ///< Zero or more ConvFlags.
- int vc_factor; ///< Maximal expansion factor.
-#ifdef HAVE_ICONV
- iconv_t vc_fd; ///< Value for CONV_ICONV.
-#endif
- bool vc_fail; ///< What to do with invalid characters: if true, fail,
- ///< otherwise use '?'.
-} vimconv_T;
-
extern const uint8_t utf8len_tab_zero[256];
extern const uint8_t utf8len_tab[256];