Lines Matching refs:result
79 CplMatches result; /* Completions to be returned to the caller */ member
152 static void cpl_plan_listing(CplMatches *result, int term_width,
158 static int cpl_format_line(CplMatches *result, CplListFormat *fmt, int lnum,
186 cpl->result.suffix = NULL; in new_WordCompletion()
187 cpl->result.cont_suffix = NULL; in new_WordCompletion()
188 cpl->result.matches = NULL; in new_WordCompletion()
189 cpl->result.nmatch = 0; in new_WordCompletion()
215 cpl->result.matches = (CplMatch *) malloc(sizeof(cpl->result.matches[0]) * in new_WordCompletion()
217 if(!cpl->result.matches) { in new_WordCompletion()
245 if(cpl->result.matches) { in del_WordCompletion()
246 free(cpl->result.matches); in del_WordCompletion()
247 cpl->result.matches = NULL; in del_WordCompletion()
316 if(cpl->result.nmatch+1 > cpl->matches_dim) { in cpl_add_completion()
318 CplMatch *matches = (CplMatch *) realloc(cpl->result.matches, in cpl_add_completion()
319 sizeof(cpl->result.matches[0]) * needed); in cpl_add_completion()
326 cpl->result.matches = matches; in cpl_add_completion()
348 match = cpl->result.matches + cpl->result.nmatch++; in cpl_add_completion()
355 cpl->result.cont_suffix = cont_suffix; in cpl_add_completion()
367 qsort(cpl->result.matches, cpl->result.nmatch, in cpl_sort_matches()
368 sizeof(cpl->result.matches[0]), cpl_cmp_matches); in cpl_sort_matches()
396 qsort(cpl->result.matches, cpl->result.nmatch, in cpl_sort_suffixes()
397 sizeof(cpl->result.matches[0]), cpl_cmp_suffixes); in cpl_sort_suffixes()
431 CplMatches *result; /* The result container */ in cpl_common_suffix() local
437 result = &cpl->result; in cpl_common_suffix()
441 if(result->nmatch < 1) in cpl_common_suffix()
453 first = result->matches[0].suffix; in cpl_common_suffix()
454 last = result->matches[result->nmatch - 1].suffix; in cpl_common_suffix()
466 length = first - result->matches[0].suffix; in cpl_common_suffix()
470 result->suffix = _sg_alloc_string(cpl->sg, length); in cpl_common_suffix()
471 if(!result->suffix) { in cpl_common_suffix()
480 strncpy(result->suffix, result->matches[0].suffix, length); in cpl_common_suffix()
481 result->suffix[length] = '\0'; in cpl_common_suffix()
500 cpl->result.nmatch = 0; in cpl_clear_completions()
501 cpl->result.suffix = NULL; in cpl_clear_completions()
502 cpl->result.cont_suffix = ""; in cpl_clear_completions()
583 if(cpl->result.nmatch > 1) in cpl_complete_word()
584 cpl->result.cont_suffix = ""; in cpl_complete_word()
588 return &cpl->result; in cpl_complete_word()
611 return (!cpl || *_err_get_msg(cpl->err)!='\0') ? NULL : &cpl->result; in cpl_recall_matches()
626 int cpl_list_completions(CplMatches *result, FILE *fp, int term_width) in cpl_list_completions() argument
628 return _cpl_output_completions(result, _io_write_stdio, fp, term_width); in cpl_list_completions()
645 int _cpl_output_completions(CplMatches *result, GlWriteFn *write_fn, void *data, in _cpl_output_completions() argument
658 if(write_fn && result && result->nmatch>0) { in _cpl_output_completions()
662 cpl_plan_listing(result, term_width, &fmt); in _cpl_output_completions()
667 if(cpl_format_line(result, &fmt, lnum, write_fn, data)) in _cpl_output_completions()
985 matches = cpl->result.matches; in cpl_zap_duplicates()
986 nmatch = cpl->result.nmatch; in cpl_zap_duplicates()
1015 cpl->result.nmatch = dst; in cpl_zap_duplicates()
1031 static void cpl_plan_listing(CplMatches *result, int term_width, in cpl_plan_listing() argument
1052 for(i=0; i<result->nmatch; i++) { in cpl_plan_listing()
1053 CplMatch *match = result->matches + i; in cpl_plan_listing()
1080 fmt->nline = (result->nmatch + fmt->ncol - 1) / fmt->ncol; in cpl_plan_listing()
1103 static int cpl_format_line(CplMatches *result, CplListFormat *fmt, int lnum, in cpl_format_line() argument
1129 if(m < result->nmatch) { in cpl_format_line()
1130 CplMatch *match = result->matches + m; in cpl_format_line()