17 static int wlcomp(
char**,
char**);
33 for (wl = wlist; wl; wl = wl->
wl_next)
49 for (wl = wlist; wl; wl = nw) {
68 for (wl = wlist; wl; wl = wl->
wl_next) {
74 w->wl_next->wl_prev = w;
94 list->wl_prev = elt->wl_prev;
96 elt->wl_prev->wl_next = list;
100 list->wl_next = elt->wl_next;
103 elt->wl_next->wl_prev = list;
121 for (wl = wlist; wl; wl = wl->
wl_next) {
124 (void) putc(
' ', fp);
167 v = (
char **)
tmalloc((len + 1) *
sizeof (
char **));
168 for (i = 0; i < len; i++) {
169 v[i] =
copy(wl->wl_word);
207 for (w = wl; ; w = t) {
229 for (tw = wl; tw; tw = tw->
wl_next)
234 (void) strcat(buf, wl->wl_word);
236 (void) strcat(buf,
" ");
256 while ((i-- > 0) && ww->
wl_next)
278 stuff = (
char **)
tmalloc(i *
sizeof (
char *));
279 for (i = 0, ww = wl; ww; i++, ww = ww->
wl_next)
280 stuff[i] = ww->wl_word;
281 qsort((
char *) stuff, i,
sizeof (
char *),
283 (
int(*)(
const void*,
const void*))
wlcomp);
287 for (i = 0, ww = wl; ww; i++, ww = ww->wl_next)
288 ww->wl_word = stuff[i];
299 return (strcmp(*s, *t));
323 while (wl && (low > 0)) {
333 while (tt && (up > 0)) {
wordlist * wl_reverse(wordlist *wl)
char * wl_flatten(wordlist *wl)
static char buf[MAXPROMPT]
wordlist * wl_nthelem(int i, wordlist *wl)
int wl_length(wordlist *wlist)
void wl_free(wordlist *wlist)
struct wordlist * wl_prev
wordlist * wl_splice(wordlist *elt, wordlist *list)
char ** wl_mkvec(wordlist *wl)
wordlist * wl_range(wordlist *wl, int low, int up)
wordlist * wl_append(wordlist *wlist, wordlist *nwl)
wordlist * wl_copy(wordlist *wlist)
struct wordlist * wl_next
void wl_print(wordlist *wlist, FILE *fp)
void wl_sort(wordlist *wl)