aboutsummaryrefslogtreecommitdiffstats
path: root/epan/print_stream.c
AgeCommit message (Collapse)AuthorFilesLines
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
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-01-08More information on the Windows Console and escape sequences.Guy Harris1-3/+28
Change-Id: I8a57053658ef17d28c28c458e8fe5350332a953b Reviewed-on: https://code.wireshark.org/review/25201 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-08Point to the MSDN blog post about 24-bit color support in cmd.exe.Guy Harris1-3/+7
Change-Id: Ic23f1d6ee35333ab4775970455f71315925f4cc6 Reviewed-on: https://code.wireshark.org/review/25200 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-08Update a comment about Windows Console color support.Gerald Combs1-3/+10
Change-Id: I39171a3c95ca48a39fbbc90ceadb9b1436f2402c Reviewed-on: https://code.wireshark.org/review/25196 Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-06TShark: Fix color handling on Windows.Gerald Combs1-20/+20
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>
2017-06-12print_stream.c: Fix compile error on Windows regressionRobert Sauter1-1/+1
Put closing #endif inside function body. Regression by https://code.wireshark.org/review/22086/ Change-Id: I6f49dd45598c77c0a10c62f18f85fd7b99aba975 Reviewed-on: https://code.wireshark.org/review/22088 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-11Add a big comment about the ISO 8613-6/T.416 SGR support.Guy Harris1-9/+31
Also, the signature of print_color_escape() must be the same on Windows and UN*X; put the function body, but not the opening part of the definition, inside #ifdefs. Change-Id: I060e01d3280bfc4596a852211f5ab3c58d1e8642 Reviewed-on: https://code.wireshark.org/review/22086 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-06-11print_stream: add a new print_line_color() methodDave Goodell1-10/+143
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-02-27print_stream: free memory on exit.Dario Lombardo1-1/+1
Change-Id: I6c4acaa9026cfdf1d4230c28c30bccfb6c025cef Reviewed-on: https://code.wireshark.org/review/19920 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-06-30Speed up print_line_text.Gerald Combs1-24/+18
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-05-14Use g_get_charset instead of g_get_codeset.Gerald Combs1-7/+5
From Guy via https://www.wireshark.org/lists/wireshark-dev/201605/msg00027.html Change-Id: I7884cecb6cd87f474ecc3f84253797fe57f62487 Reviewed-on: https://code.wireshark.org/review/15421 Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-09TShark: Convert TTY output.Gerald Combs1-1/+48
If we detect that we're writing to a TTY and that it doesn't support UTF-8, convert our output to the current code page on UNIX/Linux or to UTF-16LE on Windows. This helps to ensure that we don't fill users' screens with mojibake, along with scrubbing invalid output. Add a note about our output behavior to the TShark man page. Add a note about the glyphs we should and shouldn't be using to utf8_entities.h. Bug: 12393 Change-Id: I52b6dd240173b80ffb6d35b5950a46a565c97ce8 Reviewed-on: https://code.wireshark.org/review/15277 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-02Add "Editor modelines"; Adjust whitespace as needed.Bill Meier1-0/+13
Change-Id: Ic5a5acb0f36d3aa144edbfb1ae71097b18426db4 Reviewed-on: https://code.wireshark.org/review/6216 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-22Fix comments.Guy Harris1-2/+2
Change-Id: I3b7340939b8204102bfc7e2e7d83f4d978cf7bad Reviewed-on: https://code.wireshark.org/review/5437 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-22Split the low-level print stream code into a separate file.Guy Harris1-0/+367
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>