Commit Graph

7 Commits

Author SHA1 Message Date
Guy Harris 8b0615de3b Only put generic values into the print_stream_t structure.
Put values used only by particular subclasses into the subclass data
structure.

Change-Id: Ibb995ebf18ba24449467e932084fbeef03ad1abf
Reviewed-on: https://code.wireshark.org/review/32653
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-04-01 01:41:56 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Gerald Combs a65391f901 TShark: Fix color handling on Windows.
Use SetConsoleTextAttribute to reset our colors on Windows. Update the
release notes and man page.

Change-Id: I2bc309787f9c2331324503092bd1c9ae6360eb55
Reviewed-on: https://code.wireshark.org/review/25170
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-06 14:30:45 +00:00
Dave Goodell affa6f18c8 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>
2017-06-11 13:36:06 +00:00
Gerald Combs cd1ddf6ef5 Speed up print_line_text.
isatty adds a small delay, at least on OS X. Call it only when we
allocate a stream. Do the same for our codeset check.

Change-Id: Id3a20059dbc9cf7d5db16d8d238d038b9de0ebf2
Reviewed-on: https://code.wireshark.org/review/16222
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2016-06-30 19:21:04 +00:00
Guy Harris 6e1214c4df Fix comments.
Change-Id: I3b7340939b8204102bfc7e2e7d83f4d978cf7bad
Reviewed-on: https://code.wireshark.org/review/5437
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-22 03:32:58 +00:00
Guy Harris 7d7fc47a2a Split the low-level print stream code into a separate file.
Put the low-level print stream code from epan/print.c into
epan/print_stream.c, leaving the higher-level stuff in print.c

Change-Id: Iae961f168ec655a29f434257b1af0937fca9f025
Reviewed-on: https://code.wireshark.org/review/5436
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-22 03:24:17 +00:00