aboutsummaryrefslogtreecommitdiff
path: root/print.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-08-02 12:25:52 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-08-02 12:25:52 -0700
commit70f7f8c4958b6458708187278f9a8fbca34ef542 (patch)
tree452d0389137257e805daaa97cba0562321358d48 /print.h
parentdb3c88d16b709a622fff390734f387693349341f (diff)
Added -B and -A options to match grep
Diffstat (limited to 'print.h')
-rw-r--r--print.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/print.h b/print.h
index 5ad645c..2bc2948 100644
--- a/print.h
+++ b/print.h
@@ -7,11 +7,16 @@
#include <stdbool.h>
#include "types.h"
+#include "files.h"
+
+#define USE_DEFAULT_CONTEXT -3
+#define ALL_CONTEXT -2
+#define NO_CONTEXT -1
typedef struct {
file_t *file;
const char *pos;
- int context_lines;
+ int context_before, context_after;
bool needs_line_number:1;
bool use_color:1;
bool print_line_numbers:1;
@@ -20,7 +25,7 @@ typedef struct {
__attribute__((nonnull(1,2)))
void print_match(FILE *out, printer_t *pr, match_t *m);
__attribute__((nonnull))
-int print_errors(printer_t *pr, match_t *m);
+int print_errors(file_t *f, match_t *m);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1