robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f0a0182285
master
1#pragma once 2 3#include <stddef.h> // IWYU pragma: keep 4 5#include "nvim/api/private/defs.h" // IWYU pragma: keep 6#include "nvim/garray_defs.h" // IWYU pragma: keep 7#include "nvim/types_defs.h" // IWYU pragma: keep 8 9/// Flags for expand_wildcards() 10enum { 11EW_DIR = 0x01 ,///< include directory names 12EW_FILE = 0x02 ,///< include file names 13EW_NOTFOUND = 0x04 ,///< include not found names 14EW_ADDSLASH = 0x08 ,///< append slash to directory name 15EW_KEEPALL = 0x10 ,///< keep all matches 16EW_SILENT = 0x20 ,///< don't print "1 returned" from shell 17EW_EXEC = 0x40 ,///< executable files 18EW_PATH = 0x80 ,///< search in 'path' too 19EW_ICASE = 0x100 ,///< ignore case 20EW_NOERROR = 0x200 ,///< no error for bad regexp 21EW_NOTWILD = 0x400 ,///< add match with literal name if exists 22EW_KEEPDOLLAR = 0x800 ,///< do not escape $, $var is expanded 23EW_ALLLINKS = 0x1000 ,///< also links not pointing to existing file 24EW_SHELLCMD = 0x2000 ,///< called from expand_shellcmd(), don't check 25///< if executable is in $PATH 26EW_DODOT = 0x4000 ,///< also files starting with a dot 27EW_EMPTYOK = 0x8000 ,///< no matches is not an error 28EW_NOTENV = 0x10000 ,///< do not expand environment variables 29EW_CDPATH = 0x20000 ,///< search in 'cdpath' too 30EW_NOBREAK = 0x40000 ,///< do not invoke breakcheck 31}; 32// Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND 33// is used when executing commands and EW_SILENT for interactive expanding. 34 35/// path_equal() flags 36typedef enum { 37kPathCmpLiteral = 1 <<0 ,///< Compare paths literally. 38kPathCmpExpand = 1 <<1 ,///< Expand env vars in the first path. 39kPathCmpFull = 1 <<2 ,///< Compare full names when FileIds are unavailable. 40}PathCmpFlags ; 41 42#ifdef BACKSLASH_IN_FILENAME 43# define TO_SLASH (p ) path_to_slash(p) 44# define TO_SLASH_SAVE (p ) path_to_slash_save(p) 45# define TO_BACKSLASH (p ) path_to_backslash(p) 46#else 47# define TO_SLASH (...) 48# define TO_SLASH_SAVE (p ) xstrdup(p) 49# define TO_BACKSLASH (...) 50#endif 51 52#ifdef MSWIN 53# define PATH_ESC_WILDCARDS "*?[" 54# define PATH_ALL_WILDCARDS "*?[`$" 55#else 56# define PATH_ESC_WILDCARDS "*?[{" 57# define PATH_ALL_WILDCARDS "*?[{`'$" 58#endif 59 60#include "path.h.generated.h"