diff options
Diffstat (limited to 'src/nvim/vim.h')
-rw-r--r-- | src/nvim/vim.h | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/src/nvim/vim.h b/src/nvim/vim.h index ec8d6ab153..0ab9d96173 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -1,7 +1,7 @@ #ifndef NVIM_VIM_H #define NVIM_VIM_H -#include "nvim/pos.h" // for linenr_T, MAXCOL, etc... +#include "nvim/pos.h" #include "nvim/types.h" // Some defines from the old feature.h @@ -138,7 +138,6 @@ enum { EXPAND_USER_LIST, EXPAND_USER_LUA, EXPAND_SHELLCMD, - EXPAND_CSCOPE, EXPAND_SIGN, EXPAND_PROFILE, EXPAND_BEHAVE, @@ -155,6 +154,7 @@ enum { EXPAND_MAPCLEAR, EXPAND_ARGLIST, EXPAND_DIFF_BUFFERS, + EXPAND_BREAKPOINT, EXPAND_CHECKHEALTH, EXPAND_LUA, }; @@ -196,17 +196,11 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // defines to avoid typecasts from (char_u *) to (char *) and back // (vim_strchr() is now in strings.c) -#define STRLEN(s) strlen((char *)(s)) -#ifdef HAVE_STRNLEN -# define STRNLEN(s, n) strnlen((char *)(s), (size_t)(n)) -#else -# define STRNLEN(s, n) xstrnlen((char *)(s), (size_t)(n)) +#ifndef HAVE_STRNLEN +# define strnlen xstrnlen // Older versions of SunOS may not have strnlen #endif -#define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) -#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n)) -#define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n)) -#define STRCMP(d, s) strcmp((char *)(d), (char *)(s)) -#define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n)) + +#define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) // NOLINT(runtime/printf) #ifdef HAVE_STRCASECMP # define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s)) #else @@ -218,7 +212,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #endif // Like strcpy() but allows overlapped source and destination. -#define STRMOVE(d, s) memmove((d), (s), STRLEN(s) + 1) +#define STRMOVE(d, s) memmove((d), (s), strlen(s) + 1) #ifdef HAVE_STRNCASECMP # define STRNICMP(d, s, n) strncasecmp((char *)(d), (char *)(s), (size_t)(n)) @@ -231,7 +225,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #endif #define STRCAT(d, s) strcat((char *)(d), (char *)(s)) // NOLINT(runtime/printf) -#define STRLCAT(d, s, n) xstrlcat((char *)(d), (char *)(s), (size_t)(n)) // Character used as separated in autoload function/variable names. #define AUTOLOAD_CHAR '#' @@ -242,27 +235,8 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // destination and mess up the screen. #define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno)) -#define SHOWCMD_COLS 10 // columns needed by shown command - #include "nvim/path.h" -/// 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 algorithm 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. #define HL_ATTR(n) hl_attr_active[(int)(n)] @@ -271,13 +245,11 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() /// plus six following composing characters of three bytes each. #define MB_MAXBYTES 21 -// This has to go after the include of proto.h, as proto/gui.pro declares -// functions of these names. The declarations would break if the defines had -// been seen at that stage. But it must be before globals.h, where error_ga -// is declared. -#ifndef WIN32 -# define mch_errmsg(str) fprintf(stderr, "%s", (str)) -# define mch_msg(str) printf("%s", (str)) +#ifndef MSWIN +/// Headless (no UI) error message handler. +# define os_errmsg(str) fprintf(stderr, "%s", (str)) +/// Headless (no UI) message handler. +# define os_msg(str) printf("%s", (str)) #endif #include "nvim/buffer_defs.h" // buffer and windows |