summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-06-02 21:28:41 +0000
committerJim Meyering <jim@meyering.net>2002-06-02 21:28:41 +0000
commitce73721712640e0463d22a324f81814439cdc51d (patch)
tree170ada3daea2b74666f15edcfb16d5b1b65dc9e6 /src
parent0f6d0c6016b2502aca42bba20b068e554236c58b (diff)
downloadcoreutils-ce73721712640e0463d22a324f81814439cdc51d.tar.xz
(enum RM_status) [RM_NONEMPTY_DIR]: New member.
(UPDATE_STATUS): New macro. Include save-cwd.h. (struct File_spec): Remove declaration. Update prototypes.
Diffstat (limited to 'src')
-rw-r--r--src/remove.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/remove.h b/src/remove.h
index c35235fec..4fe56d2de 100644
--- a/src/remove.h
+++ b/src/remove.h
@@ -1,3 +1,4 @@
+#include "save-cwd.h"
struct rm_options
{
@@ -25,24 +26,23 @@ struct rm_options
enum RM_status
{
/* These must be listed in order of increasing seriousness. */
- RM_OK = 1,
+ RM_OK = 2,
RM_USER_DECLINED,
- RM_ERROR
+ RM_ERROR,
+ RM_NONEMPTY_DIR
};
#define VALID_STATUS(S) \
((S) == RM_OK || (S) == RM_USER_DECLINED || (S) == RM_ERROR)
-struct File_spec
-{
- char *filename;
- unsigned int have_filetype_mode:1;
- unsigned int have_full_mode:1;
- unsigned int have_device:1;
- mode_t mode;
- ino_t st_ino;
- dev_t st_dev;
-};
+#define UPDATE_STATUS(S, New_value) \
+ do \
+ { \
+ if ((New_value) == RM_ERROR \
+ || ((New_value) == RM_USER_DECLINED && (S) == RM_OK)) \
+ (S) = (New_value); \
+ } \
+ while (0)
struct dev_ino
{
@@ -50,10 +50,5 @@ struct dev_ino
dev_t st_dev;
};
-enum RM_status rm PARAMS ((struct File_spec *fs,
- int user_specified_name,
- struct rm_options const *x,
- struct dev_ino const *cwd_dev_ino));
-void fspec_init_file PARAMS ((struct File_spec *fs, const char *filename));
-void remove_init PARAMS ((void));
-void remove_fini PARAMS ((void));
+enum RM_status rm PARAMS ((size_t n_files, char const *const *file,
+ struct rm_options const *x));