path: root/stat_menu.h
diff options
authorHadriel Kaplan <hadrielk@yahoo.com>2014-02-07 14:23:41 -0500
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-02-08 11:29:32 +0000
commit991bd3d7e10966e429bebd71bd7433f61e320482 (patch)
tree8740b0c2a4299b6b9efe6b9e8863cc604636c80a /stat_menu.h
parent8d7b6001bb62c823b814b91ee858ff1ee48bad99 (diff)
Fix bug 9732: ' Lua: recent commit changed some MENU_ key names in init.lua'
A recent fix (made by me) for bug 9707, in Change-Id: If4ee1906aa60dd37366cf2ef9bc4168e0ea024b6, made the perl regex grab too much of the menu name. It changed MENU_STAT_CONVERSATION, MENU_STAT_RESPONSE, and MENU_ANALYZE_CONVERSATION's key names into their longer C-code names. Ugh. The fix for this is a bit brittle, but I think it's impractical to avoid it being brittle, due to needing to support legacy Lua scripts. I put comments in stat_menu.h to warn of the danger. Change-Id: I41408e9d4f5b5bd73e2871fccabff81c7cbd242d Reviewed-on: https://code.wireshark.org/review/140 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'stat_menu.h')
1 files changed, 13 insertions, 0 deletions
diff --git a/stat_menu.h b/stat_menu.h
index c69c94abca..269fb0f387 100644
--- a/stat_menu.h
+++ b/stat_menu.h
@@ -39,6 +39,19 @@ extern "C" {
* XXX - stats should be able to register additional menu groups, although
* the question then would be "in what order should they appear in the menu?"
+ *
+ * NOTE: the enum below is parsed by epan/wslua/make-init-lua.pl in order
+ * to generate usable values for Lua scripts to use, so they can add to
+ * the menus in the GUI. The perl script's regex is such that the following
+ * prefixes must only appear once in this list:
+ * In other words, because there is a REGISTER_STAT_GROUP_RESPONSE_TIME, you cannot
+ * because they use the same "REGISTER_STAT_GROUP_RESPONSE" prefix.
+ * Also, do NOT change the names in the enum - you can add, but not remove.
+ * If you do, legacy scripts will break. (which is why the perl script regex isn't better)
/** The menu group this stat should be registered in. */