#include "auto/config.h"
Go to the source code of this file.
|
#define | EXTERN extern |
|
#define | INIT(...) |
|
#define | MIN(X, Y) ((X) < (Y) ? (X) : (Y)) |
|
#define | MAX(X, Y) ((X) > (Y) ? (X) : (Y)) |
|
#define | S_LEN(s) (s), (sizeof(s) - 1) |
|
#define | LINEEMPTY(p) (*ml_get(p) == NUL) |
| LINEEMPTY() - return TRUE if the line is empty. More...
|
|
#define | TOUPPER_LOC toupper |
|
#define | TOLOWER_LOC tolower |
|
#define | TOUPPER_ASC(c) (((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A')) |
|
#define | TOLOWER_ASC(c) (((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A')) |
|
#define | ASCII_ISLOWER(c) ((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z') |
|
#define | ASCII_ISUPPER(c) ((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z') |
|
#define | ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c)) |
|
#define | ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || ascii_isdigit(c)) |
|
#define | EMPTY_IF_NULL(x) (char *)((x) ? (x) : (char_u *)"") |
|
#define | LANGMAP_ADJUST(c, condition) |
|
#define | WRITEBIN "wb" |
|
#define | READBIN "rb" |
|
#define | APPENDBIN "ab" |
|
#define | MCH_OPEN_RW(n, f) os_open((n), (f), 0) |
|
#define | REPLACE_NORMAL(s) (((s) & REPLACE_FLAG) && !((s) & VREPLACE_FLAG)) |
|
#define | MB_PTR_ADV(p) (p += utfc_ptr2len((char *)p)) |
|
#define | MB_CPTR_ADV(p) (p += utf_ptr2len((char *)p)) |
|
#define | MB_PTR_BACK(s, p) (p -= utf_head_off((char_u *)(s), (char_u *)(p) - 1) + 1) |
|
#define | MB_CHAR2BYTES(c, b) ((b) += utf_char2bytes((c), ((char *)b))) |
|
#define | RESET_BINDING(wp) |
|
#define | ARRAY_SIZE(arr) |
|
#define | ARRAY_LAST_ENTRY(arr) (arr)[ARRAY_SIZE(arr) - 1] |
|
#define | RGB_(r, g, b) (((r) << 16) | ((g) << 8) | (b)) |
|
#define | STR_(x) #x |
|
#define | STR(x) STR_(x) |
|
#define | NVIM_HAS_INCLUDE(x) 0 |
|
#define | NVIM_HAS_ATTRIBUTE(x) 0 |
|
#define | FALLTHROUGH |
|
#define | STRUCT_CAST(Type, obj) ((Type *)(obj)) |
|
#define | UV_BUF_LEN(x) (x) |
|
#define | IO_COUNT(x) (x) |
|
#define | PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES |
|
#define | PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH |
|
#define | PRAGMA_DIAG_POP |
|
#define | EMPTY_POS(a) ((a).lnum == 0 && (a).col == 0 && (a).coladd == 0) |
|
◆ APPENDBIN
◆ ARRAY_LAST_ENTRY
#define ARRAY_LAST_ENTRY |
( |
|
arr | ) |
(arr)[ARRAY_SIZE(arr) - 1] |
Get last array entry
This should be called with a real array. Calling this with a pointer is an error.
◆ ARRAY_SIZE
#define ARRAY_SIZE |
( |
|
arr | ) |
|
Value: ((sizeof(arr)/sizeof((arr)[0])) \
/ ((size_t)(!(sizeof(arr) % sizeof((arr)[0])))))
Calculate the length of a C array
This should be called with a real array. Calling this with a pointer is an error. A mechanism to detect many (though not all) of those errors at compile time is implemented. It works by the second division producing a division by zero in those cases (-Wdiv-by-zero in GCC).
-V:ARRAY_SIZE:1063
◆ ASCII_ISALNUM
#define ASCII_ISALNUM |
( |
|
c | ) |
(ASCII_ISALPHA(c) || ascii_isdigit(c)) |
◆ ASCII_ISALPHA
◆ ASCII_ISLOWER
#define ASCII_ISLOWER |
( |
|
c | ) |
((unsigned)(c) >= 'a' && (unsigned)(c) <= 'z') |
◆ ASCII_ISUPPER
#define ASCII_ISUPPER |
( |
|
c | ) |
((unsigned)(c) >= 'A' && (unsigned)(c) <= 'Z') |
◆ EMPTY_IF_NULL
#define EMPTY_IF_NULL |
( |
|
x | ) |
(char *)((x) ? (x) : (char_u *)"") |
◆ EMPTY_POS
#define EMPTY_POS |
( |
|
a | ) |
((a).lnum == 0 && (a).col == 0 && (a).coladd == 0) |
◆ EXTERN
◆ FALLTHROUGH
◆ INIT
◆ IO_COUNT
#define IO_COUNT |
( |
|
x | ) |
(x) |
◆ LANGMAP_ADJUST
#define LANGMAP_ADJUST |
( |
|
c, |
|
|
|
condition |
|
) |
| |
Value: do { \
&& (condition) \
&& (c) >= 0) \
{ \
if ((c) < 256) \
else \
} \
} while (0)
Adjust chars in a language according to 'langmap' option. NOTE that there is no noticeable overhead if 'langmap' is not set. When set the overhead for characters < 256 is small. Don't apply 'langmap' if the character comes from the Stuff buffer or from a mapping and the langnoremap option was set. The do-while is just to ignore a ';' after the macro.
-V:LANGMAP_ADJUST:560
◆ LINEEMPTY
◆ MAX
#define MAX |
( |
|
X, |
|
|
|
Y |
|
) |
| ((X) > (Y) ? (X) : (Y)) |
◆ MB_CHAR2BYTES
#define MB_CHAR2BYTES |
( |
|
c, |
|
|
|
b |
|
) |
| ((b) += utf_char2bytes((c), ((char *)b))) |
◆ MB_CPTR_ADV
◆ MB_PTR_ADV
◆ MB_PTR_BACK
◆ MCH_OPEN_RW
#define MCH_OPEN_RW |
( |
|
n, |
|
|
|
f |
|
) |
| os_open((n), (f), 0) |
◆ MIN
#define MIN |
( |
|
X, |
|
|
|
Y |
|
) |
| ((X) < (Y) ? (X) : (Y)) |
◆ NVIM_HAS_ATTRIBUTE
#define NVIM_HAS_ATTRIBUTE |
( |
|
x | ) |
0 |
◆ NVIM_HAS_INCLUDE
#define NVIM_HAS_INCLUDE |
( |
|
x | ) |
0 |
◆ PRAGMA_DIAG_POP
◆ PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH
#define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH |
◆ PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
#define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES |
PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
◆ READBIN
◆ REPLACE_NORMAL
◆ RESET_BINDING
#define RESET_BINDING |
( |
|
wp | ) |
|
◆ RGB_
#define RGB_ |
( |
|
r, |
|
|
|
g, |
|
|
|
b |
|
) |
| (((r) << 16) | ((g) << 8) | (b)) |
◆ S_LEN
#define S_LEN |
( |
|
s | ) |
(s), (sizeof(s) - 1) |
String with length
For use in functions which accept (char *s, size_t len) pair in arguments.
- Parameters
-
- Returns
s, sizeof(s) - 1
◆ STR
◆ STR_
◆ STRUCT_CAST
#define STRUCT_CAST |
( |
|
Type, |
|
|
|
obj |
|
) |
| ((Type *)(obj)) |
Change type of structure pointers: cast struct a *
to struct b *
Used to silence PVS errors.
- Parameters
-
Type | Structure to cast to. |
obj | Object to cast. |
- Returns
- ((Type *)obj).
◆ TOLOWER_ASC
#define TOLOWER_ASC |
( |
|
c | ) |
(((c) < 'A' || (c) > 'Z') ? (c) : (c) + ('a' - 'A')) |
◆ TOLOWER_LOC
#define TOLOWER_LOC tolower |
◆ TOUPPER_ASC
#define TOUPPER_ASC |
( |
|
c | ) |
(((c) < 'a' || (c) > 'z') ? (c) : (c) - ('a' - 'A')) |
◆ TOUPPER_LOC
#define TOUPPER_LOC toupper |
◆ UV_BUF_LEN
#define UV_BUF_LEN |
( |
|
x | ) |
(x) |
◆ WRITEBIN
int langmap_adjust_mb(int c)
Apply 'langmap' to multi-byte character "c" and return the result.
Definition: option.c:7101