Lines Matching full:nwords
226 x_print_expansions(int nwords, char * const *words, bool is_command)
237 (prefix_len = x_longest_prefix(nwords, words)) > 0) {
241 if (nwords == 1)
244 for (i = 0; i < nwords; i++)
249 if (i == nwords) {
253 XPinit(l, nwords + 1);
254 for (i = 0; i < nwords; i++)
368 int nwords;
393 nwords = DOGLOB | DOTILDE | DOMARKDIRS;
398 nwords = 0;
400 expand(yylval.cp, &w, nwords);
404 for (nwords = 0; words[nwords]; nwords++)
406 if (nwords == 1) {
423 x_free_words(nwords, words);
425 nwords = 0;
429 if ((*wordsp = nwords ? words : NULL) == NULL && words != NULL)
430 x_free_words(nwords, words);
432 return (nwords);
458 size_t nwords;
477 nwords = XPsize(w);
479 if (!nwords) {
492 alloc2(nwords, sizeof(struct path_order_info), ATEMP);
493 for (i = 0; i < nwords; i++) {
503 qsort(info, nwords, sizeof(struct path_order_info),
505 for (i = 0; i < nwords; i++)
513 qsort(words, nwords, sizeof(void *), xstrcmp);
514 for (i = j = 0; i < nwords - 1; i++) {
521 w.len = nwords = j;
527 return (nwords);
591 int len, nwords = 0;
656 nwords = is_command ?
661 if (nwords == 0) {
670 return (nwords);
677 x_longest_prefix(int nwords, char * const * words)
683 if (nwords <= 0)
687 for (i = 1; i < nwords; i++)
693 /* false for nwords==1 as 0 = words[0][prefix_len] then */
701 x_free_words(int nwords, char **words)
703 while (nwords)
704 afree(words[--nwords], ATEMP);
2677 int start, end, nwords, i;
2680 nwords = x_cf_glob(&i, xbuf, xep - xbuf, xcp - xbuf,
2683 if (nwords == 0) {
2691 while (i < nwords) {
2693 (++i < nwords && x_ins(" ") < 0)) {
2711 int start, end, nlen, olen, nwords;
2714 nwords = x_cf_glob(&flags, xbuf, xep - xbuf, xcp - xbuf,
2717 if (nwords == 0) {
2722 x_print_expansions(nwords, words,
2725 x_free_words(nwords, words);
2729 nlen = x_longest_prefix(nwords, words);
2730 if (nwords == 1) {
2755 if (type == CT_COMPLIST && nwords > 1) {
2760 x_print_expansions(nwords, words,
2776 if (nwords == 1 && words[0][nlen - 1] != '/' &&
2781 x_free_words(nwords, words);
5240 int rval = 0, nwords, start, end, i;
5256 nwords = x_cf_glob(&i, es->cbuf, es->linelen, es->cursor,
5258 if (nwords == 0) {
5268 while (i < nwords) {
5273 if (++i < nwords && putbuf(" ", 1, false) != 0) {
5293 int rval, nwords, start, end, flags;
5323 nwords = x_cf_glob(&flags, es->cbuf, es->linelen, es->cursor,
5325 if (nwords == 0) {
5333 if (count >= nwords) {
5335 x_print_expansions(nwords, words,
5337 x_free_words(nwords, words);
5348 for (i = 0; i < nwords; i++)
5362 match_len = x_longest_prefix(nwords, words);
5365 is_unique = nwords == 1;
5393 x_free_words(nwords, words);
5408 int start, end, nwords, i;
5412 nwords = x_cf_glob(&i, est->cbuf, est->linelen, est->cursor,
5414 if (nwords == 0) {
5418 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5419 x_free_words(nwords, words);