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/path.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 VAR_TYPE_SPECIAL   7
 
#define VAR_TYPE_BLOB   10
 
#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 CLEAR_POINTER(ptr)   memset((ptr), 0, sizeof(*(ptr)))
 
#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 AUTOLOAD_CHAR   '#'
 
#define PERROR(msg)   (void) emsgf("%s: %s", msg, strerror(errno))
 
#define SHOWCMD_COLS   10
 
#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 DIP_LUA   0x100
 
#define DIP_DIRFILE   0x200
 
#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_DIFF_BUFFERS,
  EXPAND_CHECKHEALTH, EXPAND_LUA
}
 
enum  { FOLD_TEXT_LEN = 51 }
 

Macro Definition Documentation

◆ ABBREV

#define ABBREV   0x500

◆ ASKMORE

#define ASKMORE   0x300

◆ AUTOLOAD_CHAR

#define AUTOLOAD_CHAR   '#'

◆ CLEAR_POINTER

#define CLEAR_POINTER (   ptr)    memset((ptr), 0, sizeof(*(ptr)))

◆ CMDBUFFSIZE

#define CMDBUFFSIZE   256

◆ CMDLINE

#define CMDLINE   0x08

◆ CMDPREVIEW

#define CMDPREVIEW   0x4000

◆ CONFIRM

#define CONFIRM   0x800

◆ DIALOG_MSG_SIZE

#define DIALOG_MSG_SIZE   1000

◆ DIP_AFTER

#define DIP_AFTER   0x80

◆ DIP_ALL

#define DIP_ALL   0x01

◆ DIP_DIR

#define DIP_DIR   0x02

◆ DIP_DIRFILE

#define DIP_DIRFILE   0x200

◆ DIP_ERR

#define DIP_ERR   0x04

◆ DIP_LUA

#define DIP_LUA   0x100

◆ DIP_NOAFTER

#define DIP_NOAFTER   0x40

◆ DIP_NORTP

#define DIP_NORTP   0x20

◆ DIP_OPT

#define DIP_OPT   0x10

◆ DIP_START

#define DIP_START   0x08

◆ EXTERNCMD

#define EXTERNCMD   0x600

◆ FAIL

#define FAIL   0

◆ FALSE

#define FALSE   0

◆ fnamecmp

#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 algorithm 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.

◆ fnamencmp

#define fnamencmp (   x,
  y,
  n 
)
Value:
path_fnamencmp((const char *)(x), \
(const char *)(y), \
(size_t)(n))

◆ HAVE_PATHDEF

#define HAVE_PATHDEF

◆ HITRETURN

#define HITRETURN   (0x200 + NORMAL)

◆ HL_ATTR

#define HL_ATTR (   n)    highlight_attr[(int)(n)]

◆ INSERT

#define INSERT   0x10

◆ LANGMAP

#define LANGMAP   0x20

◆ LOWEST_WIN_ID

#define LOWEST_WIN_ID   1000

◆ LREPLACE

#define LREPLACE   (REPLACE_FLAG + LANGMAP)

◆ LSIZE

#define LSIZE   512

◆ MAP_ALL_MODES

#define MAP_ALL_MODES   (0x3f | SELECTMODE | TERM_FOCUS)

◆ MAX_MSG_HIST_LEN

#define MAX_MSG_HIST_LEN   200

◆ MAX_SWAP_PAGE_SIZE

#define MAX_SWAP_PAGE_SIZE   50000

◆ MAX_TYPENR

#define MAX_TYPENR   65535

◆ MAXMAPLEN

#define MAXMAPLEN   50

◆ MAYBE

#define MAYBE   2

◆ MB_MAXBYTES

#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.

◆ mch_errmsg

#define mch_errmsg (   str)    fprintf(stderr, "%s", (str))

◆ mch_msg

#define mch_msg (   str)    printf("%s", (str))

◆ MIN_SWAP_PAGE_SIZE

#define MIN_SWAP_PAGE_SIZE   1048

◆ MSG_HIST

#define MSG_HIST   0x1000

◆ NORMAL

#define NORMAL   0x01

◆ NORMAL_BUSY

#define NORMAL_BUSY   (0x100 + NORMAL)

◆ NOTDONE

#define NOTDONE   2

◆ OK

#define OK   1

◆ OP_PENDING

#define OP_PENDING   0x04

◆ PERROR

#define PERROR (   msg)    (void) emsgf("%s: %s", msg, strerror(errno))

◆ QF_WINHEIGHT

#define QF_WINHEIGHT   10

◆ REPLACE

#define REPLACE   (REPLACE_FLAG + INSERT)

◆ REPLACE_CR_NCHAR

#define REPLACE_CR_NCHAR   -1

◆ REPLACE_FLAG

#define REPLACE_FLAG   0x40

◆ REPLACE_NL_NCHAR

#define REPLACE_NL_NCHAR   -2

◆ ROOT_UID

#define ROOT_UID   0

◆ RUNTIME_DIRNAME

#define RUNTIME_DIRNAME   "runtime"

◆ SELECTMODE

#define SELECTMODE   0x1000

◆ SESSION_FILE

#define SESSION_FILE   "Session.vim"

◆ SETWSIZE

#define SETWSIZE   0x400

◆ SHOWCMD_COLS

#define SHOWCMD_COLS   10

◆ SHOWMATCH

#define SHOWMATCH   (0x700 + INSERT)

◆ STATUS_HEIGHT

#define STATUS_HEIGHT   1

◆ STRCAT

#define STRCAT (   d,
  s 
)    strcat((char *)(d), (char *)(s))

◆ STRCMP

#define STRCMP (   d,
  s 
)    strcmp((char *)(d), (char *)(s))

◆ STRCPY

#define STRCPY (   d,
  s 
)    strcpy((char *)(d), (char *)(s))

◆ STRICMP

#define STRICMP (   d,
  s 
)    vim_stricmp((char *)(d), (char *)(s))

◆ STRLCAT

#define STRLCAT (   d,
  s,
  n 
)    xstrlcat((char *)(d), (char *)(s), (size_t)(n))

◆ STRLCPY

#define STRLCPY (   d,
  s,
  n 
)    xstrlcpy((char *)(d), (char *)(s), (size_t)(n))

◆ STRLEN

#define STRLEN (   s)    strlen((char *)(s))

◆ STRMOVE

#define STRMOVE (   d,
  s 
)    memmove((d), (s), STRLEN(s) + 1)

◆ STRNCAT

#define STRNCAT (   d,
  s,
  n 
)    strncat((char *)(d), (char *)(s), (size_t)(n))

◆ STRNCMP

#define STRNCMP (   d,
  s,
  n 
)    strncmp((char *)(d), (char *)(s), (size_t)(n))

◆ STRNCPY

#define STRNCPY (   d,
  s,
  n 
)    strncpy((char *)(d), (char *)(s), (size_t)(n))

◆ STRNICMP

#define STRNICMP (   d,
  s,
  n 
)    vim_strnicmp((char *)(d), (char *)(s), (size_t)(n))

◆ STRRCHR

#define STRRCHR (   s,
 
)    (char_u *)strrchr((const char *)(s), (c))

◆ SYS_OPTWIN_FILE

#define SYS_OPTWIN_FILE   "$VIMRUNTIME/optwin.vim"

◆ TERM_FOCUS

#define TERM_FOCUS   0x2000

◆ TRUE

#define TRUE   1

◆ UNDO_HASH_SIZE

#define UNDO_HASH_SIZE   32

◆ VAR_TYPE_BLOB

#define VAR_TYPE_BLOB   10

◆ VAR_TYPE_BOOL

#define VAR_TYPE_BOOL   6

◆ VAR_TYPE_DICT

#define VAR_TYPE_DICT   4

◆ VAR_TYPE_FLOAT

#define VAR_TYPE_FLOAT   5

◆ VAR_TYPE_FUNC

#define VAR_TYPE_FUNC   2

◆ VAR_TYPE_LIST

#define VAR_TYPE_LIST   3

◆ VAR_TYPE_NUMBER

#define VAR_TYPE_NUMBER   0

◆ VAR_TYPE_SPECIAL

#define VAR_TYPE_SPECIAL   7

◆ VAR_TYPE_STRING

#define VAR_TYPE_STRING   1

◆ vim_strpbrk

#define vim_strpbrk (   s,
  cs 
)    (char_u *)strpbrk((char *)(s), (char *)(cs))

◆ VISUAL

#define VISUAL   0x02

◆ VREPLACE

#define VREPLACE   (REPLACE_FLAG + VREPLACE_FLAG + INSERT)

◆ VREPLACE_FLAG

#define VREPLACE_FLAG   0x80

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Enumerator
NUMBUFLEN 

◆ anonymous enum

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_DIFF_BUFFERS 
EXPAND_CHECKHEALTH 
EXPAND_LUA 

◆ anonymous enum

anonymous enum
Enumerator
FOLD_TEXT_LEN 

◆ Direction

enum Direction

Directions.

Enumerator
kDirectionNotSet 
FORWARD 
BACKWARD 
FORWARD_FILE 
BACKWARD_FILE 
n
int n
Definition: funcs.c:8392
path_fnamencmp
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:351