00001
00012 #ifndef FISH_EXPAND_H
00013
00016 #define FISH_EXPAND_H
00017
00018 #include <wchar.h>
00019
00020 #include "util.h"
00021
00025 #define EXPAND_SKIP_CMDSUBST 1
00026
00030 #define EXPAND_SKIP_VARIABLES 2
00031
00035 #define EXPAND_SKIP_WILDCARDS 4
00036
00043 #define ACCEPT_INCOMPLETE 8
00044
00049 #define EXECUTABLES_ONLY 16
00050
00055 #define DIRECTORIES_ONLY 32
00056
00060 #define EXPAND_RESERVED 0xf000
00061
00064 #define EXPAND_RESERVED_END 0xf000f
00065
00066 enum
00067 {
00069 HOME_DIRECTORY = EXPAND_RESERVED,
00070
00072 PROCESS_EXPAND,
00073
00075 VARIABLE_EXPAND,
00076
00078 VARIABLE_EXPAND_SINGLE,
00079
00081 BRACKET_BEGIN,
00082
00084 BRACKET_END,
00085
00087 BRACKET_SEP,
00091 INTERNAL_SEPARATOR,
00092
00093 }
00094 ;
00095
00096
00100 enum
00101 {
00103 EXPAND_ERROR,
00105 EXPAND_OK,
00107 EXPAND_WILDCARD_NO_MATCH,
00108
00109 EXPAND_WILDCARD_MATCH
00110 }
00111 ;
00112
00114 #define ARRAY_SEP 0x1e
00115
00117 #define ARRAY_SEP_STR L"\x1e"
00118
00122 #define ARRAY_BOUNDS_ERR _(L"Array index out of bounds")
00123
00124
00146 __warn_unused int expand_string( void *context, wchar_t *in, array_list_t *out, int flag );
00147
00161 wchar_t *expand_one( void *context, wchar_t *in, int flag );
00162
00168 wchar_t *expand_escape_variable( const wchar_t *in );
00169
00178 wchar_t *expand_tilde(wchar_t *in);
00179
00180
00192 int expand_is_clean( const wchar_t *in );
00193
00204 void expand_variable_error( const wchar_t *token, int token_pos, int error_pos );
00205
00206
00207 #endif