mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
&on_change wrapup: documentation, tests, whitespacing
Adds documentation, fixes a whitespace issues, fixes compiler warning on some Linux system, extends test.
This commit is contained in:
parent
b6a244f784
commit
b1040f88c9
5 changed files with 10 additions and 6 deletions
2
doc
2
doc
|
@ -1 +1 @@
|
||||||
Subproject commit 87b63d810d345172084d15c9c7feb132688456fe
|
Subproject commit 7ee302e3d78a3fc759610664cefd15e0578b557f
|
|
@ -1969,7 +1969,7 @@ void TableVal::CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe
|
||||||
|
|
||||||
const Func* f = thefunc->AsFunc();
|
const Func* f = thefunc->AsFunc();
|
||||||
val_list vl { Ref() };
|
val_list vl { Ref() };
|
||||||
EnumVal* type;
|
EnumVal* type = nullptr;
|
||||||
switch ( tpe )
|
switch ( tpe )
|
||||||
{
|
{
|
||||||
case element_new:
|
case element_new:
|
||||||
|
|
|
@ -301,7 +301,7 @@ when return TOK_WHEN;
|
||||||
&read_expire return TOK_ATTR_EXPIRE_READ;
|
&read_expire return TOK_ATTR_EXPIRE_READ;
|
||||||
&redef return TOK_ATTR_REDEF;
|
&redef return TOK_ATTR_REDEF;
|
||||||
&write_expire return TOK_ATTR_EXPIRE_WRITE;
|
&write_expire return TOK_ATTR_EXPIRE_WRITE;
|
||||||
&on_change return TOK_ATTR_ON_CHANGE;
|
&on_change return TOK_ATTR_ON_CHANGE;
|
||||||
|
|
||||||
@deprecated.* {
|
@deprecated.* {
|
||||||
auto num_files = file_stack.length();
|
auto num_files = file_stack.length();
|
||||||
|
|
|
@ -2,7 +2,10 @@ inserting
|
||||||
change_function, a, 1, 5, TABLE_ELEMENT_NEW
|
change_function, a, 1, 5, TABLE_ELEMENT_NEW
|
||||||
set_change, hi, TABLE_ELEMENT_NEW
|
set_change, hi, TABLE_ELEMENT_NEW
|
||||||
changing
|
changing
|
||||||
change_function, a, 1, 5, TABLE_ELEMENT_CHANGED
|
change_function, a, 1, 6, TABLE_ELEMENT_CHANGED
|
||||||
deleting
|
deleting
|
||||||
change_function, a, 1, 5, TABLE_ELEMENT_REMOVED
|
change_function, a, 1, 7, TABLE_ELEMENT_REMOVED
|
||||||
set_change, hi, TABLE_ELEMENT_REMOVED
|
set_change, hi, TABLE_ELEMENT_REMOVED
|
||||||
|
{
|
||||||
|
[a, 1] = 8
|
||||||
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ module TestModule;
|
||||||
function change_function(t: table[string, int] of count, tpe: TableChange, idxa: string, idxb: int, val: count)
|
function change_function(t: table[string, int] of count, tpe: TableChange, idxa: string, idxb: int, val: count)
|
||||||
{
|
{
|
||||||
print "change_function", idxa, idxb, val, tpe;
|
print "change_function", idxa, idxb, val, tpe;
|
||||||
t[idxa, idxb] = val;
|
t[idxa, idxb] = val+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_change(t: set[string], tpe: TableChange, idx: string)
|
function set_change(t: set[string], tpe: TableChange, idx: string)
|
||||||
|
@ -27,4 +27,5 @@ event zeek_init()
|
||||||
print "deleting";
|
print "deleting";
|
||||||
delete t["a", 1];
|
delete t["a", 1];
|
||||||
delete s["hi"];
|
delete s["hi"];
|
||||||
|
print t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue