Lines Matching refs:i

141   register int i;  in get_history_event()  local
159 i = *caller_index; in get_history_event()
161 if (string[i] != history_expansion_char) in get_history_event()
165 i++; in get_history_event()
174 if (string[i] == history_expansion_char) in get_history_event()
176 i++; in get_history_event()
178 *caller_index = i; in get_history_event()
183 if (string[i] == '-') in get_history_event()
186 i++; in get_history_event()
189 if (_rl_digit_p (string[i])) in get_history_event()
192 for (which = 0; _rl_digit_p (string[i]); i++) in get_history_event()
193 which = (which * 10) + _rl_digit_value (string[i]); in get_history_event()
195 *caller_index = i; in get_history_event()
206 if (string[i] == '?') in get_history_event()
209 i++; in get_history_event()
213 for (local_index = i; c = string[i]; i++) in get_history_event()
224 _rl_adjust_point ((char *)string, i, &ps); in get_history_event()
225 if ((v = _rl_get_char_len ((char *)string + i, &ps)) > 1) in get_history_event()
227 i += v - 1; in get_history_event()
236 string[i] == delimiting_quote)) || in get_history_event()
237 string[i] == '\n' || in get_history_event()
238 (substring_okay && string[i] == '?')) in get_history_event()
242 which = i - local_index; in get_history_event()
248 if (substring_okay && string[i] == '?') in get_history_event()
249 i++; in get_history_event()
251 *caller_index = i; in get_history_event()
322 register int i; in hist_string_extract_single_quoted() local
324 for (i = *sindex; string[i] && string[i] != '\''; i++) in hist_string_extract_single_quoted()
326 if ((flags & 1) && string[i] == '\\' && string[i+1]) in hist_string_extract_single_quoted()
327 i++; in hist_string_extract_single_quoted()
330 *sindex = i; in hist_string_extract_single_quoted()
434 register int si, i, j, k; in get_subst_pattern() local
441 i = *iptr; in get_subst_pattern()
445 _rl_adjust_point (str, i, &ps); in get_subst_pattern()
448 for (si = i; str[si] && str[si] != delimiter; si++) in get_subst_pattern()
463 if (si > i || is_rhs) in get_subst_pattern()
465 s = (char *)xmalloc (si - i + 1); in get_subst_pattern()
466 for (j = 0, k = i; k < si; j++, k++) in get_subst_pattern()
478 i = si; in get_subst_pattern()
479 if (str[i]) in get_subst_pattern()
480 i++; in get_subst_pattern()
481 *iptr = i; in get_subst_pattern()
490 int i, j, new_size; in postproc_subst_rhs() local
493 for (i = j = 0; i < subst_rhs_len; i++) in postproc_subst_rhs()
495 if (subst_rhs[i] == '&') in postproc_subst_rhs()
505 if (subst_rhs[i] == '\\' && subst_rhs[i + 1] == '&') in postproc_subst_rhs()
506 i++; in postproc_subst_rhs()
509 new[j++] = subst_rhs[i]; in postproc_subst_rhs()
527 int i, n, starting_index; in history_expand_internal() local
539 i = start; in history_expand_internal()
544 if (member (string[i + 1], ":$*%^")) in history_expand_internal()
548 i++; in history_expand_internal()
553 else if (string[i + 1] == '#') in history_expand_internal()
555 i += 2; in history_expand_internal()
559 event = get_history_event (string, &i, qc); in history_expand_internal()
563 *ret_string = hist_error (string, start, i, EVENT_NOT_FOUND); in history_expand_internal()
569 starting_index = i; in history_expand_internal()
570 word_spec = get_history_word_specifier (string, event, &i); in history_expand_internal()
577 *ret_string = hist_error (string, starting_index, i, BAD_WORD_SPEC); in history_expand_internal()
588 starting_index = i; in history_expand_internal()
590 while (string[i] == ':') in history_expand_internal()
592 c = string[i + 1]; in history_expand_internal()
597 i++; in history_expand_internal()
598 c = string[i + 1]; in history_expand_internal()
603 i++; in history_expand_internal()
604 c = string[i + 1]; in history_expand_internal()
610 *ret_string = hist_error (string, i+1, i+2, BAD_MODIFIER); in history_expand_internal()
681 if (i + 2 < (int)strlen (string)) in history_expand_internal()
686 _rl_adjust_point (string, i + 2, &ps); in history_expand_internal()
687 if (_rl_get_char_len (string + i + 2, &ps) > 1) in history_expand_internal()
690 delimiter = string[i + 2]; in history_expand_internal()
694 delimiter = string[i + 2]; in history_expand_internal()
699 i += 3; in history_expand_internal()
701 t = get_subst_pattern (string, &i, delimiter, 0, &subst_lhs_len); in history_expand_internal()
724 subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len); in history_expand_internal()
732 i += 2; in history_expand_internal()
737 *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST); in history_expand_internal()
747 *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); in history_expand_internal()
825 *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); in history_expand_internal()
831 i += 2; in history_expand_internal()
835 --i; in history_expand_internal()
858 *end_index_ptr = i; in history_expand_internal()
905 int i, r, l, passc, cc, modified, eindex, only_printing, dquote, squote, flag; in history_expand() local
974 i = 0; in history_expand()
977 hist_string_extract_single_quoted (string, &i, 0); in history_expand()
979 if (string[i]) in history_expand()
980 i++; in history_expand()
983 for ( ; string[i]; i++) in history_expand()
989 v = _rl_get_char_len (string + i, &ps); in history_expand()
992 i += v - 1; in history_expand()
998 cc = string[i + 1]; in history_expand()
1003 if (history_comment_char && string[i] == history_comment_char && in history_expand()
1005 (i == 0 || member (string[i - 1], history_word_delimiters))) in history_expand()
1007 while (string[i]) in history_expand()
1008 i++; in history_expand()
1011 else if (string[i] == history_expansion_char) in history_expand()
1028 (*history_inhibit_expansion_function) (string, i)) in history_expand()
1035 else if (dquote && string[i] == '\\' && cc == '"') in history_expand()
1036 i++; in history_expand()
1041 else if (history_quotes_inhibit_expansion && string[i] == '"') in history_expand()
1045 else if (dquote == 0 && history_quotes_inhibit_expansion && string[i] == '\'') in history_expand()
1048 flag = (i > 0 && string[i - 1] == '$'); in history_expand()
1049 i++; in history_expand()
1050 hist_string_extract_single_quoted (string, &i, flag); in history_expand()
1052 else if (history_quotes_inhibit_expansion && string[i] == '\\') in history_expand()
1057 i++; in history_expand()
1062 if (string[i] != history_expansion_char) in history_expand()
1077 i = j = 0; in history_expand()
1082 hist_string_extract_single_quoted (string, &i, 0); in history_expand()
1084 for (c = 0; c < i; c++) in history_expand()
1086 if (string[i]) in history_expand()
1088 ADD_CHAR (string[i]); in history_expand()
1089 i++; in history_expand()
1093 for (passc = 0; i < l; i++) in history_expand()
1095 int qc, tchar = string[i]; in history_expand()
1116 c = string[++i]; in history_expand()
1136 ADD_CHAR (string[i]); in history_expand()
1163 flag = (i > 0 && string[i - 1] == '$'); in history_expand()
1164 quote = i++; in history_expand()
1165 hist_string_extract_single_quoted (string, &i, flag); in history_expand()
1167 slen = i - quote + 2; in history_expand()
1177 ADD_CHAR (string[i]); in history_expand()
1180 ADD_CHAR (string[i]); in history_expand()
1186 (i == 0 || member (string[i - 1], history_word_delimiters))) in history_expand()
1188 temp = (char *)xmalloc (l - i + 1); in history_expand()
1189 strcpy (temp, string + i); in history_expand()
1192 i = l; in history_expand()
1195 ADD_CHAR (string[i]); in history_expand()
1199 cc = string[i + 1]; in history_expand()
1206 (history_inhibit_expansion_function && (*history_inhibit_expansion_function) (string, i))) in history_expand()
1208 ADD_CHAR (string[i]); in history_expand()
1227 i++; in history_expand()
1232 r = history_expand_internal (string, i, qc, &eindex, &temp, result); in history_expand()
1251 i = eindex; in history_expand()
1280 register int i = *caller_index; in get_history_word_specifier() local
1291 if (spec[i] == ':') in get_history_word_specifier()
1293 i++; in get_history_word_specifier()
1300 if (spec[i] == '%') in get_history_word_specifier()
1302 *caller_index = i + 1; in get_history_word_specifier()
1307 if (spec[i] == '*') in get_history_word_specifier()
1309 *caller_index = i + 1; in get_history_word_specifier()
1315 if (spec[i] == '$') in get_history_word_specifier()
1317 *caller_index = i + 1; in get_history_word_specifier()
1323 if (spec[i] == '-') in get_history_word_specifier()
1325 else if (spec[i] == '^') in get_history_word_specifier()
1328 i++; in get_history_word_specifier()
1330 else if (_rl_digit_p (spec[i]) && expecting_word_spec) in get_history_word_specifier()
1332 for (first = 0; _rl_digit_p (spec[i]); i++) in get_history_word_specifier()
1333 first = (first * 10) + _rl_digit_value (spec[i]); in get_history_word_specifier()
1338 if (spec[i] == '^' || spec[i] == '*') in get_history_word_specifier()
1340 last = (spec[i] == '^') ? 1 : '$'; /* x* abbreviates x-$ */ in get_history_word_specifier()
1341 i++; in get_history_word_specifier()
1343 else if (spec[i] != '-') in get_history_word_specifier()
1347 i++; in get_history_word_specifier()
1349 if (_rl_digit_p (spec[i])) in get_history_word_specifier()
1351 for (last = 0; _rl_digit_p (spec[i]); i++) in get_history_word_specifier()
1352 last = (last * 10) + _rl_digit_value (spec[i]); in get_history_word_specifier()
1354 else if (spec[i] == '$') in get_history_word_specifier()
1356 i++; in get_history_word_specifier()
1360 else if (!spec[i] || spec[i] == ':') in get_history_word_specifier()
1370 *caller_index = i; in get_history_word_specifier()
1386 register int i, len; in history_arg_extract() local
1418 for (size = 0, i = first; i < last; i++) in history_arg_extract()
1419 size += strlen (list[i]) + 1; in history_arg_extract()
1423 for (i = first, offset = 0; i < last; i++) in history_arg_extract()
1425 strcpy (result + offset, list[i]); in history_arg_extract()
1426 offset += strlen (list[i]); in history_arg_extract()
1427 if (i + 1 < last) in history_arg_extract()
1435 for (i = 0; i < len; i++) in history_arg_extract()
1436 xfree (list[i]); in history_arg_extract()
1445 register int i, j; in history_tokenize_word() local
1448 i = ind; in history_tokenize_word()
1451 if (member (string[i], "()\n")) /* XXX - included \n, but why? been here forever */ in history_tokenize_word()
1453 i++; in history_tokenize_word()
1454 return i; in history_tokenize_word()
1457 if (ISDIGIT (string[i])) in history_tokenize_word()
1459 j = i; in history_tokenize_word()
1465 i = j; /* digit sequence is a file descriptor */ in history_tokenize_word()
1468 i = j; in history_tokenize_word()
1473 if (member (string[i], "<>;&|")) in history_tokenize_word()
1475 int peek = string[i + 1]; in history_tokenize_word()
1477 if (peek == string[i]) in history_tokenize_word()
1479 if (peek == '<' && string[i + 2] == '-') in history_tokenize_word()
1480 i++; in history_tokenize_word()
1481 else if (peek == '<' && string[i + 2] == '<') in history_tokenize_word()
1482 i++; in history_tokenize_word()
1483 i += 2; in history_tokenize_word()
1484 return i; in history_tokenize_word()
1486 else if (peek == '&' && (string[i] == '>' || string[i] == '<')) in history_tokenize_word()
1488 j = i + 2; in history_tokenize_word()
1495 else if ((peek == '>' && string[i] == '&') || (peek == '|' && string[i] == '>')) in history_tokenize_word()
1497 i += 2; in history_tokenize_word()
1498 return i; in history_tokenize_word()
1501 else if (peek == '(' && (string[i] == '>' || string[i] == '<')) /*)*/ in history_tokenize_word()
1503 i += 2; in history_tokenize_word()
1510 i++; in history_tokenize_word()
1511 return i; in history_tokenize_word()
1517 if (delimiter == 0 && member (string[i], HISTORY_QUOTE_CHARACTERS)) in history_tokenize_word()
1518 delimiter = string[i++]; in history_tokenize_word()
1520 for (; string[i]; i++) in history_tokenize_word()
1522 if (string[i] == '\\' && string[i + 1] == '\n') in history_tokenize_word()
1524 i++; in history_tokenize_word()
1528 if (string[i] == '\\' && delimiter != '\'' && in history_tokenize_word()
1529 (delimiter != '"' || member (string[i], slashify_in_quotes))) in history_tokenize_word()
1531 i++; in history_tokenize_word()
1537 if (nestdelim && string[i] == delimopen) in history_tokenize_word()
1542 if (nestdelim && string[i] == delimiter) in history_tokenize_word()
1550 if (delimiter && string[i] == delimiter) in history_tokenize_word()
1557 …if (nestdelim == 0 && delimiter == 0 && member (string[i], "<>$!@?+*") && string[i+1] == '(') /*)*/ in history_tokenize_word()
1559 i += 2; in history_tokenize_word()
1566 if (delimiter == 0 && (member (string[i], history_word_delimiters))) in history_tokenize_word()
1569 if (delimiter == 0 && member (string[i], HISTORY_QUOTE_CHARACTERS)) in history_tokenize_word()
1570 delimiter = string[i]; in history_tokenize_word()
1573 return i; in history_tokenize_word()
1597 register int i, start, result_index, size; in history_tokenize_internal() local
1606 for (i = result_index = size = 0, result = (char **)NULL; string[i]; ) in history_tokenize_internal()
1609 for (; string[i] && fielddelim (string[i]); i++) in history_tokenize_internal()
1611 if (string[i] == 0 || string[i] == history_comment_char) in history_tokenize_internal()
1614 start = i; in history_tokenize_internal()
1616 i = history_tokenize_word (string, start); in history_tokenize_internal()
1622 if (i == start && history_word_delimiters) in history_tokenize_internal()
1624 i++; in history_tokenize_internal()
1625 while (string[i] && member (string[i], history_word_delimiters)) in history_tokenize_internal()
1626 i++; in history_tokenize_internal()
1631 if (indp && wind != -1 && wind >= start && wind < i) in history_tokenize_internal()
1637 result[result_index++] = history_substring (string, start, i); in history_tokenize_internal()
1656 register int i; in freewords() local
1658 for (i = start; words[i]; i++) in freewords()
1659 xfree (words[i]); in freewords()
1669 int i, wind; in history_find_word() local
1680 for (i = 0; i < wind; i++) in history_find_word()
1681 xfree (words[i]); in history_find_word()