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

Revision 7980, 2.0 KB checked in by cfields, 29 years ago (diff)
st.time/st.ctime renamed to st.chtime, ifdefs removed.
Line 
1/*
2 * $Source: /afs/dev.mit.edu/source/repository/athena/bin/delete/directories.h,v $
3 * $Author: cfields $
4 * $Header: /afs/dev.mit.edu/source/repository/athena/bin/delete/directories.h,v 1.14 1995-07-31 23:28:50 cfields Exp $
5 *
6 * This file is part of a package including delete, undelete,
7 * lsdel, expunge and purge.  The software suite is meant as a
8 * replacement for rm which allows for file recovery.
9 *
10 * Copyright (c) 1989 by the Massachusetts Institute of Technology.
11 * For copying and distribution information, see the file "mit-copying.h."
12 */
13
14#include "mit-copying.h"
15
16typedef short Boolean;
17#define True                    (Boolean) 1
18#define False                   (Boolean) 0
19
20
21#ifdef USE_BLOCKS
22#define specs_to_space(x)       ((x).st_blocks)
23#define space_to_k(x)           ((x) / 2 + (((x) % 2) ? 1 : 0))
24#define specs_to_k(x)           space_to_k((x).st_blocks)
25#else
26#define specs_to_space(x)       ((x).st_size)
27#define space_to_k(x)           ((x) / 1024 + (((x) % 1024) ? 1 : 0))
28#define specs_to_k(x)           space_to_k((x).st_size)
29#endif
30
31#define FOLLOW_LINKS            1
32#define DONT_FOLLOW_LINKS       0
33
34#define DIR_MATCH               1
35#define DIR_NO_MATCH            0
36
37typedef struct mystat {
38     dev_t st_dev;
39     ino_t st_ino;
40     unsigned short st_mode;
41     off_t st_size;
42     time_t st_chtime;
43#ifdef USE_BLOCKS
44     long st_blocks;
45#endif
46} mystat;
47
48     
49typedef struct filrec {
50     char name[MAXNAMLEN];
51     struct filrec *previous;
52     struct filrec *parent;
53     struct filrec *dirs;
54     struct filrec *files;
55     struct filrec *next;
56     Boolean specified;
57     Boolean freed;
58     struct mystat specs;
59} filerec;
60
61
62
63int add_directory_to_parent();
64int add_file_to_parent();
65int add_path_to_tree();
66int find_child();
67filerec *first_in_directory();
68filerec *first_specified_in_directory();
69filerec *get_cwd_tree();
70filerec *get_root_tree();
71filerec *next_directory();
72filerec *next_in_directory();
73filerec *next_leaf();
74filerec *next_specified_directory();
75filerec *next_specified_in_directory();
76filerec *next_specified_leaf();
77
78int get_leaf_path();
79int accumulate_names();
80
81void free_leaf();
Note: See TracBrowser for help on using the repository browser.