2021-01-12 21:04:43 -08:00
|
|
|
//
|
2021-01-15 19:27:25 -08:00
|
|
|
// Header file for print.c (printing/visualizing matches)
|
2021-01-12 21:04:43 -08:00
|
|
|
//
|
2021-01-15 19:27:25 -08:00
|
|
|
#ifndef PRINT__H
|
|
|
|
#define PRINT__H
|
2020-12-12 16:31:53 -08:00
|
|
|
|
2021-01-18 11:52:00 -08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2021-01-08 01:06:43 -08:00
|
|
|
#include "types.h"
|
|
|
|
|
2021-01-15 01:19:10 -08:00
|
|
|
typedef struct {
|
|
|
|
file_t *file;
|
|
|
|
const char *pos;
|
|
|
|
int context_lines;
|
2021-01-18 11:52:00 -08:00
|
|
|
bool needs_line_number:1;
|
|
|
|
bool use_color:1;
|
|
|
|
bool print_line_numbers:1;
|
2021-01-15 01:19:10 -08:00
|
|
|
} printer_t;
|
2020-12-12 16:31:53 -08:00
|
|
|
|
2021-01-15 01:19:10 -08:00
|
|
|
__attribute__((nonnull(1,2)))
|
|
|
|
void print_match(FILE *out, printer_t *pr, match_t *m);
|
2021-01-08 01:00:27 -08:00
|
|
|
__attribute__((nonnull))
|
2021-01-15 01:19:10 -08:00
|
|
|
int print_errors(printer_t *pr, match_t *m);
|
2020-12-14 22:13:47 -08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
|