Lines Matching refs:state
199 /* State of an `ar_glob' run, passed to `ar_glob_match'. */
211 element against the pattern in STATE. */
217 int gid UNUSED, int mode UNUSED, struct ar_glob_state *state)
219 if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0)
222 struct nameseq *new = (struct nameseq *) xmalloc (state->size);
223 new->name = concat (state->arname, mem, ")");
224 new->next = state->chain;
225 state->chain = new;
226 ++state->n;
271 struct ar_glob_state state;
280 ar_glob_match will accumulate them in STATE.chain. */
282 state.arname = (char *) alloca (i + 2);
283 bcopy (arname, state.arname, i);
284 state.arname[i] = '(';
285 state.arname[i + 1] = '\0';
286 state.pattern = member_pattern;
287 state.size = size;
288 state.chain = 0;
289 state.n = 0;
290 (void) ar_scan (arname, ar_glob_match, (intptr_t) &state);
292 if (state.chain == 0)
296 names = (char **) alloca (state.n * sizeof (char *));
298 for (n = state.chain; n != 0; n = n->next)
306 for (n = state.chain; n != 0; n = n->next)
309 return state.chain;