Lines Matching defs:we
57 * of words in `we'. See wordexp(3).
61 wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags)
65 _DIAGASSERT(we != NULL);
68 wordfree(we);
70 we->we_wordc = 0;
71 we->we_wordv = NULL;
72 we->we_strings = NULL;
73 we->we_nbytes = 0;
76 wordfree(we);
79 if ((error = we_askshell(words, we, flags)) != 0) {
80 wordfree(we);
93 we_askshell(const char *words, wordexp_t *we, int flags)
99 size_t sofs; /* Offset into we->we_strings */
100 size_t vofs; /* Offset into we->we_wordv */
186 * and string storage buffers for the expanded words we're about to
189 sofs = we->we_nbytes;
190 vofs = we->we_wordc;
192 vofs += we->we_offs;
193 we->we_wordc += nwords;
194 we->we_nbytes += nbytes;
195 if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 +
196 (flags & WRDE_DOOFFS ? we->we_offs : 0)) *
202 we->we_wordv = nwv;
203 if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) {
209 if (we->we_wordv[ui] != NULL)
210 we->we_wordv[ui] += nstrings - we->we_strings;
211 we->we_strings = nstrings;
213 if (fread(we->we_strings + sofs, sizeof(char), nbytes, fp) != nbytes) {
231 while (vofs < we->we_offs)
232 we->we_wordv[vofs++] = NULL;
233 p = we->we_strings + sofs;
235 we->we_wordv[vofs++] = p;
241 we->we_wordv[vofs] = NULL;
337 wordfree(wordexp_t *we)
339 _DIAGASSERT(we != NULL);
340 free(we->we_wordv);
341 free(we->we_strings);
342 we->we_wordv = NULL;
343 we->we_strings = NULL;
344 we->we_nbytes = 0;
345 we->we_wordc = 0;