Revision 24908,
1.9 KB
checked in by ghudson, 14 years ago
(diff) |
In delete:
* Patches from Jonathan Kamens:
- The "-f" flag to delete should suppress nonexistent file errors but
not other errors.
- When the "-v" flag is specified to expunge, the correct totals
should be reported. Previously, the totals were incorrect.
- Code cleanup.
|
Rev | Line | |
---|
[1706] | 1 | /* |
---|
[12350] | 2 | * $Id: directories.h,v 1.16 1999-01-22 23:08:57 ghudson Exp $ |
---|
[1706] | 3 | * |
---|
| 4 | * This file is part of a package including delete, undelete, |
---|
| 5 | * lsdel, expunge and purge. The software suite is meant as a |
---|
| 6 | * replacement for rm which allows for file recovery. |
---|
| 7 | * |
---|
| 8 | * Copyright (c) 1989 by the Massachusetts Institute of Technology. |
---|
[4505] | 9 | * For copying and distribution information, see the file "mit-copying.h." |
---|
[1706] | 10 | */ |
---|
| 11 | |
---|
[24908] | 12 | #ifndef __DELETE_DIRECTORIES_H__ |
---|
| 13 | #define __DELETE_DIRECTORIES_H__ |
---|
| 14 | |
---|
[4505] | 15 | #include "mit-copying.h" |
---|
[24908] | 16 | #include <dirent.h> |
---|
[1811] | 17 | |
---|
[1679] | 18 | typedef short Boolean; |
---|
| 19 | #define True (Boolean) 1 |
---|
| 20 | #define False (Boolean) 0 |
---|
| 21 | |
---|
[23661] | 22 | char *bytes_to_friendly(off_t); |
---|
[1732] | 23 | |
---|
[24908] | 24 | #define specs_to_space(x) ((x).st_size) |
---|
[23661] | 25 | #define space_to_friendly(x) bytes_to_friendly((x)) |
---|
| 26 | #define specs_to_friendly(x) space_to_friendly((x).st_size) |
---|
[1732] | 27 | |
---|
| 28 | #define FOLLOW_LINKS 1 |
---|
| 29 | #define DONT_FOLLOW_LINKS 0 |
---|
[2180] | 30 | |
---|
| 31 | #define DIR_MATCH 1 |
---|
| 32 | #define DIR_NO_MATCH 0 |
---|
[4423] | 33 | |
---|
| 34 | typedef struct mystat { |
---|
| 35 | dev_t st_dev; |
---|
| 36 | ino_t st_ino; |
---|
| 37 | unsigned short st_mode; |
---|
| 38 | off_t st_size; |
---|
[23665] | 39 | time_t st_ctim; |
---|
[4423] | 40 | long st_blocks; |
---|
| 41 | } mystat; |
---|
| 42 | |
---|
[1732] | 43 | |
---|
[1679] | 44 | typedef struct filrec { |
---|
| 45 | char name[MAXNAMLEN]; |
---|
| 46 | struct filrec *previous; |
---|
| 47 | struct filrec *parent; |
---|
| 48 | struct filrec *dirs; |
---|
| 49 | struct filrec *files; |
---|
| 50 | struct filrec *next; |
---|
| 51 | Boolean specified; |
---|
| 52 | Boolean freed; |
---|
[4423] | 53 | struct mystat specs; |
---|
[1679] | 54 | } filerec; |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | |
---|
[2180] | 58 | int add_directory_to_parent(); |
---|
| 59 | int add_file_to_parent(); |
---|
| 60 | int add_path_to_tree(); |
---|
| 61 | int find_child(); |
---|
[23664] | 62 | int change_path(); |
---|
[1684] | 63 | filerec *first_in_directory(); |
---|
| 64 | filerec *first_specified_in_directory(); |
---|
| 65 | filerec *get_cwd_tree(); |
---|
[24908] | 66 | int initialize_tree(void); |
---|
[1684] | 67 | filerec *get_root_tree(); |
---|
| 68 | filerec *next_directory(); |
---|
| 69 | filerec *next_in_directory(); |
---|
| 70 | filerec *next_leaf(); |
---|
| 71 | filerec *next_specified_directory(); |
---|
| 72 | filerec *next_specified_in_directory(); |
---|
| 73 | filerec *next_specified_leaf(); |
---|
| 74 | |
---|
[24908] | 75 | int get_leaf_path(filerec *leaf, char leaf_buf[]); |
---|
[2180] | 76 | int accumulate_names(); |
---|
[2221] | 77 | |
---|
| 78 | void free_leaf(); |
---|
[24908] | 79 | |
---|
| 80 | #endif /* ! __DELETE_DIRECTORIES_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.