Lines Matching refs:i
419 static int b_adduint(o_string *o, unsigned int i);
422 static int static_get(struct in_str *i);
423 static int static_peek(struct in_str *i);
424 static int file_get(struct in_str *i);
425 static int file_peek(struct in_str *i);
427 static void setup_file_in_str(struct in_str *i, FILE *f);
429 static void setup_file_in_str(struct in_str *i);
431 static void setup_string_in_str(struct in_str *i, const char *s);
439 static char *indenter(int i);
653 int i, jobnum; in builtin_fg_bg() local
691 for (i = 0; i < pi->num_progs; i++) in builtin_fg_bg()
692 pi->progs[i].is_stopped = 0; in builtin_fg_bg()
694 if ( (i=kill(- pi->pgrp, SIGCONT)) < 0) { in builtin_fg_bg()
695 if (i == ESRCH) { in builtin_fg_bg()
923 static int b_adduint(o_string *o, unsigned int i) in b_adduint() argument
926 char *p = simple_itoa(i); in b_adduint()
933 static int static_get(struct in_str *i) in static_get() argument
935 int ch = *i->p++; in static_get()
940 static int static_peek(struct in_str *i) in static_peek() argument
942 return *i->p; in static_peek()
978 static int uboot_cli_readline(struct in_str *i) in uboot_cli_readline() argument
983 if (i->promptmode == 1) in uboot_cli_readline()
989 if (i->promptmode == 1) in uboot_cli_readline()
1001 static void get_user_input(struct in_str *i) in get_user_input() argument
1007 setup_prompt_string(i->promptmode, &prompt_str); in get_user_input()
1019 the_command[0]=fgetc(i->file); in get_user_input()
1023 i->p = the_command; in get_user_input()
1029 i->__promptme = 1; in get_user_input()
1030 n = uboot_cli_readline(i); in get_user_input()
1044 i->__promptme = 0; in get_user_input()
1052 if (i->promptmode == 1) { in get_user_input()
1065 i->p = the_command; in get_user_input()
1081 if (i->__promptme == 0) { in get_user_input()
1085 i->p = console_buffer; in get_user_input()
1092 static int file_get(struct in_str *i) argument
1098 if (i->p && *i->p) {
1099 ch = *i->p++;
1104 if (i->__promptme && interactive && i->file == stdin) {
1105 while(! i->p || (interactive && strlen(i->p)==0) ) {
1107 while(! i->p || strlen(i->p)==0 ) {
1109 get_user_input(i);
1111 i->promptmode=2;
1113 i->__promptme = 0;
1115 if (i->p && *i->p) {
1116 ch = *i->p++;
1120 ch = fgetc(i->file);
1127 if (ch == '\n') i->__promptme=1;
1135 static int file_peek(struct in_str *i) argument
1138 if (i->p && *i->p) {
1140 return *i->p;
1143 i->peek_buf[0] = fgetc(i->file);
1144 i->peek_buf[1] = '\0';
1145 i->p = i->peek_buf;
1146 debug_printf("b_peek: got a %d\n", *i->p);
1147 return *i->p;
1153 static void setup_file_in_str(struct in_str *i, FILE *f) argument
1155 static void setup_file_in_str(struct in_str *i)
1158 i->peek = file_peek;
1159 i->get = file_get;
1160 i->__promptme=1;
1161 i->promptmode=1;
1163 i->file = f;
1165 i->p = NULL;
1168 static void setup_string_in_str(struct in_str *i, const char *s) argument
1170 i->peek = static_peek;
1171 i->get = static_get;
1172 i->__promptme=1;
1173 i->promptmode=1;
1174 i->p = s;
1248 int i, fd; local
1249 for (i=0; i<3; i++) {
1250 fd = squirrel[i];
1254 dup2(fd, i);
1266 int i, rcode; local
1270 for (i=0; is_assignment(child->argv[i]); i++) {
1271 debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]);
1272 p = insert_var_value(child->argv[i]);
1274 if (p != child->argv[i]) free(p);
1276 child->argv+=i; /* XXX this hack isn't so horrible, since we are about
1435 int i, rcode = 0; local
1436 for (i=0; i < fg_pipe->num_progs; i++) {
1437 if (fg_pipe->progs[i].pid == childpid) {
1438 if (i==fg_pipe->num_progs-1)
1537 int i; local
1546 (void) &i;
1558 (void) &i;
1592 for (i=0; is_assignment(child->argv[i]); i++) { /* nothing */ }
1593 if (i!=0 && child->argv[i]==NULL) {
1595 for (i=0; child->argv[i]!=NULL; i++) {
1605 name = xstrdup(child->argv[i]);
1616 p = insert_var_value(child->argv[i]);
1618 if (p != child->argv[i]) free(p);
1622 for (i = 0; is_assignment(child->argv[i]); i++) {
1623 p = insert_var_value(child->argv[i]);
1629 if (p != child->argv[i]) {
1637 str = make_string(child->argv + i,
1638 child->argv_nonnull + i);
1645 if (strcmp(child->argv[i], x->cmd) == 0 ) {
1648 if (x->function == builtin_exec && child->argv[i+1]==NULL) {
1660 child->argv += i; /* XXX horrible hack */
1663 child->argv -= i;
1672 if (strchr(child->argv[i], ';')) {
1674 "'run' command\n", child->argv[i]);
1684 for (i = 0; i < pi->num_progs; i++) {
1685 child = & (pi->progs[i]);
1688 if ((i + 1) < pi->num_progs) {
1930 static char *indenter(int i) argument
1933 return &blanks[sizeof(blanks)-i-1];
1944 int a, i, ret_code=0; local
1952 for (i=0; i<pi->num_progs; i++) {
1953 child = &pi->progs[i];
1954 final_printf("%s command %d:\n",ind,i);
2087 int i;
2091 for (i=0; i<pglob->gl_pathc; i++)
2092 debug_printf("pglob->gl_pathv[%d] = %p = %s\n", i,
2093 pglob->gl_pathv[i], pglob->gl_pathv[i]);
2841 int i, advance=0; local
2860 i = ch-'0'; /* XXX is $0 special? */
2861 if (i<global_argc) {
2862 parse_string(dest, ctx, global_argv[i]); /* recursion */
2916 for (i=1; i<global_argc; i++) {
2917 parse_string(dest, ctx, global_argv[i]);
2918 if (i+1 < global_argc) parse_string(dest, ctx, sep);
3590 int len, i; local
3598 for (i = 0; inp[i]; i++) {
3599 p3 = insert_var_value(inp[i]);
3622 if (p3 != inp[i]) free(p3);
3671 int i, k; local
3685 for (i = 1; i < argc; ++i) { /* print single env variables */
3686 char *name = argv[i];