diff options
author | 2006-01-31 02:51:50 +1000 | |
---|---|---|
committer | 2006-01-31 02:51:50 +1000 | |
commit | 521d09b6d0264aaac17b9359ebcb1a0cb6ca8906 (patch) | |
tree | 7297a413ff9a5d020c1691e7727e3b22a0bc8175 /parse_util.h | |
parent | 3efb0bf5cf7b799b8df039e4fa3dd593248dc415 (diff) |
Add support for calculating completions for arbitrary commands through the 'complete' builtin
darcs-hash:20060130165150-ac50b-5e2ef3bb0298dd5e1a5d6fbdade314cc73ef36f3.gz
Diffstat (limited to 'parse_util.h')
-rw-r--r-- | parse_util.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/parse_util.h b/parse_util.h new file mode 100644 index 00000000..30f47ef8 --- /dev/null +++ b/parse_util.h @@ -0,0 +1,50 @@ +/** \file parse_util.h + + Various utility functions for parsing a command +*/ + +#ifndef FISH_PARSE_UTIL_H +#define FISH_PARSE_UTIL_H + +#include <wchar.h> + +/** + Locate the first subshell in the specified string. + + \param in the string to search for subshells + \param begin the starting paranthesis of the subshell + \param end the ending paranthesis of the subshell + \param flags set this variable to ACCEPT_INCOMPLETE if in tab_completion mode + \return -1 on syntax error, 0 if no subshells exist and 1 on sucess +*/ + +int parse_util_locate_cmdsubst( const wchar_t *in, + const wchar_t **begin, + const wchar_t **end, + int allow_incomplete ); + + +void parse_util_cmdsubst_extent( const wchar_t *buff, + int cursor_pos, + const wchar_t **a, + const wchar_t **b ); + +void parse_util_process_extent( const wchar_t *buff, + int pos, + const wchar_t **a, + const wchar_t **b ); + + +void parse_util_job_extent( const wchar_t *buff, + int pos, + const wchar_t **a, + const wchar_t **b ); + +void parse_util_token_extent( const wchar_t *buff, + int cursor_pos, + const wchar_t **tok_begin, + const wchar_t **tok_end, + const wchar_t **prev_begin, + const wchar_t **prev_end ); + +#endif |