aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/vim.h
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
committerZyX <kp-pav@yandex.ru>2017-04-08 01:54:58 +0300
commit043d8ff9f2389f8deab7934aa0ab4ce88a747f01 (patch)
tree4d6fa32d7c1ddaa99c15f80c1a4ba95d5f3ca2da /src/nvim/vim.h
parent5992cdf3c27ee9c73cea22e288c6ea6d54867394 (diff)
parent13352c00f1909d9296c5f276a3735f5e6f231b39 (diff)
downloadrneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.gz
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.tar.bz2
rneovim-043d8ff9f2389f8deab7934aa0ab4ce88a747f01.zip
Merge branch 'master' into luaviml'/lua
Diffstat (limited to 'src/nvim/vim.h')
-rw-r--r--src/nvim/vim.h57
1 files changed, 26 insertions, 31 deletions
diff --git a/src/nvim/vim.h b/src/nvim/vim.h
index 87e9889465..cc0587fb88 100644
--- a/src/nvim/vim.h
+++ b/src/nvim/vim.h
@@ -30,7 +30,7 @@ Error: configure did not run properly.Check auto/config.log.
#include "nvim/os/os_defs.h" /* bring lots of system header files */
/// length of a buffer to store a number in ASCII (64 bits binary + NUL)
-#define NUMBUFLEN 65
+enum { NUMBUFLEN = 65 };
// flags for vim_str2nr()
#define STR2NR_BIN 1
@@ -51,22 +51,7 @@ Error: configure did not run properly.Check auto/config.log.
/* ================ end of the header file puzzle =============== */
-#ifdef HAVE_WORKING_LIBINTL
-# include <libintl.h>
-# define _(x) gettext((char *)(x))
-// XXX do we actually need this?
-# ifdef gettext_noop
-# define N_(x) gettext_noop(x)
-# else
-# define N_(x) x
-# endif
-#else
-# define _(x) ((char *)(x))
-# define N_(x) x
-# define bindtextdomain(x, y) /* empty */
-# define bind_textdomain_codeset(x, y) /* empty */
-# define textdomain(x) /* empty */
-#endif
+#include "nvim/gettext.h"
/* special attribute addition: Put message in history */
#define MSG_HIST 0x1000
@@ -109,11 +94,14 @@ Error: configure did not run properly.Check auto/config.log.
// all mode bits used for mapping
#define MAP_ALL_MODES (0x3f | SELECTMODE | TERM_FOCUS)
-/* directions */
-#define FORWARD 1
-#define BACKWARD (-1)
-#define FORWARD_FILE 3
-#define BACKWARD_FILE (-3)
+/// Directions.
+typedef enum {
+ kDirectionNotSet = 0,
+ FORWARD = 1,
+ BACKWARD = (-1),
+ FORWARD_FILE = 3,
+ BACKWARD_FILE = (-3),
+} Direction;
/* return values for functions */
#if !(defined(OK) && (OK == 1))
@@ -282,15 +270,22 @@ enum {
#define SHOWCMD_COLS 10 /* columns needed by shown command */
#define STL_MAX_ITEM 80 /* max nr of %<flag> in statusline */
-/*
- * fnamecmp() is used to compare file names.
- * On some systems case in a file name does not matter, on others it does.
- * (this does not account for maximum name lengths and things like "../dir",
- * thus it is not 100% accurate!)
- */
-#define fnamecmp(x, y) vim_fnamecmp((char_u *)(x), (char_u *)(y))
-#define fnamencmp(x, y, n) vim_fnamencmp((char_u *)(x), (char_u *)(y), \
- (size_t)(n))
+/// Compare file names
+///
+/// On some systems case in a file name does not matter, on others it does.
+///
+/// @note Does not account for maximum name lengths and things like "../dir",
+/// thus it is not 100% accurate. OS may also use different algorythm for
+/// case-insensitive comparison.
+///
+/// @param[in] x First file name to compare.
+/// @param[in] y Second file name to compare.
+///
+/// @return 0 for equal file names, non-zero otherwise.
+#define fnamecmp(x, y) path_fnamecmp((const char *)(x), (const char *)(y))
+#define fnamencmp(x, y, n) path_fnamencmp((const char *)(x), \
+ (const char *)(y), \
+ (size_t)(n))
/*
* Enums need a typecast to be used as array index (for Ultrix).