diff options
author | Michael Mann <mmann78@netscape.net> | 2013-02-25 20:43:06 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-02-25 20:43:06 +0000 |
commit | 41bd69d601bf8f43f8900896e9c5fe5bb5c3e509 (patch) | |
tree | 93e06ab4773e9b60da489805344d9e72bd419e3f /epan/column-utils.c | |
parent | 8692843ee300ac5ebebbf92e73ac0532b3256d4c (diff) |
LUA API improvements
1. Add col_set_fence() equivalent
2. Update __tostring function to actually return column text
From Hadriel Kaplan, bug 8295 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8295)
svn path=/trunk/; revision=47882
Diffstat (limited to 'epan/column-utils.c')
-rw-r--r-- | epan/column-utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c index 71365dccf7..96b94f8a7c 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -165,6 +165,26 @@ col_set_fence(column_info *cinfo, const gint el) } } +/* Gets the text of a column */ +const gchar * +col_get_text(column_info *cinfo, const gint el) +{ + int i; + const gchar* text = NULL; + + if (!(cinfo && (cinfo)->col_first[el] >= 0)) { + return NULL; + } + + for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) { + if (cinfo->fmt_matx[i][el]) { + text = (cinfo->col_data[i]); + } + } + return text; +} + + /* Use this to clear out a column, especially if you're going to be appending to it later; at least on some platforms, it's more efficient than using "col_add_str()" with a null string, and |