robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
38986188ba
master
1#pragma once 2 3#include <stdbool.h> 4#include <stdint.h> 5 6#include "nvim/option_vars.h" 7#include "nvim/strings.h" // IWYU pragma: keep 8 9/// Flags for vim_str2nr() 10typedef enum { 11STR2NR_DEC = 0 , 12STR2NR_BIN = (1 <<0 ),///< Allow binary numbers. 13STR2NR_OCT = (1 <<1 ),///< Allow octal numbers. 14STR2NR_HEX = (1 <<2 ),///< Allow hexadecimal numbers. 15STR2NR_OOCT = (1 <<3 ),///< Octal with prefix "0o": 0o777 16/// Force one of the above variants. 17/// 18/// STR2NR_FORCE|STR2NR_DEC is actually not different from supplying zero 19/// as flags, but still present for completeness. 20/// 21/// STR2NR_FORCE|STR2NR_OCT|STR2NR_OOCT is the same as STR2NR_FORCE|STR2NR_OCT 22/// or STR2NR_FORCE|STR2NR_OOCT. 23STR2NR_FORCE = (1 <<7 ), 24/// Recognize all formats vim_str2nr() can recognize. 25STR2NR_ALL = STR2NR_BIN |STR2NR_OCT |STR2NR_HEX |STR2NR_OOCT , 26/// Disallow octals numbers without the 0o prefix. 27STR2NR_NO_OCT = STR2NR_BIN |STR2NR_HEX |STR2NR_OOCT , 28STR2NR_QUOTE = (1 <<4 ),///< Ignore embedded single quotes. 29}ChStr2NrFlags ; 30 31#include "charset.h.generated.h" 32#include "charset.h.inline.generated.h" 33 34/// Check if `c` is one of the characters in 'breakat'. 35/// Used very often if 'linebreak' is set 36static inline bool vim_isbreak (int c ) 37FUNC_ATTR_CONST FUNC_ATTR_ALWAYS_INLINE 38{ 39return breakat_flags [(uint8_t )c ]; 40}