xref: /original-bsd/usr.bin/find/find.h (revision cf2124ff)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Cimarron D. Taylor of the University of California, Berkeley.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)find.h	5.9 (Berkeley) 07/19/91
11  */
12 
13 /* node type */
14 enum ntype {
15 	N_AND = 1, 				/* must start > 0 */
16 	N_ATIME, N_CLOSEPAREN, N_CTIME, N_DEPTH, N_EXEC, N_EXPR, N_FOLLOW,
17 	N_FSTYPE, N_GROUP, N_INUM, N_LINKS, N_LS, N_MTIME, N_NAME, N_NEWER,
18 	N_NOGROUP, N_NOT, N_NOUSER, N_OK, N_OPENPAREN, N_OR, N_PATH,
19 	N_PERM, N_PRINT, N_PRUNE, N_SIZE, N_TYPE, N_USER, N_XDEV,
20 };
21 
22 /* node definition */
23 typedef struct _plandata {
24 	struct _plandata *next;			/* next node */
25 	int (*eval)();				/* node evaluation function */
26 #define	F_EQUAL		1			/* [acm]time inum links size */
27 #define	F_LESSTHAN	2
28 #define	F_GREATER	3
29 #define	F_NEEDOK	1			/* exec ok */
30 #define	F_MTFLAG	1			/* fstype */
31 #define	F_MTTYPE	2
32 #define	F_ATLEAST	1			/* perm */
33 	int flags;				/* private flags */
34 	enum ntype type;			/* plan node type */
35 	union {
36 		gid_t _g_data;			/* gid */
37 		ino_t _i_data;			/* inode */
38 		mode_t _m_data;			/* mode mask */
39 		nlink_t _l_data;		/* link count */
40 		off_t _o_data;			/* file size */
41 		time_t _t_data;			/* time value */
42 		uid_t _u_data;			/* uid */
43 		short _mt_data;			/* mount flags */
44 		struct _plandata *_p_data[2];	/* PLAN trees */
45 		struct _ex {
46 			char **_e_argv;		/* argv array */
47 			char **_e_orig;		/* original strings */
48 			int *_e_len;		/* allocated length */
49 		} ex;
50 		char *_a_data[2];		/* array of char pointers */
51 		char *_c_data;			/* char pointer */
52 	} p_un;
53 } PLAN;
54 #define	a_data	p_un._a_data
55 #define	c_data	p_un._c_data
56 #define	i_data	p_un._i_data
57 #define	g_data	p_un._g_data
58 #define	l_data	p_un._l_data
59 #define	m_data	p_un._m_data
60 #define	mt_data	p_un._mt_data
61 #define	o_data	p_un._o_data
62 #define	p_data	p_un._p_data
63 #define	t_data	p_un._t_data
64 #define	u_data	p_un._u_data
65 #define	e_argv	p_un.ex._e_argv
66 #define	e_orig	p_un.ex._e_orig
67 #define	e_len	p_un.ex._e_len
68 
69 #include "extern.h"
70