-/* * $OpenBSD: extern.h,v 1.3 1996/08/31 22:40:18 tholo Exp $*/
+/* * $OpenBSD: extern.h,v 1.4 1996/09/01 04:30:15 tholo Exp $*/
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
PLAN *c_inum __P((char *));
PLAN *c_links __P((char *));
PLAN *c_ls __P((void));
-PLAN *c_mdepth __P((char *));
+PLAN *c_maxdepth __P((char *));
+PLAN *c_mindepth __P((char *));
PLAN *c_name __P((char *));
PLAN *c_newer __P((char *));
PLAN *c_nogroup __P((void));
-.\" $OpenBSD: find.1,v 1.6 1996/08/31 22:40:19 tholo Exp $
+.\" $OpenBSD: find.1,v 1.7 1996/09/01 04:30:16 tholo Exp $
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
displayed preceded by ``\->''.
The format is identical to that produced by ``ls \-dgils''.
.It Ic -maxdepth Ar n
-True if the current search depth is less than what is specified in
+True if the current search depth is less than or equal to what is specified in
+.Ar n .
+.It Ic -mindepth Ar n
+True if the current search depth is at least what is specified in
.Ar n .
.It Ic -mtime Ar n
True if the difference between the file last modification time and the time
-/* * $OpenBSD: find.h,v 1.3 1996/08/31 22:40:20 tholo Exp $*/
+/* * $OpenBSD: find.h,v 1.4 1996/09/01 04:30:16 tholo Exp $*/
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
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_MDEPTH, N_MTIME, N_NAME,
- N_NEWER, N_NOGROUP, N_NOT, N_NOUSER, N_OK, N_OPENPAREN, N_OR, N_PATH,
- N_PERM, N_PRINT, N_PRINT0, N_PRUNE, N_SIZE, N_TYPE, N_USER, N_XDEV,
+ N_FSTYPE, N_GROUP, N_INUM, N_LINKS, N_LS, N_MAXDEPTH, N_MINDEPTH,
+ N_MTIME, N_NAME, N_NEWER, N_NOGROUP, N_NOT, N_NOUSER, N_OK,
+ N_OPENPAREN, N_OR, N_PATH, N_PERM, N_PRINT, N_PRINT0, N_PRUNE,
+ N_SIZE, N_TYPE, N_USER, N_XDEV,
};
/* node definition */
} ex;
char *_a_data[2]; /* array of char pointers */
char *_c_data; /* char pointer */
- int _d_data; /* tree depth */
+ int _max_data; /* tree depth */
+ int _min_data; /* tree depth */
} p_un;
} PLAN;
-#define a_data p_un._a_data
-#define c_data p_un._c_data
-#define d_data p_un._d_data
-#define i_data p_un._i_data
-#define g_data p_un._g_data
-#define l_data p_un._l_data
-#define m_data p_un._m_data
-#define mt_data p_un._mt_data
-#define o_data p_un._o_data
-#define p_data p_un._p_data
-#define t_data p_un._t_data
-#define u_data p_un._u_data
-#define e_argv p_un.ex._e_argv
-#define e_orig p_un.ex._e_orig
-#define e_len p_un.ex._e_len
+#define a_data p_un._a_data
+#define c_data p_un._c_data
+#define i_data p_un._i_data
+#define g_data p_un._g_data
+#define l_data p_un._l_data
+#define m_data p_un._m_data
+#define max_data p_un._max_data
+#define min_data p_un._min_data
+#define mt_data p_un._mt_data
+#define o_data p_un._o_data
+#define p_data p_un._p_data
+#define t_data p_un._t_data
+#define u_data p_un._u_data
+#define e_argv p_un.ex._e_argv
+#define e_orig p_un.ex._e_orig
+#define e_len p_un.ex._e_len
typedef struct _option {
char *name; /* option name */
-/* $OpenBSD: function.c,v 1.5 1996/08/31 22:40:21 tholo Exp $ */
+/* $OpenBSD: function.c,v 1.6 1996/09/01 04:30:17 tholo Exp $ */
/*-
* Copyright (c) 1990, 1993
#ifndef lint
/*static char sccsid[] = "from: @(#)function.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: function.c,v 1.5 1996/08/31 22:40:21 tholo Exp $";
+static char rcsid[] = "$OpenBSD: function.c,v 1.6 1996/09/01 04:30:17 tholo Exp $";
#endif /* not lint */
#include <sys/param.h>
* maximum depth specified
*/
int
-f_mdepth(plan, entry)
+f_maxdepth(plan, entry)
PLAN *plan;
FTSENT *entry;
{
extern FTS *tree;
- if (entry->fts_level >= plan->d_data)
+ if (entry->fts_level >= plan->max_data)
fts_set(tree, entry, FTS_SKIP);
- return (entry->fts_level <= plan->d_data);
+ return (entry->fts_level <= plan->max_data);
}
PLAN *
-c_mdepth(arg)
+c_maxdepth(arg)
char *arg;
{
PLAN *new;
- new = palloc(N_MDEPTH, f_mdepth);
- new->d_data = atoi(arg);
+ new = palloc(N_MAXDEPTH, f_maxdepth);
+ new->max_data = atoi(arg);
+ return (new);
+}
+
+/*
+ * - mindepth n functions --
+ *
+ * True if the current search depth is greater than or equal to the
+ * minimum depth specified
+ */
+int
+f_mindepth(plan, entry)
+ PLAN *plan;
+ FTSENT *entry;
+{
+ extern FTS *tree;
+
+ return (entry->fts_level >= plan->min_data);
+}
+
+PLAN *
+c_mindepth(arg)
+ char *arg;
+{
+ PLAN *new;
+
+ new = palloc(N_MINDEPTH, f_mindepth);
+ new->min_data = atoi(arg);
return (new);
}
-/* $OpenBSD: option.c,v 1.3 1996/08/31 22:40:22 tholo Exp $ */
+/* $OpenBSD: option.c,v 1.4 1996/09/01 04:30:17 tholo Exp $ */
/*-
* Copyright (c) 1990, 1993
#ifndef lint
/*static char sccsid[] = "from: @(#)option.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: option.c,v 1.3 1996/08/31 22:40:22 tholo Exp $";
+static char rcsid[] = "$OpenBSD: option.c,v 1.4 1996/09/01 04:30:17 tholo Exp $";
#endif /* not lint */
#include <sys/types.h>
{ "-inum", N_INUM, c_inum, O_ARGV },
{ "-links", N_LINKS, c_links, O_ARGV },
{ "-ls", N_LS, c_ls, O_ZERO },
- { "-maxdepth", N_MDEPTH, c_mdepth, O_ARGV },
+ { "-maxdepth", N_MAXDEPTH, c_maxdepth, O_ARGV },
+ { "-mindepth", N_MINDEPTH, c_mindepth, O_ARGV },
+ { "-mount", N_XDEV, c_xdev, O_ZERO },
{ "-mtime", N_MTIME, c_mtime, O_ARGV },
{ "-name", N_NAME, c_name, O_ARGV },
{ "-newer", N_NEWER, c_newer, O_ARGV },