Lines Matching refs:input
3183 static int i_getch_and_eat_bkslash_nl(struct in_str *input)
3188 ch = i_getch(input);
3191 ch2 = i_peek(input);
3195 i_getch(input);
3202 static int i_peek_and_eat_bkslash_nl(struct in_str *input)
3207 ch = i_peek(input);
3210 ch2 = i_peek2(input);
3214 i_getch(input);
3215 i_getch(input);
4659 #define parse_redir_right_fd(as_string, input) \
4660 parse_redir_right_fd(input)
4662 static int parse_redir_right_fd(o_string *as_string, struct in_str *input)
4666 ch = i_peek(input);
4670 ch = i_getch(input); /* get the & */
4672 ch = i_peek(input);
4674 ch = i_getch(input);
4683 ch = i_getch(input);
4685 ch = i_peek(input);
4700 struct in_str *input)
4710 dup_num = parse_redir_right_fd(&ctx->as_string, input);
4714 int ch = i_peek_and_eat_bkslash_nl(input);
4717 ch = i_getch(input);
4719 ch = i_peek(input);
4724 int ch = i_peek_and_eat_bkslash_nl(input);
4730 ch = i_getch(input);
4804 #define fetch_till_str(as_string, input, word, skip_tabs) \
4805 fetch_till_str(input, word, skip_tabs)
4808 struct in_str *input,
4828 ch = i_getch(input);
4854 ch = i_getch(input);
4904 #define fetch_heredocs(as_string, pi, heredoc_cnt, input) \
4905 fetch_heredocs(pi, heredoc_cnt, input)
4907 …tic int fetch_heredocs(o_string *as_string, struct pipe *pi, int heredoc_cnt, struct in_str *input)
4931 p = fetch_till_str(as_string, input,
4946 heredoc_cnt = fetch_heredocs(as_string, cmd->group, heredoc_cnt, input);
4960 #define parse_stream(pstring, heredoc_cnt_ptr, input, end_trigger) \
4961 parse_stream(heredoc_cnt_ptr, input, end_trigger)
4965 struct in_str *input,
4972 struct in_str *input, int ch)
5001 ch = i_getch(input);
5009 ch = i_getch(input);
5051 ch = i_peek(input);
5059 ch = i_getch(input);
5065 pipe_list = parse_stream(&as_string, &heredoc_cnt, input, endch);
5120 static int add_till_single_quote(o_string *dest, struct in_str *input)
5123 int ch = i_getch(input);
5133 static int add_till_single_quote_dquoted(o_string *dest, struct in_str *input)
5136 int ch = i_getch(input);
5148 static int add_till_backquote(o_string *dest, struct in_str *input, int in_dquote);
5149 static int add_till_double_quote(o_string *dest, struct in_str *input)
5152 int ch = i_getch(input);
5161 ch = i_getch(input);
5165 if (!add_till_backquote(dest, input, /*in_dquote:*/ 1))
5188 static int add_till_backquote(o_string *dest, struct in_str *input, int in_dquote)
5191 int ch = i_getch(input);
5196 ch = i_getch(input);
5230 static int add_till_closing_bracket(o_string *dest, struct in_str *input, unsigned end_ch)
5245 ch = i_getch(input);
5258 if (i_peek_and_eat_bkslash_nl(input) == end_ch) {
5259 i_getch(input); /* eat second ')' */
5267 if (!add_till_closing_bracket(dest, input, ch))
5273 if (!add_till_single_quote(dest, input))
5279 if (!add_till_double_quote(dest, input))
5285 if (!add_till_backquote(dest, input, /*in_dquote:*/ 0))
5292 ch = i_getch(input);
5317 #define parse_dollar_squote(as_string, dest, input) \
5318 parse_dollar_squote(dest, input)
5321 static int parse_dollar_squote(o_string *as_string, o_string *dest, struct in_str *input)
5324 int ch = i_peek_and_eat_bkslash_nl(input); /* first character after the $ */
5332 ch = i_getch(input); /* eat ' */
5335 ch = i_getch(input);
5351 ch = i_getch(input);
5361 ch = i_peek(input);
5364 *++p = ch = i_getch(input);
5369 ch = i_peek(input);
5372 *++p = ch = i_getch(input);
5406 # define parse_dollar_squote(as_string, dest, input) 0
5412 #define parse_dollar(as_string, dest, input, quote_mask) \
5413 parse_dollar(dest, input, quote_mask)
5418 struct in_str *input, unsigned char quote_mask)
5420 int ch = i_peek_and_eat_bkslash_nl(input); /* first character after the $ */
5425 ch = i_getch(input);
5433 ch = i_peek_and_eat_bkslash_nl(input);
5438 ch = i_getch(input);
5444 ch = i_getch(input);
5466 ch = i_getch(input); /* eat '{' */
5469 ch = i_getch_and_eat_bkslash_nl(input); /* first char after '{' */
5492 || (len_single_ch == '#' && isdigit(i_peek_and_eat_bkslash_nl(input)))
5504 ch = i_getch_and_eat_bkslash_nl(input);
5523 ch = i_getch(input);
5551 || i_peek(input) != '}'
5566 && !strchr(MINUS_PLUS_EQUAL_QUESTION, i_peek(input))
5575 if (i_peek(input) == '/') { /* ${var//pattern[/repl]}? */
5576 i_getch(input);
5590 if (i_peek(input) == '/') {
5591 o_addchr(dest, i_getch(input));
5600 last_ch = add_till_closing_bracket(dest, input, end_ch);
5645 ch = i_getch(input);
5648 if (i_peek_and_eat_bkslash_nl(input) == '(') {
5649 ch = i_getch(input);
5655 if (!add_till_closing_bracket(dest, input, ')' | DOUBLE_CLOSE_CHAR_FLAG))
5671 if (!add_till_closing_bracket(dest, input, ')'))
5689 ch = i_getch(input);
5691 ch = i_peek_and_eat_bkslash_nl(input);
5707 #define encode_string(as_string, dest, input, dquote_end) \
5708 encode_string(dest, input, dquote_end)
5713 struct in_str *input,
5720 ch = i_getch(input);
5734 next = i_peek(input);
5756 ch = i_getch(input); /* eat next */
5767 if (!parse_dollar(as_string, dest, input, /*quote_mask:*/ 0x80)) {
5779 if (!add_till_backquote(dest, input, /*in_dquote:*/ dquote_end == '"'))
5806 struct in_str *input,
5842 ch = i_getch(input);
5910 ch = i_getch(input);
5938 next = i_getch(input);
5959 ch = i_getch(input);
5966 next = i_peek_and_eat_bkslash_nl(input);
6023 next = i_peek(input);
6026 ch = i_getch(input);
6072 heredoc_cnt = fetch_heredocs(&ctx.as_string, ctx.list_head, heredoc_cnt, input);
6177 ch = i_getch(input);
6186 if (parse_redirect(&ctx, redir_fd, redir_style, input))
6199 ch = i_getch(input);
6203 ch = i_getch(input);
6212 if (parse_redirect(&ctx, redir_fd, redir_style, input))
6248 ch = i_peek(input);
6253 ch = i_getch(input);
6290 if (parse_dollar_squote(&ctx.as_string, &ctx.word, input))
6293 if (!parse_dollar(&ctx.as_string, &ctx.word, input, /*quote_mask:*/ 0)) {
6306 i_getch(input); /* eat second " */
6317 if (!encode_string(&ctx.as_string, &ctx.word, input, '"'))
6328 if (!add_till_backquote(&ctx.word, input, /*in_dquote:*/ 0))
6351 ch = i_peek_and_eat_bkslash_nl(input);
6354 ch = i_getch(input);
6374 ch = i_getch(input);
6390 ch = i_getch(input);
6413 int n = parse_group(&ctx, input, ch);
6626 struct in_str input;
6644 setup_string_in_str(&input, str);
6645 encode_string(NULL, &dest, &input, EOF);
6694 struct in_str input;
6702 setup_string_in_str(&input, str);
6709 ch = i_getch(&input);
6717 if (!add_till_single_quote_dquoted(&dest, &input))
6731 ch = i_getch(&input);
6741 if (parse_dollar_squote(NULL, &dest, &input))
6743 if (!parse_dollar(NULL, &dest, &input, /*quote_mask:*/ 0x80)) {
6754 if (!add_till_backquote(&dest, &input,
6784 struct in_str input;
6802 setup_string_in_str(&input, str);
6807 ch = i_getch(&input);
6842 if (!add_till_single_quote_dquoted(&dest, &input))
6862 ch = i_getch(&input);
6872 … if (!parse_dollar(NULL, &dest, &input, /*quote_mask:*/ (dest.o_expflags || dquoted) ? 0x80 : 0)) {
6883 if (!add_till_backquote(&dest, &input,
8096 struct in_str input;
8103 setup_string_in_str(&input, s);
8105 parse_and_run_stream(&input, '\0');
8107 return parse_and_run_stream(&input, '\0');
8142 struct in_str input;
8147 setup_file_in_str(&input, fp);
8149 setup_file_in_str(&input);
8151 parse_and_run_stream(&input, ';');
11301 HFILE *input;
11304 input = hfopen("/etc/profile");
11306 if (input != NULL) {
11308 parse_and_run_file(input);
11309 hfclose(input);
11323 input = hfopen(hp);
11381 HFILE *input;
11392 input = hfopen(G.global_argv[0]);
11393 if (!input) {
11398 parse_and_run_file(input);
11400 hfclose(input);
12383 HFILE *input;
12407 input = hfopen(filename);
12409 if (!input) {
12428 parse_and_run_file(input);
12429 hfclose(input);