diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2014-10-23 08:48:45 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-12-17 15:25:24 +0200 |
commit | beda81512afdcf16432ebd5b76930392f427a7fc (patch) | |
tree | 7c92a795bb3b1e43b5242dd64c67e450fcf5585b /src/wordsplit.h | |
parent | 2d4c689ad13b663ab80a82cf139a3b779a8d28ec (diff) | |
download | grecs-beda81512afdcf16432ebd5b76930392f427a7fc.tar.gz grecs-beda81512afdcf16432ebd5b76930392f427a7fc.tar.bz2 |
wordsplit: implement command expansion
* src/wordsplit.c (wordsplit_init): Change handling of lacking
WRDSF_NOCMD.
(find_closing_cbrace): Rename to find_closing_paren, take additional
argument. All uses changed.
(node_expand_vars): Rewrite as a generalized function node_expand.
(wordsplit_varexp): Use node_expand.
(expcmd, wordsplit_cmdexp): New functions.
(scan_word): Handle $(command) notation
(wordsplit_process_list): Command expansion.
* src/wordsplit.h (wordsplit) <ws_command>: New member.
* tests/wsp.c (wsp_runcmd): New function.
(main): Set ws_command unless WRDSF_NOCMD flag is set.
Diffstat (limited to 'src/wordsplit.h')
-rw-r--r-- | src/wordsplit.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wordsplit.h b/src/wordsplit.h index 682c57e..96088f9 100644 --- a/src/wordsplit.h +++ b/src/wordsplit.h @@ -39,6 +39,8 @@ struct wordsplit char *(*ws_getvar) (const char *, size_t, void *); void *ws_closure; + char *(*ws_command) (const char *, size_t, struct wordsplit const *); + const char *ws_input; size_t ws_len; size_t ws_endp; |