forked from osmocom/wireshark
check_typed_item_calls.py: change re for calls to allow ws before params
This commit is contained in:
parent
8ec198c272
commit
32d80bd54e
|
@ -74,16 +74,16 @@ class APICheck:
|
||||||
|
|
||||||
if fun_name.startswith('ptvcursor'):
|
if fun_name.startswith('ptvcursor'):
|
||||||
# RE captures function name + 1st 2 args (always ptvc + hfindex)
|
# RE captures function name + 1st 2 args (always ptvc + hfindex)
|
||||||
self.p = re.compile('[^\n]*' + self.fun_name + '\(([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)')
|
self.p = re.compile('[^\n]*' + self.fun_name + '\s*\(([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+)')
|
||||||
elif fun_name.find('add_bitmask') == -1:
|
elif fun_name.find('add_bitmask') == -1:
|
||||||
# Normal case.
|
# Normal case.
|
||||||
# RE captures function name + 1st 2 args (always tree + hfindex + length)
|
# RE captures function name + 1st 2 args (always tree + hfindex + length)
|
||||||
self.p = re.compile('[^\n]*' + self.fun_name + '\(([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+)')
|
self.p = re.compile('[^\n]*' + self.fun_name + '\s*\(([a-zA-Z0-9_]+),\s*([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+)')
|
||||||
else:
|
else:
|
||||||
# _add_bitmask functions.
|
# _add_bitmask functions.
|
||||||
# RE captures function name + 1st + 4th args (always tree + hfindex)
|
# RE captures function name + 1st + 4th args (always tree + hfindex)
|
||||||
# 6th arg is 'fields'
|
# 6th arg is 'fields'
|
||||||
self.p = re.compile('[^\n]*' + self.fun_name + '\(([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+)\s*,\s*[a-zA-Z0-9_]+\s*,\s*([a-zA-Z0-9_]+)\s*,')
|
self.p = re.compile('[^\n]*' + self.fun_name + '\s*\(([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+)\s*,\s*[a-zA-Z0-9_]+\s*,\s*([a-zA-Z0-9_]+)\s*,')
|
||||||
|
|
||||||
self.file = None
|
self.file = None
|
||||||
self.mask_allowed = True
|
self.mask_allowed = True
|
||||||
|
@ -179,13 +179,13 @@ class ProtoTreeAddItemCheck(APICheck):
|
||||||
# proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
# proto_tree_add_item(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||||
# const gint start, gint length, const guint encoding)
|
# const gint start, gint length, const guint encoding)
|
||||||
self.fun_name = 'proto_tree_add_item'
|
self.fun_name = 'proto_tree_add_item'
|
||||||
self.p = re.compile('[^\n]*' + self.fun_name + '\(\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([0-9]+),\s*([a-zA-Z0-9_]+)')
|
self.p = re.compile('[^\n]*' + self.fun_name + '\s*\(\s*[a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+),\s*[a-zA-Z0-9_]+,\s*[a-zA-Z0-9_]+,\s*([0-9]+),\s*([a-zA-Z0-9_]+)')
|
||||||
else:
|
else:
|
||||||
# proto_item *
|
# proto_item *
|
||||||
# ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length,
|
# ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length,
|
||||||
# const guint encoding)
|
# const guint encoding)
|
||||||
self.fun_name = 'ptvcursor_add'
|
self.fun_name = 'ptvcursor_add'
|
||||||
self.p = re.compile('[^\n]*' + self.fun_name + '\([a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+),\s*([a-zA-Z_0-9]+),\s*([a-zA-Z0-9_\-\>]+)')
|
self.p = re.compile('[^\n]*' + self.fun_name + '\s*\([a-zA-Z0-9_]+,\s*([a-zA-Z0-9_]+),\s*([a-zA-Z_0-9]+),\s*([a-zA-Z0-9_\-\>]+)')
|
||||||
|
|
||||||
|
|
||||||
self.lengths = {}
|
self.lengths = {}
|
||||||
|
|
Loading…
Reference in New Issue