aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tfs.h
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2020-04-24 14:21:51 +0200
committerAnders Broman <a.broman58@gmail.com>2020-04-25 04:39:46 +0000
commit9750d00ff10bc344a2b1dcc69ee34d09a7ce76d0 (patch)
tree2b2f8d7b3df8bf93a722dd553c58489e7ba5a25c /epan/tfs.h
parentc9295f161c4a6275faa98a77a3a81380e01b34d8 (diff)
Introduce tfs_get_string helper
true_false_strings have no helper function to properly retrieve the string representing the true or false value, much like unit_strings, even though this is not uncommon in dissectors. This change introduces the helper function and modifies the dissectors, so that they use this helper i.s.o. their own expressions. Change-Id: I477ed2d90a9a529fc5dcfef7e3ea42ec180d27ae Reviewed-on: https://code.wireshark.org/review/36920 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tfs.h')
-rw-r--r--epan/tfs.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/epan/tfs.h b/epan/tfs.h
index dc81bd91a2..b3233f120b 100644
--- a/epan/tfs.h
+++ b/epan/tfs.h
@@ -12,6 +12,7 @@
#ifndef __TFS_H__
#define __TFS_H__
+#include <glib.h>
#include "ws_symbol_export.h"
#ifdef __cplusplus
@@ -24,10 +25,12 @@ extern "C" {
/** Struct for boolean enumerations */
typedef struct true_false_string {
- const char *true_string; /**< The string presented when true */
- const char *false_string; /**< The string presented when false */
+ const char *true_string; /**< The string presented when true */
+ const char *false_string; /**< The string presented when false */
} true_false_string;
+WS_DLL_PUBLIC const char *tfs_get_string(gboolean, const true_false_string *);
+
/*
* A default set of true/false strings that dissectors can use for
* FT_BOOLEAN header fields.
@@ -119,3 +122,16 @@ WS_DLL_PUBLIC const true_false_string tfs_selected_not_selected;
#endif /* __cplusplus */
#endif /* __TFS_H__ */
+
+/*
+ * Editor modelines - https://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: nil
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
+ * :indentSize=4:tabSize=8:noTabs=true:
+ */