source: trunk/athena/bin/delete/directories.h @ 24908

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.
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#ifndef __DELETE_DIRECTORIES_H__
13#define __DELETE_DIRECTORIES_H__
14
15#include "mit-copying.h"
16#include <dirent.h>
17
18typedef short Boolean;
19#define True                    (Boolean) 1
20#define False                   (Boolean) 0
21
22char *bytes_to_friendly(off_t);
23
24#define specs_to_space(x)       ((x).st_size)
25#define space_to_friendly(x)    bytes_to_friendly((x))
26#define specs_to_friendly(x)    space_to_friendly((x).st_size)
27
28#define FOLLOW_LINKS            1
29#define DONT_FOLLOW_LINKS       0
30
31#define DIR_MATCH               1
32#define DIR_NO_MATCH            0
33
34typedef struct mystat {
35     dev_t st_dev;
36     ino_t st_ino;
37     unsigned short st_mode;
38     off_t st_size;
39     time_t st_ctim;
40     long st_blocks;
41} mystat;
42
43     
44typedef 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;
53     struct mystat specs;
54} filerec;
55
56
57
58int add_directory_to_parent();
59int add_file_to_parent();
60int add_path_to_tree();
61int find_child();
62int change_path();
63filerec *first_in_directory();
64filerec *first_specified_in_directory();
65filerec *get_cwd_tree();
66int initialize_tree(void);
67filerec *get_root_tree();
68filerec *next_directory();
69filerec *next_in_directory();
70filerec *next_leaf();
71filerec *next_specified_directory();
72filerec *next_specified_in_directory();
73filerec *next_specified_leaf();
74
75int get_leaf_path(filerec *leaf, char leaf_buf[]);
76int accumulate_names();
77
78void free_leaf();
79
80#endif /* ! __DELETE_DIRECTORIES_H__ */
Note: See TracBrowser for help on using the repository browser.