diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-05-29 13:14:35 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-05-29 13:14:35 -0400 |
| commit | da067957c82ab74300bafa10a7753dc1e9cb53c7 (patch) | |
| tree | 7af54094538c07b960fc08d1ac1bdf26f9b9ce26 /bp.c | |
| parent | f2718636018468725234e677225c74b0810ff10c (diff) | |
Rename match_t -> bp_match_t
Diffstat (limited to 'bp.c')
| -rw-r--r-- | bp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -211,7 +211,7 @@ static int is_text_file(const char *filename) static int print_matches_as_json(file_t *f, bp_pat_t *pattern, bp_pat_t *defs) { int nmatches = 0; - for (match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { + for (bp_match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { if (++nmatches > 1) printf(",\n"); printf("{\"filename\":\"%s\",\"match\":", f->filename); @@ -227,7 +227,7 @@ static int print_matches_as_json(file_t *f, bp_pat_t *pattern, bp_pat_t *defs) static int explain_matches(file_t *f, bp_pat_t *pattern, bp_pat_t *defs) { int nmatches = 0; - for (match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { + for (bp_match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { if (++nmatches == 1) { if (options.print_filenames) fprint_filename(stdout, f->filename); @@ -370,7 +370,7 @@ static int print_matches(FILE *out, file_t *f, bp_pat_t *pattern, bp_pat_t *defs print_opts.replace_color = "\033[0;34;1m"; print_opts.normal_color = "\033[m"; } - for (match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { + for (bp_match_t *m = NULL; next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); ) { if (++matches == 1 && options.print_filenames) { if (printed_filenames++ > 0) printf("\n"); fprint_filename(out, f->filename); @@ -412,7 +412,7 @@ static int process_file(const char *filename, bp_pat_t *pattern, bp_pat_t *defs) if (options.mode == MODE_EXPLAIN) { matches += explain_matches(f, pattern, defs); } else if (options.mode == MODE_LISTFILES) { - match_t *m = NULL; + bp_match_t *m = NULL; if (next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase)) { printf("%s\n", f->filename); matches += 1; @@ -421,7 +421,7 @@ static int process_file(const char *filename, bp_pat_t *pattern, bp_pat_t *defs) } else if (options.mode == MODE_JSON) { matches += print_matches_as_json(f, pattern, defs); } else if (options.mode == MODE_INPLACE) { - match_t *m = NULL; + bp_match_t *m = NULL; bool found = next_match(&m, f->start, f->end, pattern, defs, options.skip, options.ignorecase); stop_matching(&m); if (!found) return 0; |
