Lines Matching defs:matches
61 * matches[] array by whenever it is found to be too small.
72 * Completion matches are recorded in containers of the following
78 int matches_dim; /* The allocated size of result.matches[] */
188 cpl->result.matches = NULL;
215 cpl->result.matches = (CplMatch *) malloc(sizeof(cpl->result.matches[0]) *
217 if(!cpl->result.matches) {
245 if(cpl->result.matches) {
246 free(cpl->result.matches);
247 cpl->result.matches = NULL;
286 * separator here for directory matches, and a
314 * Do we need to extend the array of matches[]?
318 CplMatch *matches = (CplMatch *) realloc(cpl->result.matches,
319 sizeof(cpl->result.matches[0]) * needed);
320 if(!matches) {
322 "Insufficient memory to extend array of matches.",
326 cpl->result.matches = matches;
336 _err_record_msg(cpl->err, "Insufficient memory to extend array of matches.",
348 match = cpl->result.matches + cpl->result.nmatch++;
360 * Sort the array of matches.
367 qsort(cpl->result.matches, cpl->result.nmatch,
368 sizeof(cpl->result.matches[0]), cpl_cmp_matches);
372 * This is a qsort() comparison function used to sort matches.
375 * v1, v2 void * Pointers to the two matches to be compared.
389 * Sort the array of matches in order of their suffixes.
396 qsort(cpl->result.matches, cpl->result.nmatch,
397 sizeof(cpl->result.matches[0]), cpl_cmp_suffixes);
401 * This is a qsort() comparison function used to sort matches in order of
405 * v1, v2 void * Pointers to the two matches to be compared.
419 * Find the common prefix of all of the matching completion matches,
421 * the side effect of sorting the matches into suffix order.
444 * Sort th matches into suffix order.
448 * Given that the array of matches is sorted, the first and last
453 first = result->matches[0].suffix;
454 last = result->matches[result->nmatch - 1].suffix;
466 length = first - result->matches[0].suffix;
480 strncpy(result->suffix, result->matches[0].suffix, length);
486 * Discard the contents of the array of possible completion matches.
523 * record completion matches.
558 * Have the matching function record possible completion matches in
559 * cpl->result.matches.
573 * Sort the matches into lexicographic order.
577 * Discard any duplicate matches.
586 * Return the array of matches.
709 * contain the matches. This should be filled
967 * Remove duplicates from a sorted array of matches.
974 CplMatch *matches; /* The array of matches */
975 int nmatch; /* The number of elements in matches[] */
982 * Get the array of matches and the number of matches that it
985 matches = cpl->result.matches;
988 * No matches?
995 completion = matches[0].completion;
996 type_suffix = matches[0].type_suffix;
998 * Go through the array of matches, copying each new unrecorded
1002 CplMatch *match = matches + src;
1006 matches[dst] = *match;
1013 * Record the number of unique matches that remain.
1043 * on the screen, or that there are no matches to be listed.
1053 CplMatch *match = result->matches + i;
1119 * Print the matches in 'ncol' columns, sorted in line order within each
1130 CplMatch *match = result->matches + m;