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
00062 enum
00063 {
00065 HOME_DIRECTORY = EXPAND_RESERVED,
00066
00068 PROCESS_EXPAND,
00069
00071 VARIABLE_EXPAND,
00072
00074 VARIABLE_EXPAND_SINGLE,
00075
00077 BRACKET_BEGIN,
00078
00080 BRACKET_END,
00081
00083 BRACKET_SEP,
00087 INTERNAL_SEPARATOR,
00088
00089 }
00090 ;
00091
00092
00096 enum
00097 {
00099 EXPAND_ERROR,
00101 EXPAND_OK,
00103 EXPAND_WILDCARD_NO_MATCH,
00104
00105 EXPAND_WILDCARD_MATCH
00106 }
00107 ;
00108
00110 #define ARRAY_SEP 0x1e
00111
00113 #define ARRAY_SEP_STR L"\x1e"
00114
00118 #define ARRAY_BOUNDS_ERR _(L"Array index out of bounds")
00119
00120
00142 __warn_unused int expand_string( void *context, wchar_t *in, array_list_t *out, int flag );
00143
00157 wchar_t *expand_one( void *context, wchar_t *in, int flag );
00158
00164 wchar_t *expand_escape_variable( const wchar_t *in );
00165
00174 wchar_t *expand_tilde(wchar_t *in);
00175
00176
00188 int expand_is_clean( const wchar_t *in );
00189
00200 void expand_variable_error( const wchar_t *token, int token_pos, int error_pos );
00201
00202
00203 #endif