print_stream: add a new print_line_color() method
authorDave Goodell <dave@goodell.io>
Tue, 25 Apr 2017 05:14:42 +0000 (22:14 -0700)
committerMichael Mann <mmann78@netscape.net>
Sun, 11 Jun 2017 13:36:06 +0000 (13:36 +0000)
commitaffa6f18c87eaf430cc0bf260c54fbfe32976a5f
treeabd05ecd22df083be93b00183e919ade9ceb5626
parent5617527ee3831a8012f076b67e2532eeb8b1da2d
print_stream: add a new print_line_color() method

This new interface allows printing a line with specified foreground and
background colors.  The implementation avoids printing escape sequences
if the output stream is not a TTY and note that escape sequences are
ignored on Windows.

This initial implementation relies on relatively modern 24-bit color
support which is present in many terminal emulators but may not always
display properly on older or simpler emulators. Windows coloring is
handled with SetConsoleTextAttribute, which offers a "1-bit" color
experience (but it's better than nothing)

This commit is a precursor to adding additional coloring to tshark.

Bug: 5158
Change-Id: Ib2b9d800095a065a4bb60abe0550862cda5539ec
Reviewed-on: https://code.wireshark.org/review/21324
Reviewed-by: Michael Mann <mmann78@netscape.net>
debian/libwireshark0.symbols
epan/print_stream.c
epan/print_stream.h