BSD 4_3_Net_2 release
[unix-history] / usr / src / usr.bin / find / find.h
index fbeedc9..3a78e9e 100644 (file)
@@ -5,17 +5,52 @@
  * This code is derived from software contributed to Berkeley by
  * Cimarron D. Taylor of the University of California, Berkeley.
  *
  * This code is derived from software contributed to Berkeley by
  * Cimarron D. Taylor of the University of California, Berkeley.
  *
- * %sccs.include.redist.c%
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
  *
  *
- *     @(#)find.h      5.5 (Berkeley) %G%
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)find.h      5.8 (Berkeley) 5/24/91
  */
 
  */
 
+/* node type */
+enum ntype {
+       N_AND = 1,                              /* must start > 0 */
+       N_ATIME, N_CLOSEPAREN, N_CTIME, N_DEPTH, N_EXEC, N_EXPR, N_FOLLOW,
+       N_FSTYPE, N_GROUP, N_INUM, N_LINKS, N_LS, N_MTIME, N_NAME, N_NEWER,
+       N_NOGROUP, N_NOT, N_NOUSER, N_OK, N_OPENPAREN, N_OR, N_PERM, N_PRINT,
+       N_PRUNE, N_SIZE, N_TYPE, N_USER, N_XDEV,
+};
+
 /* node definition */
 typedef struct _plandata {
        struct _plandata *next;                 /* next node */
        int (*eval)();                          /* node evaluation function */
        int flags;                              /* private flags */
 /* node definition */
 typedef struct _plandata {
        struct _plandata *next;                 /* next node */
        int (*eval)();                          /* node evaluation function */
        int flags;                              /* private flags */
-       int type;                               /* plan node type */
+       enum ntype type;                        /* plan node type */
        union {
                gid_t _g_data;                  /* gid */
                ino_t _i_data;                  /* inode */
        union {
                gid_t _g_data;                  /* gid */
                ino_t _i_data;                  /* inode */
@@ -48,40 +83,4 @@ typedef struct _plandata {
 #define        e_len   p_un.ex._e_len
 } PLAN;
 
 #define        e_len   p_un.ex._e_len
 } PLAN;
 
-/* node types */
-#define        T_AND           1               /* must start at >0 */
-#define        T_ATIME         2
-#define        T_CLOSEPAREN    3
-#define        T_CTIME         4
-#define        T_DEPTH         5
-#define        T_EXEC          6
-#define        T_EXPR          7
-#define        T_FOLLOW        8
-#define        T_FSTYPE        9
-#define        T_GROUP         10
-#define        T_INUM          11
-#define        T_LINKS         12
-#define        T_LS            13
-#define        T_MTIME         14
-#define        T_NAME          15
-#define        T_NEWER         16
-#define        T_NOGROUP       17
-#define        T_NOT           18
-#define        T_NOUSER        19
-#define        T_OK            20
-#define        T_OPENPAREN     21
-#define        T_OR            22
-#define        T_PERM          23
-#define        T_PRINT         24
-#define        T_PRUNE         25
-#define        T_SIZE          26
-#define        T_TYPE          27
-#define        T_USER          28
-#define        T_XDEV          29
-
-#define        error(name, number) \
-       (void)fprintf(stderr, "find: %s: %s\n", name, strerror(number));
-
-extern int ftsoptions;
-extern int isdeprecated, isdepth, isoutput, isrelative;
-void *emalloc();
+#include "extern.h"