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

Revision 23664, 1.8 KB checked in by broder, 15 years ago (diff)
In delete: * Apply patches from jik: - Fix compiler nit by adding missing prototyle to directories.h
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
14typedef short Boolean;
15#define True                    (Boolean) 1
16#define False                   (Boolean) 0
17
18char *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
32typedef 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_chtime;
38     long st_blocks;
39} mystat;
40
41     
42typedef 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
56int add_directory_to_parent();
57int add_file_to_parent();
58int add_path_to_tree();
59int find_child();
60int change_path();
61filerec *first_in_directory();
62filerec *first_specified_in_directory();
63filerec *get_cwd_tree();
64filerec *get_root_tree();
65filerec *next_directory();
66filerec *next_in_directory();
67filerec *next_leaf();
68filerec *next_specified_directory();
69filerec *next_specified_in_directory();
70filerec *next_specified_leaf();
71
72int get_leaf_path();
73int accumulate_names();
74
75void free_leaf();
Note: See TracBrowser for help on using the repository browser.