From ce73721712640e0463d22a324f81814439cdc51d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 2 Jun 2002 21:28:41 +0000 Subject: (enum RM_status) [RM_NONEMPTY_DIR]: New member. (UPDATE_STATUS): New macro. Include save-cwd.h. (struct File_spec): Remove declaration. Update prototypes. --- src/remove.h | 33 ++++++++++++++------------------- 1 file 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)); -- cgit v1.2.3-70-g09d2