From e07cbd10f59a8197a0b5fc789ea3781a863548e8 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 29 Oct 2016 16:24:23 -0400 Subject: Implement -perm. --- bfs.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'bfs.h') diff --git a/bfs.h b/bfs.h index b504f0c..55aeda2 100644 --- a/bfs.h +++ b/bfs.h @@ -128,6 +128,18 @@ enum cmp_flag { CMP_GREATER, }; +/** + * Possible types of mode comparison. + */ +enum mode_cmp { + /** Mode is an exact match (MODE). */ + MODE_EXACT, + /** Mode has all these bits (-MODE). */ + MODE_ALL, + /** Mode has any of these bits (/MODE). */ + MODE_ANY, +}; + /** * Available struct stat time fields. */ @@ -207,6 +219,13 @@ struct expr { /** The optional comparison flag. */ enum cmp_flag cmp_flag; + /** The mode comparison flag. */ + enum mode_cmp mode_cmp; + /** Mode to use for files. */ + mode_t file_mode; + /** Mode to use for directories (different due to X). */ + mode_t dir_mode; + /** The optional reference time. */ struct timespec reftime; /** The optional time field. */ @@ -260,6 +279,7 @@ bool eval_true(const struct expr *expr, struct eval_state *state); bool eval_false(const struct expr *expr, struct eval_state *state); bool eval_access(const struct expr *expr, struct eval_state *state); +bool eval_perm(const struct expr *expr, struct eval_state *state); bool eval_acmtime(const struct expr *expr, struct eval_state *state); bool eval_acnewer(const struct expr *expr, struct eval_state *state); -- cgit v1.2.3