xref: /original-bsd/usr.bin/find/find.h (revision c10fb627)
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.8 (Berkeley) 05/24/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_PERM, N_PRINT,
19 	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 	int flags;				/* private flags */
27 	enum ntype type;			/* plan node type */
28 	union {
29 		gid_t _g_data;			/* gid */
30 		ino_t _i_data;			/* inode */
31 		mode_t _m_data;			/* mode mask */
32 		nlink_t _l_data;		/* link count */
33 		off_t _o_data;			/* file size */
34 		time_t _t_data;			/* time value */
35 		uid_t _u_data;			/* uid */
36 		struct _plandata *_p_data[2];	/* PLAN trees */
37 		struct _ex {
38 			char **_e_argv;		/* argv array */
39 			char **_e_orig;		/* original strings */
40 			int *_e_len;		/* allocated length */
41 		} ex;
42 		char *_a_data[2];		/* array of char pointers */
43 		char *_c_data;			/* char pointer */
44 	} p_un;
45 #define	a_data	p_un._a_data
46 #define	c_data	p_un._c_data
47 #define	i_data	p_un._i_data
48 #define	g_data	p_un._g_data
49 #define	l_data	p_un._l_data
50 #define	m_data	p_un._m_data
51 #define	o_data	p_un._o_data
52 #define	p_data	p_un._p_data
53 #define	t_data	p_un._t_data
54 #define	u_data	p_un._u_data
55 #define	e_argv	p_un.ex._e_argv
56 #define	e_orig	p_un.ex._e_orig
57 #define	e_len	p_un.ex._e_len
58 } PLAN;
59 
60 #include "extern.h"
61