diff options
author | Jakub Zawadzki <darkjames@darkjames.pl> | 2014-05-14 01:56:23 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-05-17 21:33:26 +0000 |
commit | ea95c837fe62cb89ae7a0507e3ca437b822d658c (patch) | |
tree | 4474e48708ed60c27eb35d4ee3904381086daed7 /epan/column-utils.h | |
parent | 24082972a3650c0e743776b47549a17ab0ad20fe (diff) |
Introduce col_add_lstr(), use it instead of slower col_add_fstr.
We have callgrind benchmarks which shows that col_add_fstr() takes
5% of Ir count cause of formatting done in g_vsnprintf().
New col_add_lstr() can be used in few dissectors without much ugliness,
and it should be a little faster.
Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c
Reviewed-on: https://code.wireshark.org/review/1629
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/column-utils.h')
-rw-r--r-- | epan/column-utils.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/column-utils.h b/epan/column-utils.h index 25efa8a75a..3a4587fb90 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -228,6 +228,10 @@ WS_DLL_PUBLIC void col_set_str(column_info *cinfo, const gint col, const gchar * */ WS_DLL_PUBLIC void col_add_str(column_info *cinfo, const gint col, const gchar *str); +/* terminator argument for col_add_lstr() function */ +#define COL_ADD_LSTR_TERMINATOR (const char *) -1 +WS_DLL_PUBLIC void col_add_lstr(column_info *cinfo, const gint el, const gchar *str, ...); + /** Add (replace) the text of a column element, the text will be formatted and copied. * * Same function as col_add_str() but using a printf-like format string. |