1 // Copyright © Tavian Barnes <tavianator@tavianator.com>
2 // SPDX-License-Identifier: 0BSD
5 * The evaluation functions that implement primary expressions like -name,
18 * Ephemeral state for evaluating an expression.
23 * Expression evaluation function.
26 * The current expression.
28 * The current evaluation state.
30 * The result of the test.
32 typedef bool bfs_eval_fn(const struct bfs_expr *expr, struct bfs_eval *state);
35 * Evaluate the command line.
38 * The bfs context to evaluate.
40 * EXIT_SUCCESS on success, otherwise on failure.
42 int bfs_eval(const struct bfs_ctx *ctx);
44 // Predicate evaluation functions
46 bool eval_true(const struct bfs_expr *expr, struct bfs_eval *state);
47 bool eval_false(const struct bfs_expr *expr, struct bfs_eval *state);
49 bool eval_access(const struct bfs_expr *expr, struct bfs_eval *state);
50 bool eval_acl(const struct bfs_expr *expr, struct bfs_eval *state);
51 bool eval_capable(const struct bfs_expr *expr, struct bfs_eval *state);
52 bool eval_perm(const struct bfs_expr *expr, struct bfs_eval *state);
53 bool eval_xattr(const struct bfs_expr *expr, struct bfs_eval *state);
54 bool eval_xattrname(const struct bfs_expr *expr, struct bfs_eval *state);
56 bool eval_newer(const struct bfs_expr *expr, struct bfs_eval *state);
57 bool eval_time(const struct bfs_expr *expr, struct bfs_eval *state);
58 bool eval_used(const struct bfs_expr *expr, struct bfs_eval *state);
60 bool eval_gid(const struct bfs_expr *expr, struct bfs_eval *state);
61 bool eval_uid(const struct bfs_expr *expr, struct bfs_eval *state);
62 bool eval_nogroup(const struct bfs_expr *expr, struct bfs_eval *state);
63 bool eval_nouser(const struct bfs_expr *expr, struct bfs_eval *state);
65 bool eval_depth(const struct bfs_expr *expr, struct bfs_eval *state);
66 bool eval_empty(const struct bfs_expr *expr, struct bfs_eval *state);
67 bool eval_flags(const struct bfs_expr *expr, struct bfs_eval *state);
68 bool eval_fstype(const struct bfs_expr *expr, struct bfs_eval *state);
69 bool eval_hidden(const struct bfs_expr *expr, struct bfs_eval *state);
70 bool eval_inum(const struct bfs_expr *expr, struct bfs_eval *state);
71 bool eval_links(const struct bfs_expr *expr, struct bfs_eval *state);
72 bool eval_samefile(const struct bfs_expr *expr, struct bfs_eval *state);
73 bool eval_size(const struct bfs_expr *expr, struct bfs_eval *state);
74 bool eval_sparse(const struct bfs_expr *expr, struct bfs_eval *state);
75 bool eval_type(const struct bfs_expr *expr, struct bfs_eval *state);
76 bool eval_xtype(const struct bfs_expr *expr, struct bfs_eval *state);
78 bool eval_lname(const struct bfs_expr *expr, struct bfs_eval *state);
79 bool eval_name(const struct bfs_expr *expr, struct bfs_eval *state);
80 bool eval_path(const struct bfs_expr *expr, struct bfs_eval *state);
81 bool eval_regex(const struct bfs_expr *expr, struct bfs_eval *state);
83 bool eval_delete(const struct bfs_expr *expr, struct bfs_eval *state);
84 bool eval_exec(const struct bfs_expr *expr, struct bfs_eval *state);
85 bool eval_exit(const struct bfs_expr *expr, struct bfs_eval *state);
86 bool eval_fls(const struct bfs_expr *expr, struct bfs_eval *state);
87 bool eval_fprint(const struct bfs_expr *expr, struct bfs_eval *state);
88 bool eval_fprint0(const struct bfs_expr *expr, struct bfs_eval *state);
89 bool eval_fprintf(const struct bfs_expr *expr, struct bfs_eval *state);
90 bool eval_fprintx(const struct bfs_expr *expr, struct bfs_eval *state);
91 bool eval_prune(const struct bfs_expr *expr, struct bfs_eval *state);
92 bool eval_quit(const struct bfs_expr *expr, struct bfs_eval *state);
94 // Operator evaluation functions
95 bool eval_not(const struct bfs_expr *expr, struct bfs_eval *state);
96 bool eval_and(const struct bfs_expr *expr, struct bfs_eval *state);
97 bool eval_or(const struct bfs_expr *expr, struct bfs_eval *state);
98 bool eval_comma(const struct bfs_expr *expr, struct bfs_eval *state);