mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 07:08:19 +00:00
GH-1122: Allow initializing globals with calls to subdir BIFs
This commit is contained in:
parent
cf06ade325
commit
1bbae2368d
9 changed files with 65 additions and 18 deletions
10
src/Func.h
10
src/Func.h
|
@ -276,6 +276,15 @@ extern std::vector<CallInfo> call_stack;
|
|||
|
||||
// This is set to true after the built-in functions have been initialized.
|
||||
extern bool did_builtin_init;
|
||||
extern std::vector<void (*)()> bif_initializers;
|
||||
|
||||
inline void run_bif_initializers()
|
||||
{
|
||||
for ( const auto& bi : bif_initializers )
|
||||
bi();
|
||||
|
||||
bif_initializers = {};
|
||||
}
|
||||
|
||||
extern void emit_builtin_exception(const char* msg);
|
||||
extern void emit_builtin_exception(const char* msg, const ValPtr& arg);
|
||||
|
@ -305,7 +314,6 @@ constexpr auto render_call_stack [[deprecated("Remove in v4.1. Use zeek::render_
|
|||
// renamed version inside the namespace, but the way that the code gets included complicates the matter. It
|
||||
// might need to be revisited after everything is namespaced everywhere else.
|
||||
void init_builtin_funcs();
|
||||
void init_builtin_funcs_subdirs();
|
||||
|
||||
// TODO: do call_stack and did_builtin_init need to be aliased?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue