mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Deprecate internal_func(), replace with zeek::lookup_func()
This commit is contained in:
parent
a83941d64d
commit
26f6fe01c8
5 changed files with 34 additions and 8 deletions
13
src/Var.cc
13
src/Var.cc
|
@ -795,6 +795,19 @@ Func* internal_func(const char* name)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
IntrusivePtr<Func> zeek::lookup_func(const char* name)
|
||||
{
|
||||
const auto& v = zeek::lookup_val(name);
|
||||
|
||||
if ( ! v )
|
||||
return nullptr;
|
||||
|
||||
if ( ! IsFunc(v->Type()->Tag()) )
|
||||
reporter->InternalError("Expected variable '%s' to be a function", name);
|
||||
|
||||
return {NewRef{}, v->AsFunc()};
|
||||
}
|
||||
|
||||
EventHandlerPtr internal_handler(const char* name)
|
||||
{
|
||||
// If there already is an entry in the registry, we have a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue