diff options
| author | James McCoy <jamessan@jamessan.com> | 2018-03-28 21:52:06 -0400 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2018-03-28 21:54:39 -0400 |
| commit | 79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1 (patch) | |
| tree | 4e0589d75801f3ff6a9678f84f5009102766661e /src/nvim/mbyte.h | |
| parent | 4403864da3c48412595d439f36458d1e6ccfc49f (diff) | |
| parent | 3f3de9b1a95d273463a87516365510dbffcaf3d2 (diff) | |
| download | rneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.tar.gz rneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.tar.bz2 rneovim-79f9c2d9c650ceab27cdc6707fd6d7fa1de29fc1.zip | |
Merge branch 'master' into yagebu/option-fixes
Diffstat (limited to 'src/nvim/mbyte.h')
| -rw-r--r-- | src/nvim/mbyte.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h index ad9e38004c..a5ce1b0a15 100644 --- a/src/nvim/mbyte.h +++ b/src/nvim/mbyte.h @@ -1,6 +1,7 @@ #ifndef NVIM_MBYTE_H #define NVIM_MBYTE_H +#include <stdint.h> #include <stdbool.h> #include <string.h> @@ -18,6 +19,9 @@ #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 @@ -56,6 +60,12 @@ typedef enum { 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. @@ -67,6 +77,10 @@ typedef struct { ///< otherwise use '?'. } vimconv_T; +extern const uint8_t utf8len_tab_zero[256]; + +extern const uint8_t utf8len_tab[256]; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mbyte.h.generated.h" #endif |