aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2009-05-08 16:40:38 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2009-05-08 16:40:38 +0000
commit3dc9b64560c53044e213ca8486c71c64265dfe37 (patch)
treeff445a8588defa1cbb31e02f932812aeecb39f8c
parentba2e20b5d80354f5125c85c6156b0902938cd140 (diff)
Adjusted arguments used in Lua Pref.statictext()
Update Lua documentation: - Fixed Pref.enum, Pref.range and Pref.statictext - Fixed the equivalent comment for pinfo.cols - Do not have a comment star (*) in the documentation - Be consistent and start all sentences with a capital letter svn path=/trunk/; revision=28304
-rw-r--r--epan/wslua/wslua_dumper.c10
-rw-r--r--epan/wslua/wslua_field.c26
-rw-r--r--epan/wslua/wslua_gui.c104
-rw-r--r--epan/wslua/wslua_listener.c4
-rw-r--r--epan/wslua/wslua_pinfo.c14
-rw-r--r--epan/wslua/wslua_proto.c308
-rw-r--r--epan/wslua/wslua_tree.c12
-rw-r--r--epan/wslua/wslua_tvb.c142
-rw-r--r--epan/wslua/wslua_util.c38
9 files changed, 318 insertions, 340 deletions
diff --git a/epan/wslua/wslua_dumper.c b/epan/wslua/wslua_dumper.c
index 2fc54c3384..909244f738 100644
--- a/epan/wslua/wslua_dumper.c
+++ b/epan/wslua/wslua_dumper.c
@@ -77,7 +77,7 @@ WSLUA_CONSTRUCTOR PseudoHeader_eth(lua_State* L) {
Creates an ethernet pseudoheader
*/
-#define WSLUA_OPTARG_PseudoHeader_eth_FCSLEN 1 /* the fcs length */
+#define WSLUA_OPTARG_PseudoHeader_eth_FCSLEN 1 /* The fcs length */
PseudoHeader ph = g_malloc(sizeof(struct lua_pseudo_header));
ph->type = PHDR_ETH;
@@ -206,12 +206,12 @@ WSLUA_CONSTRUCTOR Dumper_new(lua_State* L) {
filename = cross_plat_fname(fname);
if (!wtap_dump_can_write_encap(filetype, encap))
- WSLUA_ERROR(Dumper_new,"not every filetype handles every encap");
+ WSLUA_ERROR(Dumper_new,"Not every filetype handles every encap");
d = wtap_dump_open(filename, filetype, encap,0 , FALSE, &err);
if (! d ) {
- /* WSLUA_ERROR("error while opening file for writing"); */
+ /* WSLUA_ERROR("Error while opening file for writing"); */
luaL_error(L,"error while opening `%s': %s",
filename,
wtap_strerror(err));
@@ -319,7 +319,7 @@ WSLUA_METHOD Dumper_new_for_current(lua_State* L) {
filename = cross_plat_fname(fname);
if (! lua_pinfo )
- WSLUA_ERROR(Dumper_new_for_current,"cannot be used outside a tap or a dissector");
+ WSLUA_ERROR(Dumper_new_for_current,"Cannot be used outside a tap or a dissector");
encap = lua_pinfo->fd->lnk_t;
@@ -356,7 +356,7 @@ WSLUA_METHOD Dumper_dump_current(lua_State* L) {
if (!d) return 0;
- if (! lua_pinfo ) WSLUA_ERROR(Dumper_new_for_current,"cannot be used outside a tap or a dissector");
+ if (! lua_pinfo ) WSLUA_ERROR(Dumper_new_for_current,"Cannot be used outside a tap or a dissector");
data_src = ((data_source*)(lua_pinfo->data_src->data))->tvb;
diff --git a/epan/wslua/wslua_field.c b/epan/wslua/wslua_field.c
index 91f751feec..c95a07b698 100644
--- a/epan/wslua/wslua_field.c
+++ b/epan/wslua/wslua_field.c
@@ -150,7 +150,7 @@ WSLUA_METAMETHOD FieldInfo__call(lua_State* L) {
}
WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
- /* the string representation of the field */
+ /* The string representation of the field */
FieldInfo fi = checkFieldInfo(L,1);
if (fi) {
if (fi->value.ftype->val_to_string_repr) {
@@ -166,7 +166,7 @@ WSLUA_METAMETHOD FieldInfo__tostring(lua_State* L) {
}
int FieldInfo_get_range(lua_State* L) {
- /* the TvbRange covering this field */
+ /* The TvbRange covering this field */
FieldInfo fi = checkFieldInfo(L,1);
TvbRange r = ep_alloc(sizeof(struct _wslua_tvbrange));
r->tvb = ep_alloc(sizeof(struct _wslua_tvb));
@@ -187,7 +187,7 @@ int FieldInfo_get_generated(lua_State* L) {
}
int FieldInfo_get_name(lua_State* L) {
- /* the filter name of this field. */
+ /* The filter name of this field. */
FieldInfo fi = checkFieldInfo(L,1);
lua_pushstring(L,fi->hfinfo->abbrev);
return 1;
@@ -231,12 +231,12 @@ static int FieldInfo__index(lua_State* L) {
}
WSLUA_METAMETHOD FieldInfo__eq(lua_State* L) {
- /* checks whether lhs is within rhs */
+ /* Checks whether lhs is within rhs */
FieldInfo l = checkFieldInfo(L,1);
FieldInfo r = checkFieldInfo(L,2);
if (l->ds_tvb != r->ds_tvb)
- WSLUA_ERROR(FieldInfo__eq,"data source must be the same for both fields");
+ WSLUA_ERROR(FieldInfo__eq,"Data source must be the same for both fields");
if (l->start <= r->start && r->start + r->length <= l->start + r->length) {
lua_pushboolean(L,1);
@@ -247,7 +247,7 @@ WSLUA_METAMETHOD FieldInfo__eq(lua_State* L) {
}
WSLUA_METAMETHOD FieldInfo__le(lua_State* L) {
- /* checks whether the end byte of lhs is before the end of rhs */
+ /* Checks whether the end byte of lhs is before the end of rhs */
FieldInfo l = checkFieldInfo(L,1);
FieldInfo r = checkFieldInfo(L,2);
@@ -263,12 +263,12 @@ WSLUA_METAMETHOD FieldInfo__le(lua_State* L) {
}
WSLUA_METAMETHOD FieldInfo__lt(lua_State* L) {
- /* checks whether the end byte of rhs is before the beginning of rhs */
+ /* Checks whether the end byte of rhs is before the beginning of rhs */
FieldInfo l = checkFieldInfo(L,1);
FieldInfo r = checkFieldInfo(L,2);
if (l->ds_tvb != r->ds_tvb)
- WSLUA_ERROR(FieldInfo__eq,"data source must be the same for both fields");
+ WSLUA_ERROR(FieldInfo__eq,"Data source must be the same for both fields");
if ( r->start + r->length < l->start ) {
lua_pushboolean(L,1);
@@ -298,7 +298,7 @@ int FieldInfo_register(lua_State* L) {
WSLUA_FUNCTION wslua_all_field_infos(lua_State* L) {
- /* obtain all fields from the current tree */
+ /* Obtain all fields from the current tree */
GPtrArray* found;
int items_found = 0;
guint i;
@@ -395,7 +395,7 @@ WSLUA_CONSTRUCTOR Field_new(lua_State *L) {
WSLUA_ARG_ERROR(Field_new,FIELDNAME,"a field with this name must exist");
if (!wanted_fields)
- WSLUA_ERROR(Field_get,"a Field extractor must be defined before Taps or Dissectors get called");
+ WSLUA_ERROR(Field_get,"A Field extractor must be defined before Taps or Dissectors get called");
f = g_malloc(sizeof(void*));
*f = (header_field_info*)g_strdup(name); /* cheating */
@@ -407,7 +407,7 @@ WSLUA_CONSTRUCTOR Field_new(lua_State *L) {
}
WSLUA_METAMETHOD Field__call (lua_State* L) {
- /* obtain all values (see FieldInfo) for this field. */
+ /* Obtain all values (see FieldInfo) for this field. */
Field f = checkField(L,1);
header_field_info* in = *f;
int items_found = 0;
@@ -418,7 +418,7 @@ WSLUA_METAMETHOD Field__call (lua_State* L) {
}
if (! lua_pinfo ) {
- WSLUA_ERROR(Field__call,"fields cannot be used outside dissectors or taps");
+ WSLUA_ERROR(Field__call,"Fields cannot be used outside dissectors or taps");
return 0;
}
@@ -437,7 +437,7 @@ WSLUA_METAMETHOD Field__call (lua_State* L) {
}
WSLUA_METAMETHOD Field_tostring(lua_State* L) {
- /* obtain a srting with the field name */
+ /* Obtain a srting with the field name */
Field f = checkField(L,1);
if ( !(f && *f) ) {
diff --git a/epan/wslua/wslua_gui.c b/epan/wslua/wslua_gui.c
index c4e991e5b1..416d806864 100644
--- a/epan/wslua/wslua_gui.c
+++ b/epan/wslua/wslua_gui.c
@@ -74,7 +74,7 @@ void lua_menu_callback(gpointer data) {
WSLUA_FUNCTION wslua_register_menu(lua_State* L) { /* Register a menu item in one of the main menus. */
#define WSLUA_ARG_register_menu_NAME 1 /* The name of the menu item. The submenus are to be separated by '/'s. (string) */
#define WSLUA_ARG_register_menu_ACTION 2 /* The function to be called when the menu item is invoked. (function taking no arguments and returning nothing) */
-#define WSLUA_OPTARG_register_menu_GROUP 3 /* The menu group into which the menu item is to be inserted. If omitted, defaults to MENU_STAT_GENERIC. One of MENU_STAT (Statistics), MENU_STAT_GENERIC (Statistics, first section), MENU_STAT_CONVERSATION (Statistics/Conversation List), MENU_STAT_ENDPOINT (Statistics/Endpoint List), MENU_STAT_RESPONSE (Statistics/Service Response Time), MENU_STAT_TELEPHONY (Statistics, third section), MENU_ANALYZE (Analyze), MENU_ANALYZE_CONVERSATION (Analyze/Conversation Filter), MENU_TOOLS (Tools). (number) */
+#define WSLUA_OPTARG_register_menu_GROUP 3 /* The menu group into which the menu item is to be inserted. If omitted, defaults to MENU_STAT_GENERIC. One of MENU_STAT (Statistics), MENU_STAT_GENERIC (Statistics, first section), MENU_STAT_CONVERSATION (Statistics/Conversation List), MENU_STAT_ENDPOINT (Statistics/Endpoint List), MENU_STAT_RESPONSE (Statistics/Service Response Time), MENU_STAT_TELEPHONY (Telephony), MENU_ANALYZE (Analyze), MENU_ANALYZE_CONVERSATION (Analyze/Conversation Filter), MENU_TOOLS (Tools). (number) */
const gchar* name = luaL_checkstring(L,WSLUA_ARG_register_menu_NAME);
struct _lua_menu_data* md;
@@ -82,13 +82,13 @@ WSLUA_FUNCTION wslua_register_menu(lua_State* L) { /* Register a menu item in o
register_stat_group_t group = (int)luaL_optnumber(L,WSLUA_OPTARG_register_menu_GROUP,REGISTER_STAT_GROUP_GENERIC);
if ( group > REGISTER_TOOLS_GROUP_UNSORTED)
- WSLUA_OPTARG_ERROR(register_menu,GROUP,"must be a defined MENU_* (see init.lua)");
+ WSLUA_OPTARG_ERROR(register_menu,GROUP,"Must be a defined MENU_* (see init.lua)");
if(!name)
- WSLUA_ARG_ERROR(register_menu,NAME,"must be a string");
+ WSLUA_ARG_ERROR(register_menu,NAME,"Must be a string");
if (!lua_isfunction(L,WSLUA_ARG_register_menu_ACTION))
- WSLUA_ARG_ERROR(register_menu,ACTION,"must be a function");
+ WSLUA_ARG_ERROR(register_menu,ACTION,"Must be a function");
md = g_malloc(sizeof(struct _lua_menu_data));
md->L = L;
@@ -215,17 +215,17 @@ WSLUA_FUNCTION wslua_new_dialog(lua_State* L) { /* Pops up a new dialog */
}
if (! (title = luaL_checkstring(L,WSLUA_ARG_new_dialog_TITLE)) ) {
- WSLUA_ARG_ERROR(new_dialog,TITLE,"must be a string");
+ WSLUA_ARG_ERROR(new_dialog,TITLE,"Must be a string");
return 0;
}
if (! lua_isfunction(L,WSLUA_ARG_new_dialog_ACTION)) {
- WSLUA_ARG_ERROR(new_dialog,ACTION,"must be a function");
+ WSLUA_ARG_ERROR(new_dialog,ACTION,"Must be a function");
return 0;
}
if (top < 3) {
- WSLUA_ERROR(new_dialog,"at least one field required");
+ WSLUA_ERROR(new_dialog,"At least one field required");
return 0;
}
@@ -248,7 +248,7 @@ WSLUA_FUNCTION wslua_new_dialog(lua_State* L) { /* Pops up a new dialog */
/* XXX leaks labels on error */
if (! label)
- WSLUA_ERROR(new_dialog,"all fields must be strings");
+ WSLUA_ERROR(new_dialog,"All fields must be strings");
g_ptr_array_add(labels,label);
}
@@ -294,13 +294,13 @@ WSLUA_METHOD ProgDlg_update(lua_State* L) { /* Appends text */
pd->task = g_strdup(task);
if (!pd) {
- WSLUA_ERROR(ProgDlg_update,"cannot be called for something not a ProgDlg");
+ WSLUA_ERROR(ProgDlg_update,"Cannot be called for something not a ProgDlg");
}
if (pr >= 0.0 || pr <= 1.0) {
ops->update_progress(pd->pw, (float) pr, task);
} else {
- WSLUA_ERROR(ProgDlg_update,"progress value out of range (must be between 0.0 and 1.0)");
+ WSLUA_ERROR(ProgDlg_update,"Progress value out of range (must be between 0.0 and 1.0)");
}
return 0;
@@ -310,7 +310,7 @@ WSLUA_METHOD ProgDlg_stopped(lua_State* L) { /* Checks wheher the user has press
ProgDlg pd = checkProgDlg(L,1);
if (!pd) {
- WSLUA_ERROR(ProgDlg_stopped,"cannot be called for something not a ProgDlg");
+ WSLUA_ERROR(ProgDlg_stopped,"Cannot be called for something not a ProgDlg");
}
lua_pushboolean(L,pd->stopped);
@@ -324,7 +324,7 @@ WSLUA_METHOD ProgDlg_close(lua_State* L) { /* Appends text */
ProgDlg pd = checkProgDlg(L,1);
if (!pd) {
- WSLUA_ERROR(ProgDlg_update,"cannot be called for something not a ProgDlg");
+ WSLUA_ERROR(ProgDlg_update,"Cannot be called for something not a ProgDlg");
}
if (pd->pw) {
@@ -425,12 +425,12 @@ WSLUA_METHOD TextWindow_set_atclose(lua_State* L) { /* Set the function that wil
struct _close_cb_data* cbd;
if (!tw)
- WSLUA_ERROR(TextWindow_at_close,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_at_close,"Cannot be called for something not a TextWindow");
lua_settop(L,2);
if (! lua_isfunction(L,2))
- WSLUA_ARG_ERROR(TextWindow_at_close,ACTION,"must be a function");
+ WSLUA_ARG_ERROR(TextWindow_at_close,ACTION,"Must be a function");
cbd = g_malloc(sizeof(struct _close_cb_data));
@@ -450,13 +450,13 @@ WSLUA_METHOD TextWindow_set(lua_State* L) { /* Sets the text. */
const gchar* text = luaL_checkstring(L,WSLUA_ARG_TextWindow_set_TEXT);
if (!tw)
- WSLUA_ERROR(TextWindow_set,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_set,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
if (!text)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"must be a string");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Must be a string");
ops->set_text(tw->ws_tw,text);
@@ -469,13 +469,13 @@ WSLUA_METHOD TextWindow_append(lua_State* L) { /* Appends text */
const gchar* text = luaL_checkstring(L,WSLUA_ARG_TextWindow_append_TEXT);
if (!tw)
- WSLUA_ERROR(TextWindow_append,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_append,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
if (!text)
- WSLUA_ARG_ERROR(TextWindow_append,TEXT,"must be a string");
+ WSLUA_ARG_ERROR(TextWindow_append,TEXT,"Must be a string");
ops->append_text(tw->ws_tw,text);
@@ -488,27 +488,27 @@ WSLUA_METHOD TextWindow_prepend(lua_State* L) { /* Prepends text */
const gchar* text = luaL_checkstring(L,WSLUA_ARG_TextWindow_prepend_TEXT);
if (!tw)
- WSLUA_ERROR(TextWindow_prepend,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_prepend,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
if (!text)
- WSLUA_ARG_ERROR(TextWindow_prepend,TEXT,"must be a string");
+ WSLUA_ARG_ERROR(TextWindow_prepend,TEXT,"Must be a string");
ops->prepend_text(tw->ws_tw,text);
WSLUA_RETURN(1); /* The TextWindow object. */
}
-WSLUA_METHOD TextWindow_clear(lua_State* L) { /* Errases all text in the window. */
+WSLUA_METHOD TextWindow_clear(lua_State* L) { /* Erases all text in the window. */
TextWindow tw = checkTextWindow(L,1);
if (!tw)
- WSLUA_ERROR(TextWindow_clear,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_clear,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
ops->clear_text(tw->ws_tw);
@@ -520,10 +520,10 @@ WSLUA_METHOD TextWindow_get_text(lua_State* L) { /* Get the text of the window *
const gchar* text;
if (!tw)
- WSLUA_ERROR(TextWindow_get_text,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_get_text,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
text = ops->get_text(tw->ws_tw);
@@ -555,10 +555,10 @@ WSLUA_METHOD TextWindow_set_editable(lua_State* L) { /* Make this window editabl
gboolean editable = wslua_optbool(L,WSLUA_OPTARG_TextWindow_set_editable_EDITABLE,TRUE);
if (!tw)
- WSLUA_ERROR(TextWindow_set_editable,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_set_editable,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
if (ops->set_editable)
ops->set_editable(tw->ws_tw,editable);
@@ -609,10 +609,10 @@ WSLUA_METHOD TextWindow_add_button(lua_State* L) {
wslua_bt_cb_t* cbd;
if (!tw)
- WSLUA_ERROR(TextWindow_add_button,"cannot be called for something not a TextWindow");
+ WSLUA_ERROR(TextWindow_add_button,"Cannot be called for something not a TextWindow");
if (tw->expired)
- WSLUA_ARG_ERROR(TextWindow_set,TEXT,"expired TextWindow");
+ WSLUA_ARG_ERROR(TextWindow_set,TEXT,"Expired TextWindow");
if (! lua_isfunction(L,WSLUA_ARG_TextWindow_add_button_FUNCTION) )
WSLUA_ARG_ERROR(TextWindow_add_button,FUNCTION,"must be a function");
@@ -676,23 +676,23 @@ WSLUA_FUNCTION wslua_retap_packets(lua_State* L) {
if ( ops->retap_packets ) {
ops->retap_packets();
} else {
- WSLUA_ERROR(wslua_retap_packets, "does not work on TShark");
+ WSLUA_ERROR(wslua_retap_packets, "Does not work on TShark");
}
return 0;
}
-WSLUA_FUNCTION wslua_copy_to_clipboard(lua_State* L) { /* copy a string into the clipboard */
+WSLUA_FUNCTION wslua_copy_to_clipboard(lua_State* L) { /* Copy a string into the clipboard */
#define WSLUA_ARG_copy_to_clipboard_TEXT 1 /* The string to be copied into the clipboard. */
const char* copied_str = luaL_checkstring(L,WSLUA_ARG_copy_to_clipboard_TEXT);
GString* gstr;
if (!ops->copy_to_clipboard) {
- WSLUA_ERROR(wslua_copy_to_clipboard, "does not work on TShark");
+ WSLUA_ERROR(wslua_copy_to_clipboard, "Does not work on TShark");
}
if (!copied_str) {
- WSLUA_ARG_ERROR(copy_to_clipboard,TEXT,"must be a string");
+ WSLUA_ARG_ERROR(copy_to_clipboard,TEXT,"Must be a string");
}
gstr = g_string_new(copied_str);
@@ -704,7 +704,7 @@ WSLUA_FUNCTION wslua_copy_to_clipboard(lua_State* L) { /* copy a string into the
return 0;
}
-WSLUA_FUNCTION wslua_open_capture_file(lua_State* L) { /* open and display a capture file */
+WSLUA_FUNCTION wslua_open_capture_file(lua_State* L) { /* Open and display a capture file */
#define WSLUA_ARG_open_capture_file_FILENAME 1 /* The name of the file to be opened. */
#define WSLUA_ARG_open_capture_file_FILTER 2 /* A filter to be applied as the file gets opened. */
@@ -713,11 +713,11 @@ WSLUA_FUNCTION wslua_open_capture_file(lua_State* L) { /* open and display a cap
const char* error = NULL;
if (!ops->open_file) {
- WSLUA_ERROR(wslua_open_capture_file, "does not work on TShark");
+ WSLUA_ERROR(wslua_open_capture_file, "Does not work on TShark");
}
if (!fname) {
- WSLUA_ARG_ERROR(open_capture_file,FILENAME,"must be a string");
+ WSLUA_ARG_ERROR(open_capture_file,FILENAME,"Must be a string");
}
if (! ops->open_file(fname,filter,&error) ) {
@@ -735,16 +735,16 @@ WSLUA_FUNCTION wslua_open_capture_file(lua_State* L) { /* open and display a cap
}
}
-WSLUA_FUNCTION wslua_set_filter(lua_State* L) { /* set the main filter text */
+WSLUA_FUNCTION wslua_set_filter(lua_State* L) { /* Set the main filter text */
#define WSLUA_ARG_set_filter_TEXT 1 /* The filter's text. */
const char* filter_str = luaL_checkstring(L,WSLUA_ARG_set_filter_TEXT);
if (!ops->set_filter) {
- WSLUA_ERROR(wslua_set_filter, "does not work on TShark");
+ WSLUA_ERROR(wslua_set_filter, "Does not work on TShark");
}
if (!filter_str) {
- WSLUA_ARG_ERROR(set_filter,TEXT,"must be a string");
+ WSLUA_ARG_ERROR(set_filter,TEXT,"Must be a string");
}
ops->set_filter(filter_str);
@@ -752,9 +752,9 @@ WSLUA_FUNCTION wslua_set_filter(lua_State* L) { /* set the main filter text */
return 0;
}
-WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* apply the filter in the main filter box */
+WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* Apply the filter in the main filter box */
if (!ops->apply_filter) {
- WSLUA_ERROR(wslua_apply_filter, "does not work on TShark");
+ WSLUA_ERROR(wslua_apply_filter, "Does not work on TShark");
}
ops->apply_filter();
@@ -763,10 +763,10 @@ WSLUA_FUNCTION wslua_apply_filter(lua_State* L) { /* apply the filter in the mai
}
-WSLUA_FUNCTION wslua_reload(lua_State* L) { /* reload the current capture file */
+WSLUA_FUNCTION wslua_reload(lua_State* L) { /* Reload the current capture file */
if (!ops->reload) {
- WSLUA_ERROR(wslua_reload, "does not work on TShark");
+ WSLUA_ERROR(wslua_reload, "Does not work on TShark");
}
ops->reload();
@@ -775,16 +775,16 @@ WSLUA_FUNCTION wslua_reload(lua_State* L) { /* reload the current capture file *
}
-WSLUA_FUNCTION wslua_browser_open_url(lua_State* L) { /* open an url in a browser */
+WSLUA_FUNCTION wslua_browser_open_url(lua_State* L) { /* Open an url in a browser */
#define WSLUA_ARG_browser_open_url_URL 1 /* The url. */
const char* url = luaL_checkstring(L,WSLUA_ARG_browser_open_url_URL);
if (!ops->browser_open_url) {
- WSLUA_ERROR(browser_open_url, "does not work on TShark");
+ WSLUA_ERROR(browser_open_url, "Does not work on TShark");
}
if (!url) {
- WSLUA_ARG_ERROR(browser_open_url,URL,"must be a string");
+ WSLUA_ARG_ERROR(browser_open_url,URL,"Must be a string");
}
ops->browser_open_url(url);
@@ -792,16 +792,16 @@ WSLUA_FUNCTION wslua_browser_open_url(lua_State* L) { /* open an url in a browse
return 0;
}
-WSLUA_FUNCTION wslua_browser_open_data_file(lua_State* L) { /* open an file in a browser */
+WSLUA_FUNCTION wslua_browser_open_data_file(lua_State* L) { /* Open an file in a browser */
#define WSLUA_ARG_browser_open_data_file_FILENAME 1 /* The url. */
const char* file = luaL_checkstring(L,WSLUA_ARG_browser_open_data_file_FILENAME);
if (!ops->browser_open_data_file) {
- WSLUA_ERROR(browser_open_data_file, "does not work on TShark");
+ WSLUA_ERROR(browser_open_data_file, "Does not work on TShark");
}
if (!file) {
- WSLUA_ARG_ERROR(browser_open_data_file,FILENAME,"must be a string");
+ WSLUA_ARG_ERROR(browser_open_data_file,FILENAME,"Must be a string");
}
ops->browser_open_data_file(file);
diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c
index 41931a5312..22548849b4 100644
--- a/epan/wslua/wslua_listener.c
+++ b/epan/wslua/wslua_listener.c
@@ -191,8 +191,8 @@ void lua_tap_draw(void *tapdata) {
WSLUA_CONSTRUCTOR Listener_new(lua_State* L) {
/* Creates a new Listener listener */
-#define WSLUA_OPTARG_Listener_new_TAP 1 /* the name of this tap */
-#define WSLUA_OPTARG_Listener_new_FILTER 2 /* a filter that when matches the tap.packet function gets called (use nil to be called for every packet) */
+#define WSLUA_OPTARG_Listener_new_TAP 1 /* The name of this tap */
+#define WSLUA_OPTARG_Listener_new_FILTER 2 /* A filter that when matches the tap.packet function gets called (use nil to be called for every packet) */
const gchar* tap_type = luaL_optstring(L,WSLUA_OPTARG_Listener_new_TAP,"frame");
const gchar* filter = luaL_optstring(L,WSLUA_OPTARG_Listener_new_FILTER,NULL);
diff --git a/epan/wslua/wslua_pinfo.c b/epan/wslua/wslua_pinfo.c
index 5e03867eae..9e012c71f4 100644
--- a/epan/wslua/wslua_pinfo.c
+++ b/epan/wslua/wslua_pinfo.c
@@ -79,7 +79,7 @@ WSLUA_CONSTRUCTOR Address_ip(lua_State* L) {
SET_ADDRESS(addr, AT_IPv4, 4, ip_addr);
pushAddress(L,addr);
- WSLUA_RETURN(1); /* the Address object */
+ WSLUA_RETURN(1); /* The Address object */
}
#if 0
@@ -230,7 +230,7 @@ static int Address__gc(lua_State* L) {
return 0;
}
-WSLUA_METAMETHOD Address__eq(lua_State* L) { /* compares two Addresses */
+WSLUA_METAMETHOD Address__eq(lua_State* L) { /* Compares two Addresses */
Address addr1 = checkAddress(L,1);
Address addr2 = checkAddress(L,2);
gboolean result = FALSE;
@@ -243,7 +243,7 @@ WSLUA_METAMETHOD Address__eq(lua_State* L) { /* compares two Addresses */
return 1;
}
-WSLUA_METAMETHOD Address__le(lua_State* L) { /* compares two Addresses */
+WSLUA_METAMETHOD Address__le(lua_State* L) { /* Compares two Addresses */
Address addr1 = checkAddress(L,1);
Address addr2 = checkAddress(L,2);
gboolean result = FALSE;
@@ -256,7 +256,7 @@ WSLUA_METAMETHOD Address__le(lua_State* L) { /* compares two Addresses */
return 1;
}
-WSLUA_METAMETHOD Address__lt(lua_State* L) { /* compares two Addresses */
+WSLUA_METAMETHOD Address__lt(lua_State* L) { /* Compares two Addresses */
Address addr1 = checkAddress(L,1);
Address addr2 = checkAddress(L,2);
gboolean result = FALSE;
@@ -495,8 +495,8 @@ WSLUA_METAMETHOD Columns__tostring(lua_State *L) {
WSLUA_METAMETHOD Columns__newindex(lua_State *L) {
/* Sets the text of a specific column */
-#define WSLUA_ARG_Columns__newindex_COLUMN 2 /* the name of the column to set */
-#define WSLUA_ARG_Columns__newindex_TEXT 3 /* the text for the column */
+#define WSLUA_ARG_Columns__newindex_COLUMN 2 /* The name of the column to set */
+#define WSLUA_ARG_Columns__newindex_TEXT 3 /* The text for the column */
Columns cols = checkColumns(L,1);
const struct col_names_t* cn;
const char* colname;
@@ -943,7 +943,7 @@ static const pinfo_method_t Pinfo_methods[] = {
/* WSLUA_ATTRIBUTE Pinfo_columns RO Accesss to the packet list columns */
{"columns", Pinfo_columns, pushnil_param, PARAM_NONE },
- /* WSLUA_ATTRIBUTE Pinfo_cols RO Accesss to the packet list columns (equivalent to pinfo.cols) */
+ /* WSLUA_ATTRIBUTE Pinfo_cols RO Accesss to the packet list columns (equivalent to pinfo.columns) */
{"cols", Pinfo_columns, pushnil_param, PARAM_NONE },
/* WSLUA_ATTRIBUTE Pinfo_desegment_len RW Estimated number of additional bytes required for completing the PDU */
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index 1cd0169f9a..89c6df5cde 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -159,9 +159,7 @@ static int new_pref(lua_State* L, pref_type_t type) {
}
WSLUA_CONSTRUCTOR Pref_bool(lua_State* L) {
- /*
- * Creates a boolean preference to be added to a Protocol's prefs table.
- */
+ /* Creates a boolean preference to be added to a Protocol's prefs table. */
#define WSLUA_ARG_Pref_bool_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
#define WSLUA_ARG_Pref_bool_DEFAULT 2 /* The default value for this preference */
#define WSLUA_ARG_Pref_bool_DESCR 3 /* A description of what this preference is */
@@ -169,9 +167,7 @@ WSLUA_CONSTRUCTOR Pref_bool(lua_State* L) {
}
WSLUA_CONSTRUCTOR Pref_uint(lua_State* L) {
- /*
- * Creates an (unsigned) integer preference to be added to a Protocol's prefs table.
- */
+ /* Creates an (unsigned) integer preference to be added to a Protocol's prefs table. */
#define WSLUA_ARG_Pref_uint_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
#define WSLUA_ARG_Pref_uint_DEFAULT 2 /* The default value for this preference */
#define WSLUA_ARG_Pref_uint_DESCR 3 /* A description of what this preference is */
@@ -179,9 +175,7 @@ WSLUA_CONSTRUCTOR Pref_uint(lua_State* L) {
}
WSLUA_CONSTRUCTOR Pref_string(lua_State* L) {
- /*
- * Creates a string preference to be added to a Protocol's prefs table.
- */
+ /* Creates a string preference to be added to a Protocol's prefs table. */
#define WSLUA_ARG_Pref_string_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
#define WSLUA_ARG_Pref_string_DEFAULT 2 /* The default value for this preference */
#define WSLUA_ARG_Pref_string_DESCR 3 /* A description of what this preference is */
@@ -189,35 +183,29 @@ WSLUA_CONSTRUCTOR Pref_string(lua_State* L) {
}
WSLUA_CONSTRUCTOR Pref_enum(lua_State* L) {
- /*
- * Creates an enum preference to be added to a Protocol's prefs table.
- */
+ /* Creates an enum preference to be added to a Protocol's prefs table. */
#define WSLUA_ARG_Pref_enum_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
#define WSLUA_ARG_Pref_enum_DEFAULT 2 /* The default value for this preference */
#define WSLUA_ARG_Pref_enum_DESCR 3 /* A description of what this preference is */
-#define WSLUA_ARG_Pref_enum_ENUM 4 /* enum */
-#define WSLUA_ARG_Pref_enum_RADIO 5 /* radio_button or combobox */
+#define WSLUA_ARG_Pref_enum_ENUM 4 /* A enum table */
+#define WSLUA_ARG_Pref_enum_RADIO 5 /* Radio button (true) or Combobox (false) */
return new_pref(L,PREF_ENUM);
}
WSLUA_CONSTRUCTOR Pref_range(lua_State* L) {
- /*
- * Creates a range preference to be added to a Protocol's prefs table.
- */
-#define WSLUA_ARG_Pref_enum_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
-#define WSLUA_ARG_Pref_enum_DEFAULT 2 /* The default value for this preference */
-#define WSLUA_ARG_Pref_enum_DESCR 3 /* A description of what this preference is */
-#define WSLUA_ARG_Pref_enum_RANGE 4 /* The range */
-#define WSLUA_ARG_Pref_enum_MAX 5 /* The maximum value */
+ /* Creates a range preference to be added to a Protocol's prefs table. */
+#define WSLUA_ARG_Pref_range_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
+#define WSLUA_ARG_Pref_range_DEFAULT 2 /* The default value for this preference */
+#define WSLUA_ARG_Pref_range_DESCR 3 /* A description of what this preference is */
+#define WSLUA_ARG_Pref_range_RANGE 4 /* The range */
+#define WSLUA_ARG_Pref_range_MAX 5 /* The maximum value */
return new_pref(L,PREF_RANGE);
}
-WSLUA_CONSTRUCTOR Pref_stext(lua_State* L) {
- /*
- * Creates a static text preference to be added to a Protocol's prefs table.
- */
-#define WSLUA_ARG_Pref_enum_LABEL 1 /* The Label (text in the right side of the preference input) for this preference */
-#define WSLUA_ARG_Pref_enum_TEXT 2 /* The static text */
+WSLUA_CONSTRUCTOR Pref_statictext(lua_State* L) {
+ /* Creates a static text preference to be added to a Protocol's prefs table. */
+#define WSLUA_ARG_Pref_statictext_LABEL 1 /* The static text */
+#define WSLUA_ARG_Pref_statictext_DESCR 2 /* The static text description */
return new_pref(L,PREF_STATIC_TEXT);
}
@@ -241,7 +229,7 @@ WSLUA_METHODS Pref_methods[] = {
{"string", Pref_string},
{"enum", Pref_enum},
{"range", Pref_range},
- {"statictext", Pref_stext},
+ {"statictext", Pref_statictext},
{0,0}
};
@@ -259,7 +247,7 @@ WSLUA_REGISTER Pref_register(lua_State* L) {
WSLUA_CLASS_DEFINE(Prefs,NOP,NOP); /* The table of preferences of a protocol */
WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
- /* creates a new preference */
+ /* Creates a new preference */
#define WSLUA_ARG_Prefs__newindex_NAME 2 /* The abbreviation of this preference */
#define WSLUA_ARG_Prefs__newindex_PREF 3 /* A valid but still unassigned Pref object */
@@ -347,10 +335,10 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
prefs_register_static_text_preference(prefs->proto->prefs_module,
pref->name,
pref->label,
- "This is just a static text");
+ pref->desc);
break;
default:
- WSLUA_ERROR(Prefs__newindex,"unknow Pref type");
+ WSLUA_ERROR(Prefs__newindex,"Unknow Pref type");
}
pref->proto = p->proto;
@@ -365,7 +353,7 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
}
WSLUA_METAMETHOD Prefs__index(lua_State* L) {
- /* get the value of a preference setting */
+ /* Get the value of a preference setting */
#define WSLUA_ARG_Prefs__index_NAME 2 /* The abbreviation of this preference */
Pref prefs = checkPrefs(L,1);
@@ -383,9 +371,9 @@ WSLUA_METAMETHOD Prefs__index(lua_State* L) {
case PREF_STRING: lua_pushstring(L,prefs->value.s); break;
case PREF_ENUM: lua_pushnumber(L,(lua_Number)prefs->value.e); break;
case PREF_RANGE: lua_pushstring(L,range_convert_range(prefs->value.r)); break;
- default: WSLUA_ERROR(Prefs__index,"unknow Pref type");
+ default: WSLUA_ERROR(Prefs__index,"Unknow Pref type");
}
- WSLUA_RETURN(1); /* the current value of the preference */
+ WSLUA_RETURN(1); /* The current value of the preference */
}
} while (( prefs = prefs->next ));
@@ -406,9 +394,7 @@ WSLUA_REGISTER Prefs_register(lua_State* L) {
WSLUA_CLASS_DEFINE(ProtoField,FAIL_ON_NULL("null ProtoField"),NOP);
-/*
- * A Protocol field (to be used when adding items to the dissection tree)
- */
+ /* A Protocol field (to be used when adding items to the dissection tree) */
static const wslua_ft_types_t ftenums[] = {
{"FT_BOOLEAN",FT_BOOLEAN},
@@ -466,7 +452,7 @@ struct base_display_string_t {
};
static const struct base_display_string_t base_displays[] = {
- { "BASE_NONE", BASE_NONE},
+ {"BASE_NONE", BASE_NONE},
{"BASE_DEC", BASE_DEC},
{"BASE_HEX", BASE_HEX},
{"BASE_OCT", BASE_OCT},
@@ -544,9 +530,9 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { /* Creates a new field to be us
#define WSLUA_ARG_ProtoField_new_NAME 1 /* Actual name of the field (the string that appears in the tree). */
#define WSLUA_ARG_ProtoField_new_ABBR 2 /* Filter name of the field (the string that is used in filters). */
#define WSLUA_ARG_ProtoField_new_TYPE 3 /* Field Type (FT_*). */
-#define WSLUA_OPTARG_ProtoField_new_VALUESTRING 4 /* a ValueString object. */
+#define WSLUA_OPTARG_ProtoField_new_VALUESTRING 4 /* A ValueString object. */
#define WSLUA_OPTARG_ProtoField_new_BASE 5 /* The representation BASE_*. */
-#define WSLUA_OPTARG_ProtoField_new_MASK 6 /* the bitmask to be used. */
+#define WSLUA_OPTARG_ProtoField_new_MASK 6 /* The bitmask to be used. */
#define WSLUA_OPTARG_ProtoField_new_DESCR 7 /* The description of the field. */
ProtoField f = g_malloc(sizeof(wslua_field_t));
@@ -624,103 +610,103 @@ static int ProtoField_integer(lua_State* L, enum ftenum type) {
#define PROTOFIELD_INTEGER(lower,FT) static int ProtoField_##lower(lua_State* L) { return ProtoField_integer(L,FT); }
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint8 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint16 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint24 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint32 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_uint64 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int8 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int16 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int24 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int32 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_int64 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
-
-/* _WSLUA_CONSTRUCTOR_ ProtoField_framenum a frame number (for hyperlinks between frames) */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
+
+/* _WSLUA_CONSTRUCTOR_ ProtoField_framenum A frame number (for hyperlinks between frames) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_BASE one of base.DEC, base.HEX or base.OCT */
-/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING a table containing the text that corresponds to the values */
-/* WSLUA_OPTARG_Protofield_uint8_MASK integer mask of this field */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_BASE One of base.DEC, base.HEX or base.OCT */
+/* WSLUA_OPTARG_Protofield_uint8_VALUESTRING A table containing the text that corresponds to the values */
+/* WSLUA_OPTARG_Protofield_uint8_MASK Integer mask of this field */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
PROTOFIELD_INTEGER(uint8,FT_UINT8)
PROTOFIELD_INTEGER(uint16,FT_UINT16)
@@ -757,76 +743,76 @@ static int ProtoField_other(lua_State* L,enum ftenum type) {
#define PROTOFIELD_OTHER(lower,FT) static int ProtoField_##lower(lua_State* L) { return ProtoField_other(L,FT); }
/* _WSLUA_CONSTRUCTOR_ ProtoField_ipv4 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ipv6 */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ether */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_float */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_double */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_string */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_stringz */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_bytes */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_ubytes */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_guid */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_oid */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
/* _WSLUA_CONSTRUCTOR_ ProtoField_bool */
-/* WSLUA_ARG_Protofield_uint8_ABBR abbreviated name of the field (the string used in filters) */
+/* WSLUA_ARG_Protofield_uint8_ABBR Abbreviated name of the field (the string used in filters) */
/* WSLUA_OPTARG_Protofield_uint8_NAME Actual name of the field (the string that appears in the tree) */
-/* WSLUA_OPTARG_Protofield_uint8_DESC description of the field */
-/* _WSLUA_RETURNS_ a protofield item to be added to a ProtoFieldArray */
+/* WSLUA_OPTARG_Protofield_uint8_DESC Description of the field */
+/* _WSLUA_RETURNS_ A protofield item to be added to a ProtoFieldArray */
PROTOFIELD_OTHER(ipv4,FT_IPv4)
PROTOFIELD_OTHER(ipv6,FT_IPv6)
@@ -1004,7 +990,7 @@ static int Proto_tostring(lua_State* L) {
}
WSLUA_FUNCTION wslua_register_postdissector(lua_State* L) {
- /* make a protocol (with a dissector) a postdissector. It will be called for every frame after dissection */
+ /* Make a protocol (with a dissector) a postdissector. It will be called for every frame after dissection */
#define WSLUA_ARG_register_postdissector_PROTO 1 /* the protocol to be used as postdissector */
Proto proto = checkProto(L,WSLUA_ARG_register_postdissector_PROTO);
if (!proto) return 0;
@@ -1150,19 +1136,19 @@ typedef struct {
} proto_actions_t;
static const proto_actions_t proto_actions[] = {
- /* WSLUA_ATTRIBUTE Proto_dissector RW the protocol's dissector, a function you define */
+ /* WSLUA_ATTRIBUTE Proto_dissector RW The protocol's dissector, a function you define */
{"dissector",Proto_get_dissector, Proto_set_dissector},
- /* WSLUA_ATTRIBUTE Proto_fields RO the Fields Table of this dissector */
+ /* WSLUA_ATTRIBUTE Proto_fields RO The Fields Table of this dissector */
{"fields" ,Proto_get_fields, Proto_set_fields},
- /* WSLUA_ATTRIBUTE Proto_get_prefs RO the preferences of this dissector */
+ /* WSLUA_ATTRIBUTE Proto_prefs RO The preferences of this dissector */
{"prefs",Proto_get_prefs,NULL},
- /* WSLUA_ATTRIBUTE Proto_init WO the init routine of this dissector, a function you define */
+ /* WSLUA_ATTRIBUTE Proto_init WO The init routine of this dissector, a function you define */
{"init",NULL,Proto_set_init},
- /* WSLUA_ATTRIBUTE Proto_name RO the name given to this dissector */
+ /* WSLUA_ATTRIBUTE Proto_name RO The name given to this dissector */
{"name",Proto_get_name,NULL},
{NULL,NULL,NULL}
};
@@ -1283,9 +1269,7 @@ WSLUA_CLASS_DEFINE(Dissector,NOP,NOP);
WSLUA_CONSTRUCTOR Dissector_get (lua_State *L) {
- /*
- * Obtains a dissector reference by name
- */
+ /* Obtains a dissector reference by name */
#define WSLUA_ARG_Dissector_get_NAME 1 /* The name of the dissector */
const gchar* name = luaL_checkstring(L,WSLUA_ARG_Dissector_get_NAME);
Dissector d;
@@ -1302,9 +1286,7 @@ WSLUA_CONSTRUCTOR Dissector_get (lua_State *L) {
}
WSLUA_METHOD Dissector_call(lua_State* L) {
- /*
- * Calls a dissector against a given packet (or part of it)
- */
+ /* Calls a dissector against a given packet (or part of it) */
#define WSLUA_ARG_Dissector_call_TVB 2 /* The buffer to dissect */
#define WSLUA_ARG_Dissector_call_PINFO 3 /* The packet info */
#define WSLUA_ARG_Dissector_call_TREE 4 /* The tree on which to add the protocol items */
@@ -1322,7 +1304,7 @@ WSLUA_METHOD Dissector_call(lua_State* L) {
/* XXX Are we sure about this??? is this the right/only thing to catch */
} CATCH(ReportedBoundsError) {
proto_tree_add_protocol_format(lua_tree->tree, lua_malformed, lua_tvb, 0, 0, "[Malformed Frame: Packet Length]" );
- error = "malformed frame";
+ error = "Malformed frame";
} ENDTRY;
if (error) { WSLUA_ERROR(Dissector_call,error); }
@@ -1362,13 +1344,11 @@ WSLUA_CLASS_DEFINE(DissectorTable,NOP,NOP);
*/
WSLUA_CONSTRUCTOR DissectorTable_new (lua_State *L) {
- /*
- Creates a new DissectorTable for your dissector's use .
- */
+ /* Creates a new DissectorTable for your dissector's use. */
#define WSLUA_ARG_DissectorTable_new_TABLENAME 1 /* The short name of the table. */
#define WSLUA_OPTARG_DissectorTable_new_UINAME 2 /* The name of the table in the User Interface (defaults to the name given). */
-#define WSLUA_OPTARG_DissectorTable_new_TYPE 3 /* either FT_UINT* or FT_STRING (defaults to FT_UINT32) */
-#define WSLUA_OPTARG_DissectorTable_new_BASE 4 /* either BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX or BASE_HEX_DEC (defaults to BASE_DEC) */
+#define WSLUA_OPTARG_DissectorTable_new_TYPE 3 /* Either FT_UINT* or FT_STRING (defaults to FT_UINT32) */
+#define WSLUA_OPTARG_DissectorTable_new_BASE 4 /* Either BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX or BASE_HEX_DEC (defaults to BASE_DEC) */
gchar* name = (void*)luaL_checkstring(L,WSLUA_ARG_DissectorTable_new_TABLENAME);
gchar* ui_name = (void*)luaL_optstring(L,WSLUA_OPTARG_DissectorTable_new_UINAME,name);
enum ftenum type = luaL_optint(L,WSLUA_OPTARG_DissectorTable_new_TYPE,FT_UINT32);
@@ -1547,7 +1527,7 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
/* XXX Are we sure about this??? is this the right/only thing to catch */
} CATCH(ReportedBoundsError) {
proto_tree_add_protocol_format(lua_tree->tree, lua_malformed, lua_tvb, 0, 0, "[Malformed Frame: Packet Length]" );
- error = "malformed frame";
+ error = "Malformed frame";
} ENDTRY;
if (error) { WSLUA_ERROR(DissectorTable_try,error); }
diff --git a/epan/wslua/wslua_tree.c b/epan/wslua/wslua_tree.c
index 8c180ed2fa..d141a7ffc3 100644
--- a/epan/wslua/wslua_tree.c
+++ b/epan/wslua/wslua_tree.c
@@ -214,7 +214,7 @@ WSLUA_METHOD TreeItem_add_le(lua_State *L) {
}
WSLUA_METHOD TreeItem_set_text(lua_State *L) {
- /* sets the text of the label */
+ /* Sets the text of the label */
#define WSLUA_ARG_TreeItem_set_text_TEXT 2 /* The text to be used. */
TreeItem ti = checkTreeItem(L,1);
@@ -227,7 +227,7 @@ WSLUA_METHOD TreeItem_set_text(lua_State *L) {
}
WSLUA_METHOD TreeItem_append_text(lua_State *L) {
- /* appends text to the label */
+ /* Appends text to the label */
#define WSLUA_ARG_TreeItem_append_text_TEXT 2 /* The text to be appended. */
TreeItem ti = checkTreeItem(L,1);
const gchar* s;
@@ -245,7 +245,7 @@ WSLUA_METHOD TreeItem_append_text(lua_State *L) {
}
WSLUA_METHOD TreeItem_set_expert_flags(lua_State *L) {
-/* Sets the expert flags of the item. */
+ /* Sets the expert flags of the item. */
#define WSLUA_OPTARG_TreeItem_set_expert_flags_GROUP 2 /* One of PI_CHECKSUM, PI_SEQUENCE, PI_RESPONSE_CODE, PI_REQUEST_CODE, PI_UNDECODED, PI_REASSEMBLE, PI_MALFORMED or PI_DEBUG */
#define WSLUA_OPTARG_TreeItem_set_expert_flags_SEVERITY 3 /* One of PI_CHAT, PI_NOTE, PI_WARN, PI_ERROR */
TreeItem ti = checkTreeItem(L,1);
@@ -267,7 +267,7 @@ WSLUA_METHOD TreeItem_add_expert_info(lua_State *L) {
/* Sets the expert flags of the item and adds expert info to the packet. */
#define WSLUA_OPTARG_TreeItem_add_expert_info_GROUP 2 /* One of PI_CHECKSUM, PI_SEQUENCE, PI_RESPONSE_CODE, PI_REQUEST_CODE, PI_UNDECODED, PI_REASSEMBLE, PI_MALFORMED or PI_DEBUG */
#define WSLUA_OPTARG_TreeItem_add_expert_info_SEVERITY 3 /* One of PI_CHAT, PI_NOTE, PI_WARN, PI_ERROR */
-#define WSLUA_OPTARG_TreeItem_add_expert_info_TEXT 3 /* the text for the expert info */
+#define WSLUA_OPTARG_TreeItem_add_expert_info_TEXT 4 /* The text for the expert info */
TreeItem ti = checkTreeItem(L,1);
int group = luaL_optint(L,WSLUA_OPTARG_TreeItem_add_expert_info_GROUP,PI_DEBUG);
int severity = luaL_optint(L,WSLUA_OPTARG_TreeItem_add_expert_info_SEVERITY,PI_CHAT);
@@ -285,7 +285,7 @@ WSLUA_METHOD TreeItem_add_expert_info(lua_State *L) {
}
WSLUA_METHOD TreeItem_set_generated(lua_State *L) {
- /* marks the TreeItem as a generated field (with data infered but not contained in the packet). */
+ /* Marks the TreeItem as a generated field (with data infered but not contained in the packet). */
TreeItem ti = checkTreeItem(L,1);
if (ti) {
if (ti->expired) {
@@ -299,7 +299,7 @@ WSLUA_METHOD TreeItem_set_generated(lua_State *L) {
WSLUA_METHOD TreeItem_set_hidden(lua_State *L) {
- /* should not be used */
+ /* Should not be used */
TreeItem ti = checkTreeItem(L,1);
if (ti) {
if (ti->expired) {
diff --git a/epan/wslua/wslua_tvb.c b/epan/wslua/wslua_tvb.c
index d19e0f42a7..56d0714898 100644
--- a/epan/wslua/wslua_tvb.c
+++ b/epan/wslua/wslua_tvb.c
@@ -33,7 +33,7 @@
WSLUA_CLASS_DEFINE(ByteArray,FAIL_ON_NULL("null bytearray"),NOP);
-WSLUA_CONSTRUCTOR ByteArray_new(lua_State* L) { /* creates a ByteArray Object */
+WSLUA_CONSTRUCTOR ByteArray_new(lua_State* L) { /* Creates a ByteArray Object */
#define WSLUA_OPTARG_ByteArray_new_HEXBYTES 1 /* A string consisting of hexadecimal bytes like "00 B1 A2" or "1a2b3c4d" */
GByteArray* ba = g_byte_array_new();
const gchar* s;
@@ -88,15 +88,15 @@ static int ByteArray_gc(lua_State* L) {
}
WSLUA_METAMETHOD ByteArray__concat(lua_State* L) {
- /* concatenate two ByteArrays */
-#define WSLUA_ARG_ByteArray__cat_FIRST 1 /* first array */
-#define WSLUA_ARG_ByteArray__cat_SECOND 2 /* second array */
+ /* Concatenate two ByteArrays */
+#define WSLUA_ARG_ByteArray__cat_FIRST 1 /* First array */
+#define WSLUA_ARG_ByteArray__cat_SECOND 2 /* Second array */
ByteArray ba = checkByteArray(L,WSLUA_ARG_ByteArray__cat_FIRST);
ByteArray ba2 = checkByteArray(L,WSLUA_ARG_ByteArray__cat_SECOND);
if (! (ba && ba2) )
- WSLUA_ERROR(ByteArray__cat,"both arguments must be ByteArrays");
+ WSLUA_ERROR(ByteArray__cat,"Both arguments must be ByteArrays");
g_byte_array_append(ba,ba2->data,ba2->len);
@@ -105,13 +105,13 @@ WSLUA_METAMETHOD ByteArray__concat(lua_State* L) {
}
WSLUA_METHOD ByteArray_prepend(lua_State* L) {
- /* prepend a ByteArray to this ByteArray */
-#define WSLUA_ARG_ByteArray_prepend_PREPENDED 2 /* array to be prepended */
+ /* Prepend a ByteArray to this ByteArray */
+#define WSLUA_ARG_ByteArray_prepend_PREPENDED 2 /* Array to be prepended */
ByteArray ba = checkByteArray(L,1);
ByteArray ba2 = checkByteArray(L,WSLUA_ARG_ByteArray_prepend_PREPENDED);
if (! (ba && ba2) )
- WSLUA_ERROR(ByteArray_prepend,"both arguments must be ByteArrays");
+ WSLUA_ERROR(ByteArray_prepend,"Both arguments must be ByteArrays");
g_byte_array_prepend(ba,ba2->data,ba2->len);
@@ -120,13 +120,13 @@ WSLUA_METHOD ByteArray_prepend(lua_State* L) {
}
WSLUA_METHOD ByteArray_append(lua_State* L) {
- /* append a ByteArray to this ByteArray */
-#define WSLUA_ARG_ByteArray_append_APPENDED 2 /* array to be appended */
+ /* Append a ByteArray to this ByteArray */
+#define WSLUA_ARG_ByteArray_append_APPENDED 2 /* Array to be appended */
ByteArray ba = checkByteArray(L,1);
ByteArray ba2 = checkByteArray(L,WSLUA_ARG_ByteArray_append_APPENDED);
if (! (ba && ba2) )
- WSLUA_ERROR(ByteArray_append,"both arguments must be ByteArrays");
+ WSLUA_ERROR(ByteArray_append,"Both arguments must be ByteArrays");
g_byte_array_append(ba,ba2->data,ba2->len);
@@ -136,7 +136,7 @@ WSLUA_METHOD ByteArray_append(lua_State* L) {
WSLUA_METHOD ByteArray_set_size(lua_State* L) {
/* Sets the size of a ByteArray, either truncating it or filling it with zeros. */
-#define WSLUA_ARG_ByteArray_set_size_SIZE 2 /* new size of the array*/
+#define WSLUA_ARG_ByteArray_set_size_SIZE 2 /* New size of the array*/
ByteArray ba = checkByteArray(L,1);
int siz = luaL_checkint(L,WSLUA_ARG_ByteArray_set_size_SIZE);
@@ -159,9 +159,9 @@ WSLUA_METHOD ByteArray_set_size(lua_State* L) {
}
WSLUA_METHOD ByteArray_set_index(lua_State* L) {
- /* sets the value of an index of a ByteArray. */
-#define WSLUA_ARG_ByteArray_set_index_INDEX 2 /* the position of the byte to be set */
-#define WSLUA_ARG_ByteArray_set_index_VALUE 3 /* the char value to set [0-255] */
+ /* Sets the value of an index of a ByteArray. */
+#define WSLUA_ARG_ByteArray_set_index_INDEX 2 /* The position of the byte to be set */
+#define WSLUA_ARG_ByteArray_set_index_VALUE 3 /* The char value to set [0-255] */
ByteArray ba = checkByteArray(L,1);
int idx = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_INDEX);
int v = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_VALUE);
@@ -190,8 +190,8 @@ WSLUA_METHOD ByteArray_set_index(lua_State* L) {
WSLUA_METHOD ByteArray_get_index(lua_State* L) {
- /* get the value of a byte in a ByteArray */
-#define WSLUA_ARG_ByteArray_set_index_INDEX 2 /* the position of the byte to be set */
+ /* Set the value of a byte in a ByteArray */
+#define WSLUA_ARG_ByteArray_set_index_INDEX 2 /* The position of the byte to be set */
ByteArray ba = checkByteArray(L,1);
int idx = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_INDEX);
@@ -212,7 +212,7 @@ WSLUA_METHOD ByteArray_get_index(lua_State* L) {
}
WSLUA_METHOD ByteArray_len(lua_State* L) {
- /* obtain the length of a ByteArray */
+ /* Obtain the length of a ByteArray */
ByteArray ba = checkByteArray(L,1);
if (!ba) return 0;
@@ -223,9 +223,9 @@ WSLUA_METHOD ByteArray_len(lua_State* L) {
}
WSLUA_METHOD ByteArray_subset(lua_State* L) {
- /* obtain a segment of a ByteArray */
-#define WSLUA_ARG_ByteArray_set_index_OFFSET 2 /* the position of the first byte */
-#define WSLUA_ARG_ByteArray_set_index_LENGTH 3 /* the length of the segment */
+ /* Obtain a segment of a ByteArray */
+#define WSLUA_ARG_ByteArray_set_index_OFFSET 2 /* The position of the first byte */
+#define WSLUA_ARG_ByteArray_set_index_LENGTH 3 /* The length of the segment */
ByteArray ba = checkByteArray(L,1);
int offset = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_OFFSET);
int len = luaL_checkint(L,WSLUA_ARG_ByteArray_set_index_LENGTH);
@@ -243,11 +243,11 @@ WSLUA_METHOD ByteArray_subset(lua_State* L) {
pushByteArray(L,sub);
- WSLUA_RETURN(1); /* a ByteArray contaning the requested segment. */
+ WSLUA_RETURN(1); /* A ByteArray contaning the requested segment. */
}
static int ByteArray_tostring(lua_State* L) {
- /* obtain a string containing the bytes in a ByteArray so that it can be used in display filters (e.g. "01:23:45:67:89:AB") */
+ /* Obtain a string containing the bytes in a ByteArray so that it can be used in display filters (e.g. "01:23:45:67:89:AB") */
static const gchar* byte_to_str[] = {
"00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F",
"10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F",
@@ -281,7 +281,7 @@ static int ByteArray_tostring(lua_State* L) {
lua_pushstring(L,s->str);
g_string_free(s,TRUE);
- WSLUA_RETURN(1); /* a string contaning a representaion of the ByteArray. */
+ WSLUA_RETURN(1); /* A string contaning a representaion of the ByteArray. */
}
static int Tvb_new_real (lua_State *L);
@@ -337,7 +337,7 @@ int ByteArray_register(lua_State* L) {
*/
WSLUA_CLASS_DEFINE(Tvb,FAIL_ON_NULL("expired tvb"),NOP);
-/* a Tvb represents the packet's buffer. It is passed as an argument to listeners and dissectors,
+/* A Tvb represents the packet's buffer. It is passed as an argument to listeners and dissectors,
and can be used to extract information (via TvbRange) from the packet's data. Beware that Tvbs are usable only by the current
listener or dissector call and are destroyed as soon as the listener/dissector returns, so references
to them are unusable once the function has returned.
@@ -390,12 +390,12 @@ WSLUA_CONSTRUCTOR Tvb_new_real (lua_State *L) {
add_new_data_source(lua_pinfo, tvb->ws_tvb, name);
PUSH_TVB(L,tvb);
- WSLUA_RETURN(1); /* the created Tvb. */
+ WSLUA_RETURN(1); /* The created Tvb. */
}
WSLUA_CONSTRUCTOR Tvb_tvb (lua_State *L) {
- /* creates a (sub)Tvb from using a TvbRange */
-#define WSLUA_ARG_Tvb_new_subset_RANGE 1 /* the TvbRange from which to create the new Tvb. */
+ /* Creates a (sub)Tvb from using a TvbRange */
+#define WSLUA_ARG_Tvb_new_subset_RANGE 1 /* The TvbRange from which to create the new Tvb. */
TvbRange tvbr = checkTvbRange(L,WSLUA_ARG_Tvb_new_subset_RANGE);
Tvb tvb;
@@ -419,7 +419,7 @@ WSLUA_CONSTRUCTOR Tvb_tvb (lua_State *L) {
}
WSLUA_METAMETHOD Tvb__tostring(lua_State* L) {
- /* convert the bytes of a Tvb into a string, to be used for debugging purposes as '...' will be appended in case the string is too long. */
+ /* Convert the bytes of a Tvb into a string, to be used for debugging purposes as '...' will be appended in case the string is too long. */
Tvb tvb = checkTvb(L,1);
int len;
gchar* str;
@@ -433,7 +433,7 @@ WSLUA_METAMETHOD Tvb__tostring(lua_State* L) {
len = tvb_length(tvb->ws_tvb);
str = ep_strdup_printf("TVB(%i) : %s",len,tvb_bytes_to_str(tvb->ws_tvb,0,len));
lua_pushstring(L,str);
- WSLUA_RETURN(1); /* the string. */
+ WSLUA_RETURN(1); /* The string. */
}
static int Tvb__gc(lua_State* L) {
@@ -451,7 +451,7 @@ static int Tvb__gc(lua_State* L) {
}
WSLUA_METHOD Tvb_len(lua_State* L) {
- /* obtain the length of a TVB */
+ /* Obtain the length of a TVB */
Tvb tvb = checkTvb(L,1);
if (!tvb) return 0;
@@ -461,11 +461,11 @@ WSLUA_METHOD Tvb_len(lua_State* L) {
}
lua_pushnumber(L,tvb_length(tvb->ws_tvb));
- WSLUA_RETURN(1); /* the length of the Tvb. */
+ WSLUA_RETURN(1); /* The length of the Tvb. */
}
WSLUA_METHOD Tvb_offset(lua_State* L) {
- /* returns the raw offset (from the beginning of the source Tvb) of a sub Tvb. */
+ /* Returns the raw offset (from the beginning of the source Tvb) of a sub Tvb. */
Tvb tvb = checkTvb(L,1);
if (!tvb) return 0;
@@ -475,21 +475,21 @@ WSLUA_METHOD Tvb_offset(lua_State* L) {
}
lua_pushnumber(L,TVB_RAW_OFFSET(tvb->ws_tvb));
- WSLUA_RETURN(1); /* the raw offset of the Tvb. */
+ WSLUA_RETURN(1); /* The raw offset of the Tvb. */
}
#if USED_FOR_DOC_PURPOSES
WSLUA_METAMETHOD Tvb__call(lua_State* L) {
- /* equivalent to tvb:range(...) */
+ /* Equivalent to tvb:range(...) */
return 0;
}
#endif
WSLUA_CLASS_DEFINE(TvbRange,FAIL_ON_NULL("expired tvbrange"),NOP);
/*
- * a TvbRange represents an usable range of a Tvb and is used to extract data from the Tvb that generated it
- * TvbRanges are created by calling a tvb (e.g. tvb(offset,length)). If the TvbRange span is outside the Tvb's range the creation will cause a runtime error.
+ A TvbRange represents an usable range of a Tvb and is used to extract data from the Tvb that generated it
+ TvbRanges are created by calling a tvb (e.g. tvb(offset,length)). If the TvbRange span is outside the Tvb's range the creation will cause a runtime error.
*/
TvbRange new_TvbRange(lua_State* L, tvbuff_t* ws_tvb, int offset, int len) {
@@ -524,7 +524,7 @@ TvbRange new_TvbRange(lua_State* L, tvbuff_t* ws_tvb, int offset, int len) {
WSLUA_METHOD Tvb_range(lua_State* L) {
- /* creates a tvbr from this Tvb. This is used also as the Tvb:__call() metamethod. */
+ /* Creates a tvbr from this Tvb. This is used also as the Tvb:__call() metamethod. */
#define WSLUA_OPTARG_Tvb_range_OFFSET 2 /* The offset (in octets) from the begining of the Tvb. Defaults to 0. */
#define WSLUA_OPTARG_Tvb_range_LENGTH 3 /* The length (in octets) of the range. Defaults to until the end of the Tvb. */
@@ -541,7 +541,7 @@ WSLUA_METHOD Tvb_range(lua_State* L) {
if ((tvbr = new_TvbRange(L,tvb->ws_tvb,offset,len))) {
PUSH_TVBRANGE(L,tvbr);
- WSLUA_RETURN(1); /* the TvbRange */
+ WSLUA_RETURN(1); /* The TvbRange */
}
return 0;
@@ -573,7 +573,7 @@ int Tvb_register(lua_State* L) {
* get a Blefuscuoan unsigned integer from a tvb
*/
WSLUA_METHOD TvbRange_uint(lua_State* L) {
- /* get a Big Endian (network order) unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long. */
+ /* Get a Big Endian (network order) unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
if (tvbr->tvb->expired) {
@@ -593,7 +593,7 @@ WSLUA_METHOD TvbRange_uint(lua_State* L) {
return 1;
case 4:
lua_pushnumber(L,tvb_get_ntohl(tvbr->tvb->ws_tvb,tvbr->offset));
- WSLUA_RETURN(1); /* the unsigned integer value */
+ WSLUA_RETURN(1); /* The unsigned integer value */
/*
* XXX:
* lua uses double so we have 52 bits to play with
@@ -611,7 +611,7 @@ WSLUA_METHOD TvbRange_uint(lua_State* L) {
* get a Lilliputian unsigned integer from a tvb
*/
WSLUA_METHOD TvbRange_le_uint(lua_State* L) {
- /* get a Little Endian unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long. */
+ /* Get a Little Endian unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
if (tvbr->tvb->expired) {
@@ -632,7 +632,7 @@ WSLUA_METHOD TvbRange_le_uint(lua_State* L) {
return 1;
case 4:
lua_pushnumber(L,tvb_get_letohl(tvbr->tvb->ws_tvb,tvbr->offset));
- WSLUA_RETURN(1); /* the unsigned integer value */
+ WSLUA_RETURN(1); /* The unsigned integer value */
default:
luaL_error(L,"TvbRange:get_le_uint() does not handle %d byte integers",tvbr->len);
return 0;
@@ -643,7 +643,7 @@ WSLUA_METHOD TvbRange_le_uint(lua_State* L) {
* get a Blefuscuoan unsigned 64 bit integer from a tvb
*/
WSLUA_METHOD TvbRange_uint64(lua_State* L) {
- /* get a Big Endian (network order) unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long. */
+ /* Get a Big Endian (network order) unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
if (tvbr->tvb->expired) {
@@ -675,7 +675,7 @@ WSLUA_METHOD TvbRange_uint64(lua_State* L) {
* get a Lilliputian unsigned 64 bit integer from a tvb
*/
WSLUA_METHOD TvbRange_le_uint64(lua_State* L) {
- /* get a Little Endian unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long. */
+ /* Get a Little Endian unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
if (tvbr->tvb->expired) {
@@ -707,7 +707,7 @@ WSLUA_METHOD TvbRange_le_uint64(lua_State* L) {
* get a Blefuscuoan float
*/
WSLUA_METHOD TvbRange_float(lua_State* L) {
- /* get a Big Endian (network order) floating point number from a TvbRange. The range must be 4 or 8 octets long. */
+ /* Get a Big Endian (network order) floating point number from a TvbRange. The range must be 4 or 8 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
if (tvbr->tvb->expired) {
@@ -721,7 +721,7 @@ WSLUA_METHOD TvbRange_float(lua_State* L) {
return 1;
case 8:
lua_pushnumber(L,tvb_get_ntohieee_double(tvbr->tvb->ws_tvb,tvbr->offset));
- WSLUA_RETURN(1); /* the flaoting point value */
+ WSLUA_RETURN(1); /* The flaoting point value */
default:
luaL_error(L,"TvbRange:get_float() does not handle %d byte floating numbers",tvbr->len);
return 0;
@@ -732,7 +732,7 @@ WSLUA_METHOD TvbRange_float(lua_State* L) {
* get a Lilliputian float
*/
WSLUA_METHOD TvbRange_le_float(lua_State* L) {
- /* get a Little Endian floating point number from a TvbRange. The range must be 4 or 8 octets long. */
+ /* Get a Little Endian floating point number from a TvbRange. The range must be 4 or 8 octets long. */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
@@ -742,7 +742,7 @@ WSLUA_METHOD TvbRange_le_float(lua_State* L) {
return 1;
case 8:
lua_pushnumber(L,tvb_get_letohieee_double(tvbr->tvb->ws_tvb,tvbr->offset));
- WSLUA_RETURN(1); /* the flaoting point value */
+ WSLUA_RETURN(1); /* The flaoting point value */
default:
luaL_error(L,"TvbRange:get_float() does not handle %d byte floating numbers",tvbr->len);
return 0;
@@ -750,7 +750,7 @@ WSLUA_METHOD TvbRange_le_float(lua_State* L) {
}
WSLUA_METHOD TvbRange_ipv4(lua_State* L) {
- /* get an IPv4 Address from a TvbRange. */
+ /* Get an IPv4 Address from a TvbRange. */
TvbRange tvbr = checkTvbRange(L,1);
Address addr;
@@ -773,11 +773,11 @@ WSLUA_METHOD TvbRange_ipv4(lua_State* L) {
SET_ADDRESS(addr, AT_IPv4, 4, ip_addr);
pushAddress(L,addr);
- WSLUA_RETURN(1); /* the IPv4 Address */
+ WSLUA_RETURN(1); /* The IPv4 Address */
}
WSLUA_METHOD TvbRange_le_ipv4(lua_State* L) {
- /* get an Little Endian IPv4 Address from a TvbRange. */
+ /* Get an Little Endian IPv4 Address from a TvbRange. */
TvbRange tvbr = checkTvbRange(L,1);
Address addr;
@@ -801,11 +801,11 @@ WSLUA_METHOD TvbRange_le_ipv4(lua_State* L) {
SET_ADDRESS(addr, AT_IPv4, 4, ip_addr);
pushAddress(L,addr);
- WSLUA_RETURN(1); /* the IPv4 Address */
+ WSLUA_RETURN(1); /* The IPv4 Address */
}
WSLUA_METHOD TvbRange_ether(lua_State* L) {
- /* get an Ethernet Address from a TvbRange. */
+ /* Get an Ethernet Address from a TvbRange. */
TvbRange tvbr = checkTvbRange(L,1);
Address addr;
guint8* buff;
@@ -826,12 +826,12 @@ WSLUA_METHOD TvbRange_ether(lua_State* L) {
SET_ADDRESS(addr, AT_ETHER, 6, buff);
pushAddress(L,addr);
- WSLUA_RETURN(1); /* the Ethernet Address */
+ WSLUA_RETURN(1); /* The Ethernet Address */
}
WSLUA_METHOD TvbRange_string(lua_State* L) {
- /* obtain a string from a TvbRange */
+ /* Obtain a string from a TvbRange */
TvbRange tvbr = checkTvbRange(L,1);
if ( !(tvbr && tvbr->tvb)) return 0;
@@ -842,11 +842,11 @@ WSLUA_METHOD TvbRange_string(lua_State* L) {
lua_pushstring(L, (gchar*)tvb_get_ephemeral_string(tvbr->tvb->ws_tvb,tvbr->offset,tvbr->len) );
- WSLUA_RETURN(1); /* the string */
+ WSLUA_RETURN(1); /* The string */
}
WSLUA_METHOD TvbRange_bytes(lua_State* L) {
- /* obtain a ByteArray */
+ /* Obtain a ByteArray */
TvbRange tvbr = checkTvbRange(L,1);
GByteArray* ba;
@@ -861,11 +861,11 @@ WSLUA_METHOD TvbRange_bytes(lua_State* L) {
pushByteArray(L,ba);
- WSLUA_RETURN(1); /* the ByteArray */
+ WSLUA_RETURN(1); /* The ByteArray */
}
WSLUA_METHOD TvbRange_len(lua_State* L) {
- /* obtain the length of a TvbRange */
+ /* Obtain the length of a TvbRange */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
@@ -878,7 +878,7 @@ WSLUA_METHOD TvbRange_len(lua_State* L) {
}
WSLUA_METHOD TvbRange_offset(lua_State* L) {
- /* obtain the offset in a TvbRange */
+ /* Obtain the offset in a TvbRange */
TvbRange tvbr = checkTvbRange(L,1);
if (!(tvbr && tvbr->tvb)) return 0;
@@ -892,7 +892,7 @@ WSLUA_METHOD TvbRange_offset(lua_State* L) {
WSLUA_METAMETHOD TvbRange__tostring(lua_State* L) {
- /* converts the TvbRange into a string. As the string gets truncated
+ /* Converts the TvbRange into a string. As the string gets truncated
you should use this only for debugging purposes
or if what you want is to have a truncated string in the format 67:89:AB:... */
TvbRange tvbr = checkTvbRange(L,1);
@@ -939,15 +939,15 @@ int TvbRange_register(lua_State* L) {
WSLUA_CLASS_DEFINE(Int64,NOP,NOP);
/*
- * Int64 represents a 64 bit integer.
- * Lua uses one single number representation which can be chosen at compile time and since
- * it is often set to IEEE 754 double precision floating point, we cannot store a 64 bit integer
- * with full precision.
- * For details, see: http://lua-users.org/wiki/FloatingPoint
+ Int64 represents a 64 bit integer.
+ Lua uses one single number representation which can be chosen at compile time and since
+ it is often set to IEEE 754 double precision floating point, we cannot store a 64 bit integer
+ with full precision.
+ For details, see: http://lua-users.org/wiki/FloatingPoint
*/
WSLUA_METAMETHOD Int64__tostring(lua_State* L) {
- /* converts the Int64 into a string */
+ /* Converts the Int64 into a string */
Int64 num = checkInt64(L,1);
lua_pushstring(L,g_strdup_printf("%ld",(long int)*(num)));
return 1;
@@ -968,12 +968,10 @@ int Int64_register(lua_State* L) {
}
WSLUA_CLASS_DEFINE(UInt64,NOP,NOP);
-/*
- * Int64 represents a 64 bit integer.
- */
+ /* Int64 represents a 64 bit integer. */
WSLUA_METAMETHOD UInt64__tostring(lua_State* L) {
- /* converts the UInt64 into a string */
+ /* Converts the UInt64 into a string */
UInt64 num = checkUInt64(L,1);
lua_pushstring(L,g_strdup_printf("%ld",(unsigned long int)*(num)));
return 1;
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c
index 7c8d37887a..f764e8e272 100644
--- a/epan/wslua/wslua_util.c
+++ b/epan/wslua/wslua_util.c
@@ -67,11 +67,11 @@ WSLUA_FUNCTION wslua_format_date(lua_State* LS) { /* Formats an absolute timesta
str = abs_time_to_str(&then);
lua_pushstring(LS,str);
- WSLUA_RETURN(1); /* a string with the formated date */
+ WSLUA_RETURN(1); /* A string with the formated date */
}
WSLUA_FUNCTION wslua_format_time(lua_State* LS) { /* Formats a relative timestamp in a human readable form */
-#define WSLUA_ARG_format_time_TIMESTAMP 1 /* a timestamp value to convert */
+#define WSLUA_ARG_format_time_TIMESTAMP 1 /* A timestamp value to convert */
lua_Number time = luaL_checknumber(LS,WSLUA_ARG_format_time_TIMESTAMP);
nstime_t then;
gchar* str;
@@ -81,11 +81,11 @@ WSLUA_FUNCTION wslua_format_time(lua_State* LS) { /* Formats a relative timestam
str = rel_time_to_str(&then);
lua_pushstring(LS,str);
- WSLUA_RETURN(1); /* a string with the formated time */
+ WSLUA_RETURN(1); /* A string with the formated time */
}
-WSLUA_FUNCTION wslua_report_failure(lua_State* LS) { /* reports a failure to the user */
-#define WSLUA_ARG_report_failure_TEXT 1 /* message */
+WSLUA_FUNCTION wslua_report_failure(lua_State* LS) { /* Reports a failure to the user */
+#define WSLUA_ARG_report_failure_TEXT 1 /* Message */
const gchar* s = luaL_checkstring(LS,WSLUA_ARG_report_failure_TEXT);
report_failure("%s",s);
return 0;
@@ -93,7 +93,7 @@ WSLUA_FUNCTION wslua_report_failure(lua_State* LS) { /* reports a failure to the
static int wslua_log(lua_State* L, GLogLevelFlags log_level) {
GString* str = g_string_new("");
- int n = lua_gettop(L); /* number of arguments */
+ int n = lua_gettop(L); /* Number of arguments */
int i;
lua_getglobal(L, "tostring");
@@ -186,7 +186,7 @@ static char* wslua_get_actual_filename(const char* fname) {
WSLUA_FUNCTION wslua_loadfile(lua_State* L) {
/* Lua's loadfile() has been modified so that if a file does not exist
in the current directory it will look for it in wireshark's user and system directories */
-#define WSLUA_ARG_loadfile_FILENAME 1 /* name of the file to be loaded */
+#define WSLUA_ARG_loadfile_FILENAME 1 /* Name of the file to be loaded */
const char *given_fname = luaL_checkstring(L, WSLUA_ARG_loadfile_FILENAME);
char* filename;
@@ -208,7 +208,7 @@ WSLUA_FUNCTION wslua_loadfile(lua_State* L) {
WSLUA_FUNCTION wslua_dofile(lua_State* L) {
/* Lua's dofile() has been modified so that if a file does not exist
in the current directory it will look for it in wireshark's user and system directories */
-#define WSLUA_ARG_dofile_FILENAME 1 /* name of the file to be run */
+#define WSLUA_ARG_dofile_FILENAME 1 /* Name of the file to be run */
const char *given_fname = luaL_checkstring(L, WSLUA_ARG_dofile_FILENAME);
char* filename;
int n;
@@ -228,30 +228,30 @@ WSLUA_FUNCTION wslua_dofile(lua_State* L) {
WSLUA_FUNCTION wslua_persconffile_path(lua_State* L) {
-#define WSLUA_OPTARG_persconffile_path_FILENAME 1 /* a filename */
+#define WSLUA_OPTARG_persconffile_path_FILENAME 1 /* A filename */
const char *fname = luaL_optstring(L, WSLUA_OPTARG_persconffile_path_FILENAME,"");
const char* filename = get_persconffile_path(fname,FALSE,FALSE);
lua_pushstring(L,filename);
- WSLUA_RETURN(1); /* the full pathname for a file in the personal configuration directory */
+ WSLUA_RETURN(1); /* The full pathname for a file in the personal configuration directory */
}
WSLUA_FUNCTION wslua_datafile_path(lua_State* L) {
-#define WSLUA_OPTARG_datafile_path_FILENAME 1 /* a filename */
+#define WSLUA_OPTARG_datafile_path_FILENAME 1 /* A filename */
const char *fname = luaL_optstring(L, WSLUA_OPTARG_datafile_path_FILENAME,"");
const char* filename = get_datafile_path(fname);
lua_pushstring(L,filename);
- WSLUA_RETURN(1); /* the full pathname for a file in wireshark's configuration directory */
+ WSLUA_RETURN(1); /* The full pathname for a file in wireshark's configuration directory */
}
WSLUA_CLASS_DEFINE(Dir,NOP,NOP); /* A Directory */
WSLUA_CONSTRUCTOR Dir_open(lua_State* L) {
- /* usage: for filename in Dir.open(path) do ... end */
-#define WSLUA_ARG_Dir_open_PATHNAME 1 /* the pathname of the directory */
-#define WSLUA_OPTARG_Dir_open_EXTENSION 2 /* if given, only file with this extension will be returned */
+ /* Usage: for filename in Dir.open(path) do ... end */
+#define WSLUA_ARG_Dir_open_PATHNAME 1 /* The pathname of the directory */
+#define WSLUA_OPTARG_Dir_open_EXTENSION 2 /* If given, only file with this extension will be returned */
const char* dirname = luaL_checkstring(L,WSLUA_ARG_Dir_open_PATHNAME);
const char* extension = luaL_optstring(L,WSLUA_OPTARG_Dir_open_EXTENSION,NULL);
@@ -288,7 +288,7 @@ WSLUA_CONSTRUCTOR Dir_open(lua_State* L) {
}
WSLUA_METAMETHOD Dir__call(lua_State* L) {
-/* at every invocation will return one file (nil when done) */
+ /* At every invocation will return one file (nil when done) */
Dir dir = checkDir(L,1);
const FILE_T* file;
@@ -332,7 +332,7 @@ WSLUA_METAMETHOD Dir__call(lua_State* L) {
}
WSLUA_METHOD Dir_close(lua_State* L) {
-/* closes the directory */
+ /* Closes the directory */
Dir dir = checkDir(L,1);
if (dir->dir) {
@@ -417,8 +417,8 @@ void statcmd_init(const char *optarg, void* userdata) {
WSLUA_FUNCTION wslua_register_stat_cmd_arg(lua_State* L) {
/* Register a function to handle a -z option */
-#define WSLUA_ARG_register_stat_cmd_arg_ARGUMENT 1 /* */
-#define WSLUA_OPTARG_register_stat_cmd_arg_ACTION 2 /* */
+#define WSLUA_ARG_register_stat_cmd_arg_ARGUMENT 1 /* Argument */
+#define WSLUA_OPTARG_register_stat_cmd_arg_ACTION 2 /* Action */
const char* arg = luaL_checkstring(L,WSLUA_ARG_register_stat_cmd_arg_ARGUMENT);
statcmd_t* sc = g_malloc0(sizeof(statcmd_t)); /* XXX leaked */