Lines Matching refs:input

30  * the parser and input reader have been turned inside out.  Now,
31 * the parser is in control, and asks for input as needed. The old
32 * way had the input reader in control, and it asked for parsing to
339 #define b_getch(input) ((input)->get(input))
340 #define b_peek(input) ((input)->peek(input))
458 static int setup_redirect(struct p_context *ctx, int fd, redir_type style, struct in_str *input);
466 static int redirect_dup_num(struct in_str *input);
468 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int subst_end);
469 static int parse_group(o_string *dest, struct p_context *ctx, struct in_str *input, int ch);
473 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input);
809 FILE *input;
816 input = fopen(child->argv[1], "r");
817 if (!input) {
826 mark_open(fileno(input));
827 status = parse_file_outer(input);
828 mark_closed(fileno(input));
829 fclose(input);
1525 * The input of the pipe is always stdin, the output is always
1529 * now has its stdout directed to the input of the appropriate pipe,
2292 struct in_str *input)
2318 redir->dup = redirect_dup_num(input);
2605 static int redirect_dup_num(struct in_str *input)
2608 ch = b_peek(input);
2611 b_getch(input); /* get the & */
2612 ch=b_peek(input);
2614 b_getch(input);
2620 b_getch(input);
2621 ch = b_peek(input);
2693 static int process_command_subs(o_string *dest, struct p_context *ctx, struct in_str *input, int subst_end)
2703 retcode = parse_stream(&result, &inner, input, subst_end);
2737 struct in_str *input, int ch)
2752 rcode=parse_stream(dest,&sub,input,endch);
2832 static int handle_dollar(o_string *dest, struct p_context *ctx, struct in_str *input)
2842 int ch = input->peek(input); /* first character after the $ */
2847 while(ch=b_peek(input),isalnum(ch) || ch=='_') {
2848 b_getch(input);
2892 b_getch(input);
2894 while(ch=b_getch(input),ch!=EOF && ch!='}') {
2905 b_getch(input);
2906 process_command_subs(dest, ctx, input, ')');
2927 * is smart enough, we could substitute "b_getch(input);"
2931 if (advance) b_getch(input);
2946 struct in_str *input, int end_trigger)
2960 while ((ch=b_getch(input))!=EOF) {
2963 if (input->__promptme == 0) return 1;
2965 next = (ch == '\n') ? 0 : b_peek(input);
2998 while(ch=b_peek(input),ch!=EOF && ch!='\n') { b_getch(input); }
3009 b_addqchr(dest, b_getch(input), dest->quote);
3012 if (handle_dollar(dest, ctx, input)!=0) return 1;
3016 while(ch=b_getch(input),ch!=EOF && ch!='\'') {
3018 if(input->__promptme == 0) return 1;
3033 process_command_subs(dest, ctx, input, '`');
3041 b_getch(input);
3046 setup_redirect(ctx, redir_fd, redir_style, input);
3054 b_getch(input);
3057 b_getch(input);
3062 setup_redirect(ctx, redir_fd, redir_style, input);
3072 b_getch(input);
3086 b_getch(input);
3103 if (parse_group(dest, ctx, input, ch)!=0) return 1;
3113 while (ch = b_getch(input), ch != EOF &&
3116 if (input->__promptme == 0)
3217 printf("exit not allowed from main input shell.\n");
3264 struct in_str input;
3276 setup_string_in_str(&input, p);
3277 rcode = parse_stream_outer(&input, flag);
3282 setup_string_in_str(&input, s);
3283 rcode = parse_stream_outer(&input, flag);
3297 struct in_str input;
3299 setup_file_in_str(&input, f);
3301 setup_file_in_str(&input);
3303 rcode = parse_stream_outer(&input, FLAG_PARSE_SEMICOLON);
3376 FILE *input;
3416 if ((input = fopen("/etc/profile", "r")) != NULL) {
3417 mark_open(fileno(input));
3418 parse_file_outer(input);
3419 mark_closed(fileno(input));
3420 fclose(input);
3423 input=stdin;
3455 * standard input is a terminal
3458 if (argv[optind]==NULL && input==stdin &&
3481 input = xfopen(argv[optind], "r");
3482 opt = parse_file_outer(input);
3485 fclose(input);