mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
Checkpointing the dynamic plugin code.
This is essentially the code from the dynamic-plugin branch except for some pieces that I have split out into separate, earlier commits. I'm going to updatre things in this branch going forward.
This commit is contained in:
parent
7412470d66
commit
555df1e7ea
43 changed files with 1306 additions and 110 deletions
20
src/scan.l
20
src/scan.l
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "analyzer/Analyzer.h"
|
||||
|
||||
#include "plugin/Manager.h"
|
||||
|
||||
extern YYLTYPE yylloc; // holds start line and column of token
|
||||
extern int print_loaded_scripts;
|
||||
extern int generate_documentation;
|
||||
|
@ -579,6 +581,24 @@ YYLTYPE GetCurrentLocation()
|
|||
|
||||
static int load_files(const char* orig_file)
|
||||
{
|
||||
int rc = plugin_mgr->TryLoadFile(orig_file);
|
||||
|
||||
if ( rc == 1 )
|
||||
return 0; // A plugin took care of it, just skip.
|
||||
|
||||
if ( rc == 0 )
|
||||
{
|
||||
if ( ! reporter->Errors() )
|
||||
// This is just in case the plugin failed to report
|
||||
// the error itself, in which case we want to at
|
||||
// least tell the user that something went wrong.
|
||||
reporter->Error("Plugin reported error loading %s", orig_file);
|
||||
|
||||
exit(1);
|
||||
}
|
||||
|
||||
assert(rc == -1); // No plugin in charge of this file.
|
||||
|
||||
// Whether we pushed on a FileInfo that will restore the
|
||||
// current module after the final file has been scanned.
|
||||
bool did_module_restore = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue