Revision 23665,
1.8 KB
checked in by broder, 16 years ago
(diff) |
In delete:
* Apply patches from jik:
- Change the "st_chtime" structure member to "st_ctim" to avoid a
potential header file conflict.
|
Line | |
---|
1 | /* |
---|
2 | * $Id: directories.h,v 1.16 1999-01-22 23:08:57 ghudson Exp $ |
---|
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. |
---|
9 | * For copying and distribution information, see the file "mit-copying.h." |
---|
10 | */ |
---|
11 | |
---|
12 | #include "mit-copying.h" |
---|
13 | |
---|
14 | typedef short Boolean; |
---|
15 | #define True (Boolean) 1 |
---|
16 | #define False (Boolean) 0 |
---|
17 | |
---|
18 | char *bytes_to_friendly(off_t); |
---|
19 | |
---|
20 | #define specs_to_space(x) ((x).st_blocks) |
---|
21 | #define space_to_k(x) ((x) / 2 + (((x) % 2) ? 1 : 0)) |
---|
22 | #define specs_to_k(x) space_to_k((x).st_blocks) |
---|
23 | #define space_to_friendly(x) bytes_to_friendly((x)) |
---|
24 | #define specs_to_friendly(x) space_to_friendly((x).st_size) |
---|
25 | |
---|
26 | #define FOLLOW_LINKS 1 |
---|
27 | #define DONT_FOLLOW_LINKS 0 |
---|
28 | |
---|
29 | #define DIR_MATCH 1 |
---|
30 | #define DIR_NO_MATCH 0 |
---|
31 | |
---|
32 | typedef struct mystat { |
---|
33 | dev_t st_dev; |
---|
34 | ino_t st_ino; |
---|
35 | unsigned short st_mode; |
---|
36 | off_t st_size; |
---|
37 | time_t st_ctim; |
---|
38 | long st_blocks; |
---|
39 | } mystat; |
---|
40 | |
---|
41 | |
---|
42 | typedef struct filrec { |
---|
43 | char name[MAXNAMLEN]; |
---|
44 | struct filrec *previous; |
---|
45 | struct filrec *parent; |
---|
46 | struct filrec *dirs; |
---|
47 | struct filrec *files; |
---|
48 | struct filrec *next; |
---|
49 | Boolean specified; |
---|
50 | Boolean freed; |
---|
51 | struct mystat specs; |
---|
52 | } filerec; |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | int add_directory_to_parent(); |
---|
57 | int add_file_to_parent(); |
---|
58 | int add_path_to_tree(); |
---|
59 | int find_child(); |
---|
60 | int change_path(); |
---|
61 | filerec *first_in_directory(); |
---|
62 | filerec *first_specified_in_directory(); |
---|
63 | filerec *get_cwd_tree(); |
---|
64 | filerec *get_root_tree(); |
---|
65 | filerec *next_directory(); |
---|
66 | filerec *next_in_directory(); |
---|
67 | filerec *next_leaf(); |
---|
68 | filerec *next_specified_directory(); |
---|
69 | filerec *next_specified_in_directory(); |
---|
70 | filerec *next_specified_leaf(); |
---|
71 | |
---|
72 | int get_leaf_path(); |
---|
73 | int accumulate_names(); |
---|
74 | |
---|
75 | void free_leaf(); |
---|
Note: See
TracBrowser
for help on using the repository browser.