* 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.
#endif /* not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/find/option.c,v 1.26 2008/02/23 16:29:04 imp Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/find/option.c,v 1.32 2011/05/27 22:14:49 jilles Exp $");
#include <sys/types.h>
#include <sys/stat.h>
#include "find.h"
-int typecompare(const void *, const void *);
+static int typecompare(const void *, const void *);
/* NB: the following table must be sorted lexically. */
/* Options listed with C++ comments are in gnu find, but not our find */
{ "-Bnewer", c_newer, f_newer, F_TIME_B },
{ "-Btime", c_Xtime, f_Xtime, F_TIME_B },
{ "-a", c_and, NULL, 0 },
-#ifndef __APPLE__
{ "-acl", c_acl, f_acl, 0 },
-#endif /* !__APPLE__ */
{ "-amin", c_Xmin, f_Xmin, F_TIME_A },
{ "-and", c_and, NULL, 0 },
{ "-anewer", c_newer, f_newer, F_TIME_A },
{ "-uid", c_user, f_user, 0 },
{ "-user", c_user, f_user, 0 },
{ "-wholename", c_name, f_path, 0 },
+#ifdef __APPLE__
+ { "-xattr", c_simple, f_xattr, 0 },
+ { "-xattrname", c_name, f_xattrname, 0 },
+#endif /* __APPLE__ */
{ "-xdev", c_xdev, f_always_true, 0 },
// -xtype
};
argv = *argvp;
if ((p = lookup_option(*argv)) == NULL)
- errx(1, "%s: unknown option", *argv);
+ errx(1, "%s: unknown primary or operator", *argv);
++argv;
new = (p->create)(p, &argv);
sizeof(options)/sizeof(OPTION), sizeof(OPTION), typecompare));
}
-int
+static int
typecompare(const void *a, const void *b)
{
return (strcmp(((const OPTION *)a)->name, ((const OPTION *)b)->name));