mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Remove all of the random single-file deprecations
These are the changes that don't require a ton of changes to other files outside of the original removal.
This commit is contained in:
parent
7e9d89db0a
commit
0618be792f
270 changed files with 36 additions and 4632 deletions
103
src/Var.cc
103
src/Var.cc
|
@ -780,106 +780,3 @@ IDPList gather_outer_ids(Scope* scope, Stmt* body)
|
|||
}
|
||||
|
||||
} // namespace zeek::detail
|
||||
|
||||
zeek::Val* internal_val(const char* name)
|
||||
{
|
||||
return zeek::id::find_val(name).get();
|
||||
}
|
||||
|
||||
zeek::Val* internal_const_val(const char* name)
|
||||
{
|
||||
return zeek::id::find_const(name).get();
|
||||
}
|
||||
|
||||
zeek::Val* opt_internal_val(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
return id ? id->GetVal().get() : nullptr;
|
||||
}
|
||||
|
||||
double opt_internal_double(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id ) return 0.0;
|
||||
const auto& v = id->GetVal();
|
||||
return v ? v->InternalDouble() : 0.0;
|
||||
}
|
||||
|
||||
bro_int_t opt_internal_int(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id ) return 0;
|
||||
const auto& v = id->GetVal();
|
||||
return v ? v->InternalInt() : 0;
|
||||
}
|
||||
|
||||
bro_uint_t opt_internal_unsigned(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id ) return 0;
|
||||
const auto& v = id->GetVal();
|
||||
return v ? v->InternalUnsigned() : 0;
|
||||
}
|
||||
|
||||
zeek::StringVal* opt_internal_string(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id ) return nullptr;
|
||||
const auto& v = id->GetVal();
|
||||
return v ? v->AsStringVal() : nullptr;
|
||||
}
|
||||
|
||||
zeek::TableVal* opt_internal_table(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id ) return nullptr;
|
||||
const auto& v = id->GetVal();
|
||||
return v ? v->AsTableVal() : nullptr;
|
||||
}
|
||||
|
||||
zeek::ListVal* internal_list_val(const char* name)
|
||||
{
|
||||
const auto& id = zeek::detail::lookup_ID(name, zeek::detail::GLOBAL_MODULE_NAME);
|
||||
if ( ! id )
|
||||
return nullptr;
|
||||
|
||||
zeek::Val* v = id->GetVal().get();
|
||||
|
||||
if ( v )
|
||||
{
|
||||
if ( v->GetType()->Tag() == zeek::TYPE_LIST )
|
||||
return (zeek::ListVal*) v;
|
||||
|
||||
else if ( v->GetType()->IsSet() )
|
||||
{
|
||||
zeek::TableVal* tv = v->AsTableVal();
|
||||
auto lv = tv->ToPureListVal();
|
||||
return lv.release();
|
||||
}
|
||||
|
||||
else
|
||||
zeek::reporter->InternalError("internal variable %s is not a list", name);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
zeek::Type* internal_type(const char* name)
|
||||
{
|
||||
return zeek::id::find_type(name).get();
|
||||
}
|
||||
|
||||
zeek::Func* internal_func(const char* name)
|
||||
{
|
||||
const auto& v = zeek::id::find_val(name);
|
||||
|
||||
if ( v )
|
||||
return v->AsFunc();
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
zeek::EventHandlerPtr internal_handler(const char* name)
|
||||
{
|
||||
return event_registry->Register(name);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue