Lines Matching refs:state
105 rm(State_t* state, register FTSENT* ent) in rm() argument
114 if (!state->force) in rm()
117 else if (state->fs3d && iview(ent->fts_statp)) in rm()
123 if (state->unconditional) in rm()
132 else if (!state->force) in rm()
145 if (!state->force) in rm()
151 if (!state->recursive) in rm()
159 if (state->unconditional && (ent->fts_statp->st_mode ^ S_IRWXU)) in rm()
181 if (state->interactive) in rm()
183 … if ((v = astquery(-1, "remove directory %s? ", ent->fts_path)) < 0 || sh_checksig(state->context)) in rm()
204 if (isempty(ent) || state->directory) in rm()
210 if (state->verbose) in rm()
212 if ((ent->fts_info == FTS_DC || state->directory) ? remove(path) : rmdir(path)) in rm()
230 if (!state->force) in rm()
237 else if (!state->force) in rm()
245 if (!state->force) in rm()
253 if (state->verbose) in rm()
255 if (state->interactive) in rm()
257 if ((v = astquery(-1, "remove %s? ", ent->fts_path)) < 0 || sh_checksig(state->context)) in rm()
265 else if (!state->force && state->terminal && S_ISREG(ent->fts_statp->st_mode)) in rm()
280 ent->fts_statp->st_uid != state->uid ? "``not owner''" : in rm()
282 sh_checksig(state->context)) in rm()
294 if (state->clobber && S_ISREG(ent->fts_statp->st_mode) && ent->fts_statp->st_size > 0) in rm()
304 if (write(n, state->buf, sizeof(state->buf)) != sizeof(state->buf)) in rm()
309 if (c <= sizeof(state->buf)) in rm()
311 c -= sizeof(state->buf); in rm()
326 if (!state->force || state->interactive) in rm()
341 State_t state; in b_rm() local
347 memset(&state, 0, sizeof(state)); in b_rm()
348 state.context = context; in b_rm()
349 state.fs3d = fs3d(FS3D_TEST); in b_rm()
350 state.terminal = isatty(0); in b_rm()
356 state.directory = 1; in b_rm()
359 state.force = 1; in b_rm()
360 state.interactive = 0; in b_rm()
363 state.interactive = 1; in b_rm()
364 state.force = 0; in b_rm()
368 state.recursive = 1; in b_rm()
372 state.clobber = 1; in b_rm()
378 state.unconditional = 1; in b_rm()
381 state.verbose = 1; in b_rm()
402 if (state.interactive) in b_rm()
403 state.verbose = 0; in b_rm()
404 state.uid = geteuid(); in b_rm()
405 state.unconditional = state.unconditional && state.recursive && state.force; in b_rm()
406 if (state.recursive && state.fs3d) in b_rm()
408 set3d = state.fs3d; in b_rm()
409 state.fs3d = 0; in b_rm()
416 while (!sh_checksig(context) && (ent = fts_read(fts)) && !rm(&state, ent)); in b_rm()
419 else if (!state.force) in b_rm()