• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/bash-94.1.2/bash-3.2/lib/readline/

Lines Matching refs:matches

89    completing a word would normally display the list of possible matches.
91 It takes three arguments: (char **matches, int num_matches, int max_length)
136 /* If non-zero, non-unique completions always show the list of matches. */
139 /* If non-zero, non-unique completions show the list of matches, unless it
191 /* Pointer to alternative function to create matches.
249 /* If non-zero, then disallow duplicates in the matches. */
252 /* Non-zero means that the results of the matches are to be treated
257 /* Non-zero means that the results of the matches are to be quoted using
266 generated. It is passed a (char**) known as matches in the code below.
268 matching strings. The 1st element (matches[0]) is the maximal
269 substring that is common to all matches. This function can re-arrange
270 the list of matches as required, but all elements of the array must be
953 char **matches;
963 matches = (*rl_attempted_completion_function) (text, start, end);
965 if (matches || rl_attempted_completion_over)
968 return (matches);
974 matches = rl_completion_matches (text, our_func);
975 return matches;
981 remove_duplicate_matches (matches)
982 char **matches;
990 for (i = 0; matches[i]; i++)
993 /* Sort the array without matches[0], since we need it to
996 qsort (matches+1, i-1, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
999 lowest_common = savestring (matches[0]);
1001 for (i = newlen = 0; matches[i + 1]; i++)
1003 if (strcmp (matches[i], matches[i + 1]) == 0)
1005 free (matches[i]);
1006 matches[i] = (char *)&dead_slot;
1015 for (i = j = 1; matches[i]; i++)
1017 if (matches[i] != (char *)&dead_slot)
1018 temp_array[j++] = matches[i];
1022 if (matches[0] != (char *)&dead_slot)
1023 free (matches[0]);
1039 /* Find the common prefix of the list of matches, and put it into
1040 matches[0]. */
1042 compute_lcd_of_matches (match_list, matches, text)
1044 int matches;
1059 if (matches == 1)
1066 for (i = 1, low = 100000; i < matches; i++)
1124 /* If there were multiple matches, but none matched up to even the
1126 value of matches[0]. */
1139 the user typed in the face of multiple matches differing in case. */
1150 check against the list of matches
1163 qsort (match_list+1, matches, sizeof(char *), (QSFUNC *)_rl_qsort_string_compare);
1168 for (i = 1; i <= matches; i++)
1175 if (i > matches)
1190 return matches;
1198 char *t, **matches, **temp_matches;
1201 matches = *matchesp;
1203 if (matches == 0)
1211 temp_matches = remove_duplicate_matches (matches);
1212 free (matches);
1213 matches = temp_matches;
1219 munge the array, deleting matches as it desires. */
1222 for (nmatch = 1; matches[nmatch]; nmatch++)
1224 (void)(*rl_ignore_some_completions_function) (matches);
1225 if (matches == 0 || matches[0] == 0)
1227 FREE (matches);
1233 /* If we removed some matches, recompute the common prefix. */
1234 for (i = 1; matches[i]; i++)
1238 t = matches[0];
1239 compute_lcd_of_matches (matches, i - 1, t);
1245 *matchesp = matches;
1254 rl_display_match_list (matches, len, max)
1255 char **matches;
1282 qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
1294 if (l > len || matches[l] == 0)
1298 temp = printable_part (matches[l]);
1299 printed_len = print_filename (temp, matches[l]);
1320 for (i = 1; matches[i]; i++)
1322 temp = printable_part (matches[i]);
1323 printed_len = print_filename (temp, matches[i]);
1325 if (matches[i+1])
1352 matches itself, it sets RL_COMPLETION_DISPLAY_MATCHES_HOOK to the
1355 that the list of matches doesn't exceed the user-settable threshold,
1356 and ask the user if he wants to see the list if there are more matches
1359 display_matches (matches)
1360 char **matches;
1369 if (matches[1] == 0)
1371 temp = printable_part (matches[0]);
1373 print_filename (temp, matches[0]);
1384 for (max = 0, i = 1; matches[i]; i++)
1386 temp = printable_part (matches[i]);
1398 (*rl_completion_display_matches_hook) (matches, len, max);
1420 rl_display_match_list (matches, len, max);
1435 /* If we are doing completion on quoted substrings, and any matches
1442 matches don't require a quoted substring. */
1457 matches needs to be quoted. */
1576 insert_all_matches (matches, point, qc)
1577 char **matches;
1592 if (matches[1])
1594 for (i = 1; matches[i]; i++)
1596 rp = make_quoted_replacement (matches[i], SINGLE_MATCH, qc);
1599 if (rp != matches[i])
1605 rp = make_quoted_replacement (matches[0], SINGLE_MATCH, qc);
1608 if (rp != matches[0])
1615 _rl_free_match_list (matches)
1616 char **matches;
1620 if (matches == 0)
1623 for (i = 0; matches[i]; i++)
1624 free (matches[i]);
1625 free (matches);
1641 char **matches;
1669 matches = gen_completion_matches (text, start, end, our_func, found_quote, quote_char);
1672 nontrivial_lcd = matches && strcmp (text, matches[0]) != 0;
1675 if (matches == 0)
1689 if (postprocess_matches (&matches, i) == 0)
1704 if (*matches[0])
1705 insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, &quote_char);
1707 /* If there are more matches, ring the bell to indicate.
1710 all the matches immediately. Otherwise, if this was the
1715 if (matches[1])
1719 display_matches (matches);
1725 display_matches (matches);
1729 rl_ding (); /* There are other matches remaining. */
1732 append_to_match (matches[0], delimiter, quote_char, nontrivial_lcd);
1737 insert_all_matches (matches, start, &quote_char);
1741 display_matches (matches);
1752 _rl_free_match_list (matches);
1781 when there are no more matches.
1791 /* The list of matches. */
1794 /* Number of matches actually found. */
1795 int matches;
1800 matches = 0;
1805 while (string = (*entry_function) (text, matches))
1807 if (matches + 1 == match_list_size)
1811 match_list[++matches] = string;
1812 match_list[matches + 1] = (char *)NULL;
1815 /* If there were any matches, then look through them finding out the
1817 if (matches)
1818 compute_lcd_of_matches (match_list, matches, text);
1819 else /* There were no matches. */
2104 generate the list of matches. This code is very similar to the code in
2106 for each item in the list of matches, we insert the match in an undoable
2119 static char **matches = (char **)0;
2126 /* The first time through, we generate the list of matches and set things
2132 if (matches)
2133 _rl_free_match_list (matches);
2136 matches = (char **)NULL;
2159 matches = gen_completion_matches (orig_text, orig_start, orig_end,
2167 if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0)
2170 FREE (matches);
2171 matches = (char **)0;
2178 for (match_list_size = 0; matches[match_list_size]; match_list_size++)
2180 /* matches[0] is lcd if match_list_size > 1, but the circular buffer
2184 /* Now we have the list of matches. Replace the text between
2186 matches[match_list_index], and add any necessary closing char. */
2188 if (matches == 0 || match_list_size == 0)
2191 FREE (matches);
2192 matches = (char **)0;
2210 insert_match (matches[match_list_index], orig_start, SINGLE_MATCH, &quote_char);
2211 append_to_match (matches[match_list_index], delimiter, quote_char,
2212 strcmp (orig_text, matches[match_list_index]));