diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-09-23 20:51:04 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-09-23 20:51:04 -0700 |
| commit | 3a2492d584e3c7d4cada1386921d80ace33c1fd2 (patch) | |
| tree | c644006290392edf5da2d3e85c41feef40d81f22 /match.h | |
| parent | fddba4c54f3ce21e711cc2cd931ce5c4cad660b9 (diff) | |
WIP: working line breaks, formatting, etc. All seems functional, but a
bit messy
Diffstat (limited to 'match.h')
| -rw-r--r-- | match.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -33,6 +33,12 @@ typedef struct match_s { struct match_s *_children[3]; } match_t; +typedef struct { + const char *normal_color, *match_color, *replace_color; + void (*fprint_between)(FILE *out, const char *start, const char *end, const char *normal_color); + void (*on_nl)(FILE *out); +} print_options_t; + __attribute__((returns_nonnull)) match_t *new_match(def_t *defs, pat_t *pat, const char *start, const char *end, match_t *children[]); __attribute__((nonnull)) @@ -45,8 +51,9 @@ __attribute__((nonnull)) match_t *get_numbered_capture(match_t *m, int n); __attribute__((nonnull, pure)) match_t *get_named_capture(match_t *m, const char *name, size_t namelen); -__attribute__((nonnull)) -void fprint_match(FILE *out, const char *file_start, match_t *m); +__attribute__((nonnull(1,2,3))) +//void fprint_match(FILE *out, const char *file_start, match_t *m, const char *colors[3]); +void fprint_match(FILE *out, const char *file_start, match_t *m, print_options_t *opts); #endif // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 |
