summaryrefslogtreecommitdiffstats
path: root/bfs.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-10-29 16:24:23 -0400
committerTavian Barnes <tavianator@tavianator.com>2016-10-29 16:35:53 -0400
commite07cbd10f59a8197a0b5fc789ea3781a863548e8 (patch)
treeb6233560681d578072173a2bc97eddefcf70e3d2 /bfs.h
parent9def6eb2932fef0d049e7b2996e5c69b07f1ca20 (diff)
downloadbfs-e07cbd10f59a8197a0b5fc789ea3781a863548e8.tar.xz
Implement -perm.
Diffstat (limited to 'bfs.h')
-rw-r--r--bfs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/bfs.h b/bfs.h
index b504f0c..55aeda2 100644
--- a/bfs.h
+++ b/bfs.h
@@ -129,6 +129,18 @@ enum cmp_flag {
};
/**
+ * 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.
*/
enum time_field {
@@ -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);