diff options
author | ZyX <kp-pav@yandex.ru> | 2016-08-20 22:24:34 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-29 10:07:42 +0300 |
commit | e18a5783080f7c94f408ec5f53dedffdb69789e1 (patch) | |
tree | 17f54dfabb1163f2defce7989b3a182b846334f9 /src/nvim/mbyte.h | |
parent | 50a48f2a0ecf7f767df961f7f5060505cf28e331 (diff) | |
download | rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.gz rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.tar.bz2 rneovim-e18a5783080f7c94f408ec5f53dedffdb69789e1.zip |
*: Move some dictionary functions to typval.h and use char*
Also fixes buffer reusage in setmatches() and complete().
Diffstat (limited to 'src/nvim/mbyte.h')
-rw-r--r-- | src/nvim/mbyte.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/mbyte.h b/src/nvim/mbyte.h index 5f5bab9fcd..c20e6d47ff 100644 --- a/src/nvim/mbyte.h +++ b/src/nvim/mbyte.h @@ -2,8 +2,10 @@ #define NVIM_MBYTE_H #include <stdbool.h> +#include <string.h> #include "nvim/iconv.h" +#include "nvim/func_attr.h" /* * Return byte length of character that starts with byte "b". @@ -66,4 +68,17 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "mbyte.h.generated.h" #endif + +static inline int mb_strcmp_ic(bool ic, const char *s1, const char *s2) + REAL_FATTR_NONNULL_ALL REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT; + +/// Compare strings +/// +/// @param[in] ic True if case is to be ignored. +/// +/// @return 0 if s1 == s2, <0 if s1 < s2, >0 if s1 > s2. +static inline int mb_strcmp_ic(bool ic, const char *s1, const char *s2) +{ + return (ic ? mb_stricmp(s1, s2) : strcmp(s1, s2)); +} #endif // NVIM_MBYTE_H |