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