Lines Matching full:we
50 * of words in `we'. See wordexp(3).
55 wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags) in wordexp() argument
60 wordfree(we); in wordexp()
62 we->we_wordc = 0; in wordexp()
63 we->we_wordv = NULL; in wordexp()
64 we->we_strings = NULL; in wordexp()
65 we->we_nbytes = 0; in wordexp()
68 wordfree(we); in wordexp()
71 if ((error = we_askshell(words, we, flags)) != 0) { in wordexp()
72 wordfree(we); in wordexp()
121 we_askshell(const char *words, wordexp_t *we, int flags) in we_askshell() argument
129 size_t sofs; /* Offset into we->we_strings */ in we_askshell()
130 size_t vofs; /* Offset into we->we_wordv */ in we_askshell()
168 * We are the child; make /bin/sh expand `words'. in we_askshell()
190 * We are the parent; write the words. in we_askshell()
226 * and string storage buffers for the expanded words we're about to in we_askshell()
229 sofs = we->we_nbytes; in we_askshell()
230 vofs = we->we_wordc; in we_askshell()
232 vofs += we->we_offs; in we_askshell()
233 we->we_wordc += nwords; in we_askshell()
234 we->we_nbytes += nbytes; in we_askshell()
235 if ((nwv = reallocarray(we->we_wordv, (we->we_wordc + 1 + in we_askshell()
236 (flags & WRDE_DOOFFS ? we->we_offs : 0)), in we_askshell()
241 we->we_wordv = nwv; in we_askshell()
242 if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) { in we_askshell()
247 if (we->we_wordv[i] != NULL) in we_askshell()
248 we->we_wordv[i] += nstrings - we->we_strings; in we_askshell()
249 we->we_strings = nstrings; in we_askshell()
251 if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) { in we_askshell()
276 while (vofs < we->we_offs) in we_askshell()
277 we->we_wordv[vofs++] = NULL; in we_askshell()
278 p = we->we_strings + sofs; in we_askshell()
280 we->we_wordv[vofs++] = p; in we_askshell()
286 we->we_wordv[vofs] = NULL; in we_askshell()
397 wordfree(wordexp_t *we) in wordfree() argument
400 if (we == NULL) in wordfree()
402 free(we->we_wordv); in wordfree()
403 free(we->we_strings); in wordfree()
404 we->we_wordv = NULL; in wordfree()
405 we->we_strings = NULL; in wordfree()
406 we->we_nbytes = 0; in wordfree()
407 we->we_wordc = 0; in wordfree()