*** empty log message ***
[coreutils.git] / src / remove.h
blob4fe56d2de4b8cdf4c383d76f5dda084328ed4f10
1 #include "save-cwd.h"
3 struct rm_options
5 /* If nonzero, ignore nonexistent files. */
6 int ignore_missing_files;
8 /* If nonzero, query the user about whether to remove each file. */
9 int interactive;
11 /* If nonzero, recursively remove directories. */
12 int recursive;
14 /* If nonzero, stdin is a tty. */
15 int stdin_tty;
17 /* If nonzero, remove directories with unlink instead of rmdir, and don't
18 require a directory to be empty before trying to unlink it.
19 Only works for the super-user. */
20 int unlink_dirs;
22 /* If nonzero, display the name of each file removed. */
23 int verbose;
26 enum RM_status
28 /* These must be listed in order of increasing seriousness. */
29 RM_OK = 2,
30 RM_USER_DECLINED,
31 RM_ERROR,
32 RM_NONEMPTY_DIR
35 #define VALID_STATUS(S) \
36 ((S) == RM_OK || (S) == RM_USER_DECLINED || (S) == RM_ERROR)
38 #define UPDATE_STATUS(S, New_value) \
39 do \
40 { \
41 if ((New_value) == RM_ERROR \
42 || ((New_value) == RM_USER_DECLINED && (S) == RM_OK)) \
43 (S) = (New_value); \
44 } \
45 while (0)
47 struct dev_ino
49 ino_t st_ino;
50 dev_t st_dev;
53 enum RM_status rm PARAMS ((size_t n_files, char const *const *file,
54 struct rm_options const *x));