Mercurial > ~dholland > hg > tradcpp > index.cgi
diff place.c @ 185:16b4451e34b8
Add the ability to output line numbers, sort of.
It is enabled with the intentionally undocumented -p option (similar
to -P but reversed sense) and it might be vaguely useful but only
prints the line number when the file changes and may not get the line
numbers right.
author | David A. Holland |
---|---|
date | Fri, 12 Jun 2015 03:59:36 -0400 |
parents | a2f047301c15 |
children | 1d2bad7151f9 |
line wrap: on
line diff
--- a/place.c Fri Jun 12 03:35:01 2015 -0400 +++ b/place.c Fri Jun 12 03:59:36 2015 -0400 @@ -102,22 +102,6 @@ } static -bool -place_eq(const struct place *a, const struct place *b) -{ - if (a->type != b->type) { - return false; - } - if (a->file != b->file) { - return false; - } - if (a->line != b->line || a->column != b->column) { - return false; - } - return true; -} - -static struct placefile * placefile_find(const struct place *incfrom, const char *name) { @@ -219,6 +203,30 @@ return NULL; } +bool +place_samefile(const struct place *a, const struct place *b) +{ + if (a->type != b->type) { + return false; + } + if (a->file != b->file) { + return false; + } + return true; +} + +bool +place_eq(const struct place *a, const struct place *b) +{ + if (!place_samefile(a, b)) { + return false; + } + if (a->line != b->line || a->column != b->column) { + return false; + } + return true; +} + static void place_printfrom(const struct place *p)