Macros | Enumerations
vim.h File Reference
#include "nvim/types.h"
#include "nvim/pos.h"
#include "auto/config.h"
#include "nvim/os/os_defs.h"
#include "nvim/keymap.h"
#include "nvim/macros.h"
#include "nvim/gettext.h"
#include "nvim/message.h"
#include "nvim/globals.h"
#include "nvim/buffer_defs.h"
#include "nvim/ex_cmds_defs.h"

Go to the source code of this file.

Macros

#define SESSION_FILE   "Session.vim"
 
#define MAX_MSG_HIST_LEN   200
 
#define SYS_OPTWIN_FILE   "$VIMRUNTIME/optwin.vim"
 
#define RUNTIME_DIRNAME   "runtime"
 
#define HAVE_PATHDEF
 
#define MAX_TYPENR   65535
 
#define ROOT_UID   0
 
#define MSG_HIST   0x1000
 
#define NORMAL   0x01
 
#define VISUAL   0x02
 
#define OP_PENDING   0x04
 
#define CMDLINE   0x08
 
#define INSERT   0x10
 
#define LANGMAP   0x20
 
#define REPLACE_FLAG   0x40
 
#define REPLACE   (REPLACE_FLAG + INSERT)
 
#define VREPLACE_FLAG   0x80
 
#define VREPLACE   (REPLACE_FLAG + VREPLACE_FLAG + INSERT)
 
#define LREPLACE   (REPLACE_FLAG + LANGMAP)
 
#define NORMAL_BUSY   (0x100 + NORMAL)
 
#define HITRETURN   (0x200 + NORMAL)
 
#define ASKMORE   0x300
 
#define SETWSIZE   0x400
 
#define ABBREV   0x500
 
#define EXTERNCMD   0x600
 
#define SHOWMATCH   (0x700 + INSERT)
 
#define CONFIRM   0x800
 
#define SELECTMODE   0x1000
 
#define TERM_FOCUS   0x2000
 
#define CMDPREVIEW   0x4000
 
#define MAP_ALL_MODES   (0x3f | SELECTMODE | TERM_FOCUS)
 
#define OK   1
 
#define FAIL   0
 
#define NOTDONE   2
 
#define VAR_TYPE_NUMBER   0
 
#define VAR_TYPE_STRING   1
 
#define VAR_TYPE_FUNC   2
 
#define VAR_TYPE_LIST   3
 
#define VAR_TYPE_DICT   4
 
#define VAR_TYPE_FLOAT   5
 
#define VAR_TYPE_BOOL   6
 
#define MIN_SWAP_PAGE_SIZE   1048
 
#define MAX_SWAP_PAGE_SIZE   50000
 
#define FALSE   0
 
#define TRUE   1
 
#define MAYBE   2
 
#define STATUS_HEIGHT   1
 
#define QF_WINHEIGHT   10
 
#define CMDBUFFSIZE   256
 
#define LSIZE   512
 
#define DIALOG_MSG_SIZE   1000
 
#define MAXMAPLEN   50
 
#define UNDO_HASH_SIZE   32
 
#define STRLEN(s)   strlen((char *)(s))
 
#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 STRICMP(d, s)   vim_stricmp((char *)(d), (char *)(s))
 
#define STRMOVE(d, s)   memmove((d), (s), STRLEN(s) + 1)
 
#define STRNICMP(d, s, n)   vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))
 
#define STRRCHR(s, c)   (char_u *)strrchr((const char *)(s), (c))
 
#define STRCAT(d, s)   strcat((char *)(d), (char *)(s))
 
#define STRNCAT(d, s, n)   strncat((char *)(d), (char *)(s), (size_t)(n))
 
#define STRLCAT(d, s, n)   xstrlcat((char *)(d), (char *)(s), (size_t)(n))
 
#define vim_strpbrk(s, cs)   (char_u *)strpbrk((char *)(s), (char *)(cs))
 
#define PERROR(msg)   (void) emsgf("%s: %s", msg, strerror(errno))
 
#define SHOWCMD_COLS   10
 
#define STL_MAX_ITEM   80
 
#define fnamecmp(x, y)   path_fnamecmp((const char *)(x), (const char *)(y))
 
#define fnamencmp(x, y, n)
 
#define HL_ATTR(n)   highlight_attr[(int)(n)]
 
#define MB_MAXBYTES   21
 
#define mch_errmsg(str)   fprintf(stderr, "%s", (str))
 
#define mch_msg(str)   printf("%s", (str))
 
#define DIP_ALL   0x01
 
#define DIP_DIR   0x02
 
#define DIP_ERR   0x04
 
#define DIP_START   0x08
 
#define DIP_OPT   0x10
 
#define DIP_NORTP   0x20
 
#define DIP_NOAFTER   0x40
 
#define DIP_AFTER   0x80
 
#define LOWEST_WIN_ID   1000
 
#define REPLACE_CR_NCHAR   -1
 
#define REPLACE_NL_NCHAR   -2
 

Enumerations

enum  { NUMBUFLEN = 65 }
 length of a buffer to store a number in ASCII (64 bits binary + NUL) More...
 
enum  Direction {
  kDirectionNotSet = 0, FORWARD = 1, BACKWARD = (-1), FORWARD_FILE = 3,
  BACKWARD_FILE = (-3)
}
 Directions. More...
 
enum  {
  EXPAND_UNSUCCESSFUL = -2, EXPAND_OK = -1, EXPAND_NOTHING = 0, EXPAND_COMMANDS,
  EXPAND_FILES, EXPAND_DIRECTORIES, EXPAND_SETTINGS, EXPAND_BOOL_SETTINGS,
  EXPAND_TAGS, EXPAND_OLD_SETTING, EXPAND_HELP, EXPAND_BUFFERS,
  EXPAND_EVENTS, EXPAND_MENUS, EXPAND_SYNTAX, EXPAND_HIGHLIGHT,
  EXPAND_AUGROUP, EXPAND_USER_VARS, EXPAND_MAPPINGS, EXPAND_TAGS_LISTFILES,
  EXPAND_FUNCTIONS, EXPAND_USER_FUNC, EXPAND_EXPRESSION, EXPAND_MENUNAMES,
  EXPAND_USER_COMMANDS, EXPAND_USER_CMD_FLAGS, EXPAND_USER_NARGS, EXPAND_USER_COMPLETE,
  EXPAND_ENV_VARS, EXPAND_LANGUAGE, EXPAND_COLORS, EXPAND_COMPILER,
  EXPAND_USER_DEFINED, EXPAND_USER_LIST, EXPAND_SHELLCMD, EXPAND_CSCOPE,
  EXPAND_SIGN, EXPAND_PROFILE, EXPAND_BEHAVE, EXPAND_FILETYPE,
  EXPAND_FILES_IN_PATH, EXPAND_OWNSYNTAX, EXPAND_LOCALES, EXPAND_HISTORY,
  EXPAND_USER, EXPAND_SYNTIME, EXPAND_USER_ADDR_TYPE, EXPAND_PACKADD,
  EXPAND_MESSAGES, EXPAND_MAPCLEAR, EXPAND_ARGLIST, EXPAND_CHECKHEALTH
}
 
enum  { FOLD_TEXT_LEN = 51 }
 

Macro Definition Documentation

#define ABBREV   0x500
#define ASKMORE   0x300
#define CMDBUFFSIZE   256
#define CMDLINE   0x08
#define CMDPREVIEW   0x4000
#define CONFIRM   0x800
#define DIALOG_MSG_SIZE   1000
#define DIP_AFTER   0x80
#define DIP_ALL   0x01
#define DIP_DIR   0x02
#define DIP_ERR   0x04
#define DIP_NOAFTER   0x40
#define DIP_NORTP   0x20
#define DIP_OPT   0x10
#define DIP_START   0x08
#define EXTERNCMD   0x600
#define FAIL   0
#define FALSE   0
#define fnamecmp (   x,
 
)    path_fnamecmp((const char *)(x), (const char *)(y))

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.
Parameters
[in]xFirst file name to compare.
[in]ySecond file name to compare.
Returns
0 for equal file names, non-zero otherwise.
#define fnamencmp (   x,
  y,
  n 
)
Value:
path_fnamencmp((const char *)(x), \
(const char *)(y), \
(size_t)(n))
int path_fnamencmp(const char *const fname1, const char *const fname2, size_t len) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
Definition: path.c:318
static char size_t n
Definition: memline.c:3368
#define HAVE_PATHDEF
#define HITRETURN   (0x200 + NORMAL)
#define HL_ATTR (   n)    highlight_attr[(int)(n)]
#define INSERT   0x10
#define LANGMAP   0x20
#define LOWEST_WIN_ID   1000
#define LREPLACE   (REPLACE_FLAG + LANGMAP)
#define LSIZE   512
#define MAP_ALL_MODES   (0x3f | SELECTMODE | TERM_FOCUS)
#define MAX_MSG_HIST_LEN   200
#define MAX_SWAP_PAGE_SIZE   50000
#define MAX_TYPENR   65535
#define MAXMAPLEN   50
#define MAYBE   2
#define MB_MAXBYTES   21

Maximum number of bytes in a multi-byte character. It can be one 32-bit character of up to 6 bytes, or one 16-bit character of up to three bytes plus six following composing characters of three bytes each.

#define mch_errmsg (   str)    fprintf(stderr, "%s", (str))
#define mch_msg (   str)    printf("%s", (str))
#define MIN_SWAP_PAGE_SIZE   1048
#define MSG_HIST   0x1000
#define NORMAL   0x01
#define NORMAL_BUSY   (0x100 + NORMAL)
#define NOTDONE   2
#define OK   1
#define OP_PENDING   0x04
#define PERROR (   msg)    (void) emsgf("%s: %s", msg, strerror(errno))
#define QF_WINHEIGHT   10
#define REPLACE   (REPLACE_FLAG + INSERT)
#define REPLACE_CR_NCHAR   -1
#define REPLACE_FLAG   0x40
#define REPLACE_NL_NCHAR   -2
#define ROOT_UID   0
#define RUNTIME_DIRNAME   "runtime"
#define SELECTMODE   0x1000
#define SESSION_FILE   "Session.vim"
#define SETWSIZE   0x400
#define SHOWCMD_COLS   10
#define SHOWMATCH   (0x700 + INSERT)
#define STATUS_HEIGHT   1
#define STL_MAX_ITEM   80
#define STRCAT (   d,
  s 
)    strcat((char *)(d), (char *)(s))
#define STRCMP (   d,
  s 
)    strcmp((char *)(d), (char *)(s))
#define STRCPY (   d,
  s 
)    strcpy((char *)(d), (char *)(s))
#define STRICMP (   d,
  s 
)    vim_stricmp((char *)(d), (char *)(s))
#define STRLCAT (   d,
  s,
  n 
)    xstrlcat((char *)(d), (char *)(s), (size_t)(n))
#define STRLCPY (   d,
  s,
  n 
)    xstrlcpy((char *)(d), (char *)(s), (size_t)(n))
#define STRLEN (   s)    strlen((char *)(s))
#define STRMOVE (   d,
  s 
)    memmove((d), (s), STRLEN(s) + 1)
#define STRNCAT (   d,
  s,
  n 
)    strncat((char *)(d), (char *)(s), (size_t)(n))
#define STRNCMP (   d,
  s,
  n 
)    strncmp((char *)(d), (char *)(s), (size_t)(n))
#define STRNCPY (   d,
  s,
  n 
)    strncpy((char *)(d), (char *)(s), (size_t)(n))
#define STRNICMP (   d,
  s,
  n 
)    vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))
#define STRRCHR (   s,
 
)    (char_u *)strrchr((const char *)(s), (c))
#define SYS_OPTWIN_FILE   "$VIMRUNTIME/optwin.vim"
#define TERM_FOCUS   0x2000
#define TRUE   1
#define UNDO_HASH_SIZE   32
#define VAR_TYPE_BOOL   6
#define VAR_TYPE_DICT   4
#define VAR_TYPE_FLOAT   5
#define VAR_TYPE_FUNC   2
#define VAR_TYPE_LIST   3
#define VAR_TYPE_NUMBER   0
#define VAR_TYPE_STRING   1
#define vim_strpbrk (   s,
  cs 
)    (char_u *)strpbrk((char *)(s), (char *)(cs))
#define VISUAL   0x02
#define VREPLACE   (REPLACE_FLAG + VREPLACE_FLAG + INSERT)
#define VREPLACE_FLAG   0x80

Enumeration Type Documentation

anonymous enum

length of a buffer to store a number in ASCII (64 bits binary + NUL)

Enumerator
NUMBUFLEN 
anonymous enum
Enumerator
EXPAND_UNSUCCESSFUL 
EXPAND_OK 
EXPAND_NOTHING 
EXPAND_COMMANDS 
EXPAND_FILES 
EXPAND_DIRECTORIES 
EXPAND_SETTINGS 
EXPAND_BOOL_SETTINGS 
EXPAND_TAGS 
EXPAND_OLD_SETTING 
EXPAND_HELP 
EXPAND_BUFFERS 
EXPAND_EVENTS 
EXPAND_MENUS 
EXPAND_SYNTAX 
EXPAND_HIGHLIGHT 
EXPAND_AUGROUP 
EXPAND_USER_VARS 
EXPAND_MAPPINGS 
EXPAND_TAGS_LISTFILES 
EXPAND_FUNCTIONS 
EXPAND_USER_FUNC 
EXPAND_EXPRESSION 
EXPAND_MENUNAMES 
EXPAND_USER_COMMANDS 
EXPAND_USER_CMD_FLAGS 
EXPAND_USER_NARGS 
EXPAND_USER_COMPLETE 
EXPAND_ENV_VARS 
EXPAND_LANGUAGE 
EXPAND_COLORS 
EXPAND_COMPILER 
EXPAND_USER_DEFINED 
EXPAND_USER_LIST 
EXPAND_SHELLCMD 
EXPAND_CSCOPE 
EXPAND_SIGN 
EXPAND_PROFILE 
EXPAND_BEHAVE 
EXPAND_FILETYPE 
EXPAND_FILES_IN_PATH 
EXPAND_OWNSYNTAX 
EXPAND_LOCALES 
EXPAND_HISTORY 
EXPAND_USER 
EXPAND_SYNTIME 
EXPAND_USER_ADDR_TYPE 
EXPAND_PACKADD 
EXPAND_MESSAGES 
EXPAND_MAPCLEAR 
EXPAND_ARGLIST 
EXPAND_CHECKHEALTH 
anonymous enum
Enumerator
FOLD_TEXT_LEN 
enum Direction

Directions.

Enumerator
kDirectionNotSet 
FORWARD 
BACKWARD 
FORWARD_FILE 
BACKWARD_FILE