diff options
Diffstat (limited to 'src/nvim/ascii.h')
-rw-r--r-- | src/nvim/ascii.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h index 2b3e94d5a0..9938d1b328 100644 --- a/src/nvim/ascii.h +++ b/src/nvim/ascii.h @@ -122,6 +122,14 @@ static inline bool ascii_isxdigit(int c) || (c >= 'A' && c <= 'F'); } +/// Checks if `c` is a binary digit, that is, 0-1. +/// +/// @see {ascii_isdigit} +static inline bool ascii_isbdigit(int c) +{ + return (c == '0' || c == '1'); +} + /// Checks if `c` is a white-space character, that is, /// one of \f, \n, \r, \t, \v. /// |