Lines Matching refs:result

77   CplMatches result;      /* Completions to be returned to the caller */  member
150 static void cpl_plan_listing(CplMatches *result, int term_width,
156 static int cpl_format_line(CplMatches *result, CplListFormat *fmt, int lnum,
184 cpl->result.suffix = NULL; in new_WordCompletion()
185 cpl->result.cont_suffix = NULL; in new_WordCompletion()
186 cpl->result.matches = NULL; in new_WordCompletion()
187 cpl->result.nmatch = 0; in new_WordCompletion()
213 cpl->result.matches = (CplMatch *) malloc(sizeof(cpl->result.matches[0]) * in new_WordCompletion()
215 if(!cpl->result.matches) { in new_WordCompletion()
243 if(cpl->result.matches) { in del_WordCompletion()
244 free(cpl->result.matches); in del_WordCompletion()
245 cpl->result.matches = NULL; in del_WordCompletion()
314 if(cpl->result.nmatch+1 > cpl->matches_dim) { in cpl_add_completion()
316 CplMatch *matches = (CplMatch *) realloc(cpl->result.matches, in cpl_add_completion()
317 sizeof(cpl->result.matches[0]) * needed); in cpl_add_completion()
324 cpl->result.matches = matches; in cpl_add_completion()
346 match = cpl->result.matches + cpl->result.nmatch++; in cpl_add_completion()
353 cpl->result.cont_suffix = cont_suffix; in cpl_add_completion()
365 qsort(cpl->result.matches, cpl->result.nmatch, in cpl_sort_matches()
366 sizeof(cpl->result.matches[0]), cpl_cmp_matches); in cpl_sort_matches()
394 qsort(cpl->result.matches, cpl->result.nmatch, in cpl_sort_suffixes()
395 sizeof(cpl->result.matches[0]), cpl_cmp_suffixes); in cpl_sort_suffixes()
429 CplMatches *result; /* The result container */ in cpl_common_suffix() local
435 result = &cpl->result; in cpl_common_suffix()
439 if(result->nmatch < 1) in cpl_common_suffix()
451 first = result->matches[0].suffix; in cpl_common_suffix()
452 last = result->matches[result->nmatch - 1].suffix; in cpl_common_suffix()
464 length = first - result->matches[0].suffix; in cpl_common_suffix()
468 result->suffix = _sg_alloc_string(cpl->sg, length); in cpl_common_suffix()
469 if(!result->suffix) { in cpl_common_suffix()
478 strncpy(result->suffix, result->matches[0].suffix, length); in cpl_common_suffix()
479 result->suffix[length] = '\0'; in cpl_common_suffix()
498 cpl->result.nmatch = 0; in cpl_clear_completions()
499 cpl->result.suffix = NULL; in cpl_clear_completions()
500 cpl->result.cont_suffix = ""; in cpl_clear_completions()
581 if(cpl->result.nmatch > 1) in cpl_complete_word()
582 cpl->result.cont_suffix = ""; in cpl_complete_word()
586 return &cpl->result; in cpl_complete_word()
609 return (!cpl || *_err_get_msg(cpl->err)!='\0') ? NULL : &cpl->result; in cpl_recall_matches()
624 int cpl_list_completions(CplMatches *result, FILE *fp, int term_width) in cpl_list_completions() argument
626 return _cpl_output_completions(result, _io_write_stdio, fp, term_width); in cpl_list_completions()
643 int _cpl_output_completions(CplMatches *result, GlWriteFn *write_fn, void *data, in _cpl_output_completions() argument
656 if(write_fn && result && result->nmatch>0) { in _cpl_output_completions()
660 cpl_plan_listing(result, term_width, &fmt); in _cpl_output_completions()
665 if(cpl_format_line(result, &fmt, lnum, write_fn, data)) in _cpl_output_completions()
983 matches = cpl->result.matches; in cpl_zap_duplicates()
984 nmatch = cpl->result.nmatch; in cpl_zap_duplicates()
1013 cpl->result.nmatch = dst; in cpl_zap_duplicates()
1029 static void cpl_plan_listing(CplMatches *result, int term_width, in cpl_plan_listing() argument
1050 for(i=0; i<result->nmatch; i++) { in cpl_plan_listing()
1051 CplMatch *match = result->matches + i; in cpl_plan_listing()
1078 fmt->nline = (result->nmatch + fmt->ncol - 1) / fmt->ncol; in cpl_plan_listing()
1101 static int cpl_format_line(CplMatches *result, CplListFormat *fmt, int lnum, in cpl_format_line() argument
1127 if(m < result->nmatch) { in cpl_format_line()
1128 CplMatch *match = result->matches + m; in cpl_format_line()