summaryrefslogtreecommitdiff
path: root/wsutil/str_util.h
AgeCommit message (Collapse)AuthorFilesLines
2015-11-04Don't include "file.h" if you don't need it.Guy Harris1-0/+3
It ends up dragging in libwireshark headers, which programs not linking with libwireshark shouldn't do. In particular, including <epan/address.h> causes some functions that refer to libwireshark functions to be defined if the compiler doesn't handle "static inline" the way GCC does, and you end up requiring libwireshark even though you shouldn't require it. Move plurality() to wsutil/str_util.h, so that non-libwireshark code can get it without include epan/packet.h. Fix includes as necessary. Change-Id: Ie4819719da4c2b349f61445112aa419e99b977d3 Reviewed-on: https://code.wireshark.org/review/11545 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-04Don't print non-printable characters in AX.25 addresses.Jeff Morriss1-0/+2
Add a new routine to wsutil to make this easy: printable_char_or_period(). Bug: 10439 Change-Id: I0eb2bb6bc0676a1035c3d845b5e20276fa04de60 Reviewed-on: https://code.wireshark.org/review/3981 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-24Clean up capinfos output.Guy Harris1-5/+7
Make sure there's always a space between a number and "[TGMK]bytes", "[TGMK]bits", and "[TGMK]packets". Change-Id: I710385303e451e9aea6fc9bbea562f59ca0d22c9 Reviewed-on: https://code.wireshark.org/review/3810 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-23Add some #includes to satisfy check-abiEvan Huus1-0/+1
Change-Id: I705268d327b7dd96ed86bfdc8d7fe7d968e3e541 Reviewed-on: https://code.wireshark.org/review/3181 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-01-08Move UAT xton() to wsutil libraryJakub Zawadzki1-0/+3
Use ws_xton() in few more places. svn path=/trunk/; revision=54642
2013-10-12Another Solaris Studio C++ fix.Gerald Combs1-5/+3
svn path=/trunk/; revision=52561
2013-08-10Fix (-W)documentation error found by ClangAlexis La Goutte1-4/+4
./str_util.h:72:11: error: parameter 'str' not found in the function declaration [-Werror,-Wdocumentation] * @param str The string to be checked ^~~ ./str_util.h:72:11: note: did you mean 'string'? * @param str The string to be checked ^~~ string ./str_util.h:80:11: error: parameter 'str' not found in the function declaration [-Werror,-Wdocumentation] * @param str The string to be checked ^~~ ./str_util.h:80:11: note: did you mean 'string'? * @param str The string to be checked ^~~ string svn path=/trunk/; revision=51252
2013-02-28Export libwsutil symbols using WS_DLL_PUBLIC defineBalint Reczey1-0/+7
This change replaces *.def and *.sym file usage following the guideline at http://gcc.gnu.org/wiki/Visibility svn path=/trunk/; revision=47938
2013-02-26Print human-readable statistics by default. Raw values can be printedGerald Combs1-1/+1
using "-M". Based on a suggestion by Hansang Bae. svn path=/trunk/; revision=47900
2012-12-26Squash some sign-conversion warnings that g++ picks up but gcc doesEvan Huus1-1/+1
not. QtShark now builds warning-free (for me at least). svn path=/trunk/; revision=46786
2012-12-26Fix a bunch of warnings.Guy Harris1-1/+1
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-10-19The file set and export object trees are lists. Make them act likeGerald Combs1-3/+1
it. Show human-readable sizes in the file set dialog. Move the format_size_flags_e operator to qt_ui_utils.cpp for lack of a better place. svn path=/trunk/; revision=45661
2012-10-18Move ui-independent object export routines to the common ui directory.Gerald Combs1-0/+16
Implement DICOM, HTTP, and SMB object exports. Rename the GTK+ export files. C++-ize epan/tap.h. Fix an apparent memory leak in eo_save_all_clicked_cb. The Qt dialog has an indeterminate progress bar. I tried adding something similar to the GTK+ dialog but event processing led down a rabbit hole. svn path=/trunk/; revision=45647
2012-10-18str_util.c:format_size() uses 0xff00 for the mask, so left-shift ↵Chris Maynard1-2/+2
format_size_prefix_[si|iec] by 8, not 16. Fixes Coverity CID 733852: Operands don't affect result. svn path=/trunk/; revision=45637
2012-10-10Add a format_size function similar to g_format_size that renders a sizeGerald Combs1-4/+26
value in a human-readable format. Use it in the welcome screen, status bar, and Win32 interface details. Note that in the welcome screen and status bar we've switched from customary binary prefixes to strict SI. svn path=/trunk/; revision=45453
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-02-17Move exec_isdigit_string() and exec_isprint_string() functions out ofStephen Fisher1-0/+14
the exec dissector and into wsutil/str_util.c. Rename them to isdigit_string() and isprint_string(). Also rename the variables they use for consistency: string -> str and position -> pos. svn path=/trunk/; revision=41053
2009-01-17Revise ascii...inplace to return a ptr to the string Bill Meier1-2/+4
svn path=/trunk/; revision=27253
2008-09-03g_ascii_strdown() and g_ascii_strup(), unlike g_strdown() and g_strup(),Guy Harris1-0/+60
do *not* modify the string handed to them - they g_mallocate a new string and return it. Create routines that *do* ASCII-only case mapping in place, and use them instead. Clean up indentation. svn path=/trunk/; revision=26131