Home | History | Annotate | Download | only in src

Lines Matching defs:words

225 x_print_expansions(int nwords, char * const *words, bool is_command)
236 (prefix_len = x_longest_prefix(nwords, words)) > 0) {
241 prefix_len = x_basename(words[0], NULL);
244 if (x_basename(words[i] + prefix_len, NULL) >
249 while (prefix_len > 0 && words[0][prefix_len - 1] != '/')
254 XPput(l, words[i] + prefix_len);
263 pr_list(use_copy ? (char **)XPptrv(l) : words);
366 char **words, *cp;
375 * Convert "foo*" (toglob) to an array of strings (words)
401 words = (char **)XPclose(w);
403 for (nwords = 0; words[nwords]; nwords++)
419 if ((strcmp(words[0], toglob) == 0 &&
420 stat(words[0], &statb) < 0) ||
421 words[0][0] == '\0') {
422 x_free_words(nwords, words);
423 words = NULL;
428 if ((*wordsp = nwords ? words : NULL) == NULL && words != NULL)
429 x_free_words(nwords, words);
487 char **words = (char **)XPptrv(w);
493 info[i].word = words[i];
494 info[i].base = x_basename(words[i], NULL);
496 strncmp(words[i], last_info->word, info[i].base) != 0) {
505 words[i] = info[i].word;
509 char **words = (char **)XPptrv(w);
512 qsort(words, nwords, sizeof(void *), xstrcmp);
514 if (strcmp(words[i], words[i + 1]))
515 words[j++] = words[i];
517 afree(words[i], ATEMP);
519 words[j++] = words[i];
591 char **words = NULL;
656 x_command_glob(*flagsp, toglob, &words) :
657 x_file_glob(flagsp, toglob, &words);
666 *wordsp = words;
676 x_longest_prefix(int nwords, char * const * words)
685 prefix_len = strlen(words[0]);
687 for (j = 0, p = words[i]; j < prefix_len; j++)
688 if (p[j] != words[0][j]) {
692 /* false for nwords==1 as 0 = words[0][prefix_len] then */
693 if (UTFMODE && prefix_len && (words[0][prefix_len] & 0xC0) == 0x80)
694 while (prefix_len && (words[0][prefix_len] & 0xC0) != 0xC0)
700 x_free_words(int nwords, char **words)
703 afree(words[--nwords], ATEMP);
704 afree(words, ATEMP);
765 char *xp, **words;
804 words = (char **)XPptrv(*wp);
806 if (ksh_access(words[i], X_OK) == 0) {
807 words[j] = words[i];
809 memmove(words[j], words[j] + pathlen,
810 strlen(words[j] + pathlen) + 1);
813 afree(words[i], ATEMP);
2694 char **words;
2699 &start, &end, &words);
2710 if (x_escape(words[i], strlen(words[i]), x_do_ins) < 0 ||
2728 char **words;
2733 &start, &end, &words);
2740 x_print_expansions(nwords, words,
2743 x_free_words(nwords, words);
2747 nlen = x_longest_prefix(nwords, words);
2769 completed = !strncmp(words[0], unescaped, strlen(unescaped));
2778 x_print_expansions(nwords, words,
2787 x_escape(words[0], nlen, x_do_ins);
2794 if (nwords == 1 && words[0][nlen - 1] != '/' &&
2799 x_free_words(nwords, words);
3152 /* Uppercase N(1) words */
3159 /* Lowercase N(1) words */
3166 /* Titlecase N(1) words */
3179 * to UPPER CASE, lower case or Capitalise Words.
5200 char **words;
5216 &start, &end, &words);
5228 if (x_escape(words[i], strlen(words[i]), x_vi_putbuf) != 0) {
5254 char **words;
5283 &start, &end, &words);
5294 x_print_expansions(nwords, words,
5296 x_free_words(nwords, words);
5304 match = words[count] +
5305 x_basename(words[count], NULL);
5309 strcmp(words[i] + x_basename(words[i],
5311 match = words[count];
5315 match = words[count];
5320 match = words[0];
5321 match_len = x_longest_prefix(nwords, words);
5352 x_free_words(nwords, words);
5368 char **words;
5372 &start, &end, &words);
5377 x_print_expansions(nwords, words, tobool(i & XCF_IS_COMMAND));
5378 x_free_words(nwords, words);