mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
make input framework source (hopefully) adhere to the usual indentation
style. No functional changes.
This commit is contained in:
parent
82a6f3832a
commit
2034c10e97
6 changed files with 1102 additions and 897 deletions
|
@ -46,19 +46,23 @@ public:
|
|||
};
|
||||
|
||||
|
||||
ReaderFrontend::ReaderFrontend(bro_int_t type) {
|
||||
ReaderFrontend::ReaderFrontend(bro_int_t type)
|
||||
{
|
||||
disabled = initialized = false;
|
||||
ty_name = "<not set>";
|
||||
backend = input_mgr->CreateBackend(this, type);
|
||||
|
||||
assert(backend);
|
||||
backend->Start();
|
||||
}
|
||||
}
|
||||
|
||||
ReaderFrontend::~ReaderFrontend() {
|
||||
}
|
||||
ReaderFrontend::~ReaderFrontend()
|
||||
{
|
||||
}
|
||||
|
||||
void ReaderFrontend::Init(string arg_source, int mode, const int num_fields, const threading::Field* const* fields) {
|
||||
void ReaderFrontend::Init(string arg_source, int mode, const int num_fields,
|
||||
const threading::Field* const* fields)
|
||||
{
|
||||
if ( disabled )
|
||||
return;
|
||||
|
||||
|
@ -69,39 +73,43 @@ void ReaderFrontend::Init(string arg_source, int mode, const int num_fields, con
|
|||
initialized = true;
|
||||
|
||||
backend->SendIn(new InitMessage(backend, arg_source, mode, num_fields, fields));
|
||||
}
|
||||
}
|
||||
|
||||
void ReaderFrontend::Update() {
|
||||
void ReaderFrontend::Update()
|
||||
{
|
||||
if ( disabled )
|
||||
return;
|
||||
|
||||
if ( !initialized ) {
|
||||
if ( !initialized )
|
||||
{
|
||||
reporter->Error("Tried to call update on uninitialized reader");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
backend->SendIn(new UpdateMessage(backend));
|
||||
}
|
||||
}
|
||||
|
||||
void ReaderFrontend::Close() {
|
||||
void ReaderFrontend::Close()
|
||||
{
|
||||
if ( disabled )
|
||||
return;
|
||||
|
||||
if ( !initialized ) {
|
||||
if ( !initialized )
|
||||
{
|
||||
reporter->Error("Tried to call finish on uninitialized reader");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
backend->SendIn(new CloseMessage(backend));
|
||||
}
|
||||
}
|
||||
|
||||
string ReaderFrontend::Name() const
|
||||
{
|
||||
{
|
||||
if ( source.size() )
|
||||
return ty_name;
|
||||
|
||||
return ty_name + "/" + source;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue