1 /* niftyclean.h -- global defines for niftyclean
2  *
3  * Written by Jay Laefer and Mike Darweesh
4  *
5  * (C) Copyright 1989, by Jay Laefer and Mike Darweesh
6  * All Rights Reserved.
7  * Permission is granted to copy, modify, and use this as long
8  * as this message remains intact.  This is a nifty program.
9  * The authors are not responsible for any damage caused by
10  * this program.
11  * (C) Copyright 1991- by Charles Swiger
12  */
13 
14 #include <stdio.h>
15 #include <stdlib.h>
16 #include <string.h>
17 #include <sys/param.h>
18 #include <time.h>
19 #include <unistd.h>
20 
21 /*
22  * prototypes
23  */
24 
25 /* main.c */
26 extern int main(int argc, char **argv);
27 extern int flag;		/* Flag containing all switches */
28 extern int skip;		/* Flag for interactive skip directory */
29 extern time_t minimum_age;      /* Latest file creation date */
30 
31 /* match.c */
32 extern int match(char *s, char *p);
33 
34 /* parse_rc.c */
35 extern void do_rc(void);
36 extern void add_batch(char *path);
37 extern int dofile(char *dir, char *file);
38 extern void dobatch(void);
39 extern void add_glob(char *word);
40 extern void add_excl_dir(char *word);
41 extern int check_excl_list(char *dir);
42 
43 /* traverse.c */
44 extern void traverse(char *d, int leaf, int onvice);
45 #ifdef VICE
46 extern int init_volume_list(char *);
47 extern void free_volume_list(void);
48 #endif
49 
50 /* utilities.c */
51 extern void errorh(int level, char *message);
52 extern int getfirstchar(FILE *stream);
53 extern int parse_time(char *word);
54 
55 /* error values */
56 #define WARNING         0x1
57 #define INTERNAL        0x2
58 #define FATAL           0x4
59 
60 /* constants for switch flags */
61 #ifdef VICE
62 /* #define	BACKUP		0x1 */
63 /* #define	READONLY	0x2 */
64 #endif
65 
66 #define	READWRITE	0x4
67 #define	NOGLOB		0x8
68 #define	ADDGLOB		0x10
69 #define NOEXCL		0x20
70 #define ADDEXCL		0x40
71 #define	BATCH		0x80
72 #define	FORCE		0x100
73 #define	INTERACTIVE	0x200
74 #define	FLAT		0x400
75 #define	OBJECTS		0x800
76 #define	QUIET		0x1000
77 #define TIME		0x2000
78 
79 #define	MAXPATTERNSIZE	1024	/* largest glob pattern */
80 #define MAXSIZE		2048	/* largest block size for pioctl() */
81 #define MAXTIME		365	/* limit maximum time to one year */
82 #define MAXTIMESTR	"365"	/* so we can avoid sprintf() */
83 
84 #define	RCFILE		".cleanrc"
85 
86 /* acceptable switches */
87 #ifdef VICE
88 /* #define ARGSTRING "abe:E:filoqrt:Vwx:X:" */
89 #define ARGSTRING "be:E:filoqt:Vwx:X:"
90 #else
91 #define ARGSTRING "be:E:filoqt:Vx:X:"
92 #endif
93 
94 /* structure definitions */
95 struct globtype {
96     struct globtype *next;
97     char glob[1];
98 };
99 
100 struct excl_dirtype {
101     struct excl_dirtype *next;
102     char excl_dir[1];
103 };
104 
105 struct batchtype {
106     struct batchtype *next;
107     char path[1];
108 };
109 
110 struct dirtype {
111     int len;
112     int leaf;
113     struct dirtype *next;
114     char subdir[1];
115 };
116 
117 #ifdef VICE
118 struct voltype {
119     struct voltype *next;
120     long Vid;
121 };
122 #endif
123