diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-01-14 16:38:08 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-02-05 19:02:25 -0500 |
commit | a6f94c132c425bbab543e98fcd19f4ff7519d1b7 (patch) | |
tree | 215135837c0335946b70593877ec5411ba8e6c17 /bfs.h | |
parent | 9f1863d45fe596e258596a4b4cc9a4064bcb11d3 (diff) | |
download | bfs-a6f94c132c425bbab543e98fcd19f4ff7519d1b7.tar.xz |
Implement -printf/-fprintf
Based on a patch by Fangrui Song <i@maskray.me>.
Closes #16.
Diffstat (limited to 'bfs.h')
-rw-r--r-- | bfs.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -13,6 +13,7 @@ #define BFS_H #include "color.h" +#include "printf.h" #include <regex.h> #include <stdbool.h> #include <stddef.h> @@ -248,6 +249,9 @@ struct expr { /** Optional compiled regex. */ regex_t *regex; + /** Optional printf command. */ + struct bfs_printf *printf; + /** Optional integer data for this expression. */ long long idata; @@ -310,9 +314,10 @@ bool eval_regex(const struct expr *expr, struct eval_state *state); bool eval_delete(const struct expr *expr, struct eval_state *state); bool eval_exec(const struct expr *expr, struct eval_state *state); bool eval_nohidden(const struct expr *expr, struct eval_state *state); -bool eval_print(const struct expr *expr, struct eval_state *state); bool eval_fprint(const struct expr *expr, struct eval_state *state); -bool eval_print0(const struct expr *expr, struct eval_state *state); +bool eval_fprint0(const struct expr *expr, struct eval_state *state); +bool eval_fprintf(const struct expr *expr, struct eval_state *state); +bool eval_print(const struct expr *expr, struct eval_state *state); bool eval_prune(const struct expr *expr, struct eval_state *state); bool eval_quit(const struct expr *expr, struct eval_state *state); |