rm.h

00001 #ifndef RM_H
00002 #define RM_H
00003 
00004 /* Return values for rm_scope() */
00005 #define RM_BOGUS 0
00006 #define RM_FILE  1
00007 #define RM_DIR   2
00008 
00009 /* Flags for rm_update() */
00010 #define _RM_ENTRY   0
00011 #define _RM_ADVANCE 1
00012 #define _RM_REWIND  2
00013 #define _RM_EXIT    3
00014 
00015 /* A simple job structure */
00016 typedef struct {
00017         /* Options set at run time */
00018         unsigned int force;      /* -f option */
00019         unsigned int recursive;  /* -r option */
00020         unsigned int safe;       /* -s option */
00021 
00022         /* Keeps track of the job in progress */
00023         int advance; /* How far deep we've gone since entering */
00024         DIR *entry;  /* Entry point to the tree being removed */
00025         char *owd;   /* Where we were when we invoked rm */
00026         char *cwd;   /* Current directory being transversed */
00027         char *nwd;   /* Next directory to be transversed */
00028 
00029         /* Counters */
00030         int f_removed; /* Number of files unlinked */
00031         int d_removed; /* Number of directories unlinked */
00032 } rm_job_t;
00033 
00034 
00035 /* Prototypes for the rm command, excluding entry points */
00036 static unsigned int rm_start(rm_job_t *);
00037 static void rm_end(rm_job_t *rm);
00038 static unsigned int rm_recursive(const char *);
00039 static unsigned int rm_single(const char *);
00040 static unsigned int rm_scope(const char *);
00041 
00042 #endif /* RM_H */
00043 

Generated on Thu Jun 2 07:45:41 2011 for HelenOS/USB by  doxygen 1.4.7