summaryrefslogtreecommitdiffstats
path: root/bfs.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2016-03-12 16:07:34 -0500
committerTavian Barnes <tavianator@tavianator.com>2016-03-12 16:07:34 -0500
commitf1401f09c59363170f021c4a1676735be2e3cc44 (patch)
tree2b534caed6c1e1dbcca06814f20d603e641f7bdc /bfs.h
parent037361965a14e1899020bf16c9112936e39020e8 (diff)
downloadbfs-f1401f09c59363170f021c4a1676735be2e3cc44.tar.xz
Implement -size.
Diffstat (limited to 'bfs.h')
-rw-r--r--bfs.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/bfs.h b/bfs.h
index 1e38869..f0aaada 100644
--- a/bfs.h
+++ b/bfs.h
@@ -125,6 +125,24 @@ enum timeunit {
DAYS,
};
+/**
+ * Possible file size units.
+ */
+enum sizeunit {
+ /** 512-byte blocks. */
+ SIZE_BLOCKS,
+ /** Single bytes. */
+ SIZE_BYTES,
+ /** Two-byte words. */
+ SIZE_WORDS,
+ /** Kibibytes. */
+ SIZE_KB,
+ /** Mebibytes. */
+ SIZE_MB,
+ /** Gibibytes. */
+ SIZE_GB,
+};
+
struct expr {
/** The function that evaluates this expression. */
eval_fn *eval;
@@ -152,13 +170,16 @@ struct expr {
/** The optional time unit. */
enum timeunit timeunit;
+ /** The optional size unit. */
+ enum sizeunit sizeunit;
+
/** Optional device number for a target file. */
dev_t dev;
/** Optional inode number for a target file. */
ino_t ino;
/** Optional integer data for this expression. */
- int idata;
+ long long idata;
/** Optional string data for this expression. */
const char *sdata;
@@ -197,6 +218,7 @@ bool eval_hidden(const struct expr *expr, struct eval_state *state);
bool eval_inum(const struct expr *expr, struct eval_state *state);
bool eval_links(const struct expr *expr, struct eval_state *state);
bool eval_samefile(const struct expr *expr, struct eval_state *state);
+bool eval_size(const struct expr *expr, struct eval_state *state);
bool eval_type(const struct expr *expr, struct eval_state *state);
bool eval_xtype(const struct expr *expr, struct eval_state *state);