mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Remove value serialization.
Note - this compiles, but you cannot run Bro anymore - it crashes immediately with a 0-pointer access. The reason behind it is that the required clone functionality does not work anymore.
This commit is contained in:
parent
9b49c7cbc6
commit
474efe9e69
78 changed files with 58 additions and 9185 deletions
65
src/Obj.cc
65
src/Obj.cc
|
@ -5,7 +5,6 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include "Obj.h"
|
||||
#include "Serializer.h"
|
||||
#include "Func.h"
|
||||
#include "File.h"
|
||||
#include "plugin/Manager.h"
|
||||
|
@ -14,47 +13,6 @@ Location no_location("<no location>", 0, 0, 0, 0);
|
|||
Location start_location("<start uninitialized>", 0, 0, 0, 0);
|
||||
Location end_location("<end uninitialized>", 0, 0, 0, 0);
|
||||
|
||||
bool Location::Serialize(SerialInfo* info) const
|
||||
{
|
||||
return SerialObj::Serialize(info);
|
||||
}
|
||||
|
||||
Location* Location::Unserialize(UnserialInfo* info)
|
||||
{
|
||||
return (Location*) SerialObj::Unserialize(info, SER_LOCATION);
|
||||
}
|
||||
|
||||
IMPLEMENT_SERIAL(Location, SER_LOCATION);
|
||||
|
||||
bool Location::DoSerialize(SerialInfo* info) const
|
||||
{
|
||||
DO_SERIALIZE(SER_LOCATION, SerialObj);
|
||||
info->s->WriteOpenTag("Location");
|
||||
|
||||
if ( ! (SERIALIZE(filename) &&
|
||||
SERIALIZE(first_line) &&
|
||||
SERIALIZE(last_line) &&
|
||||
SERIALIZE(first_column) &&
|
||||
SERIALIZE(last_column)) )
|
||||
return false;
|
||||
|
||||
info->s->WriteCloseTag("Location");
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Location::DoUnserialize(UnserialInfo* info)
|
||||
{
|
||||
DO_UNSERIALIZE(SerialObj);
|
||||
|
||||
delete_data = true;
|
||||
|
||||
return UNSERIALIZE_STR(&filename, 0)
|
||||
&& UNSERIALIZE(&first_line)
|
||||
&& UNSERIALIZE(&last_line)
|
||||
&& UNSERIALIZE(&first_column)
|
||||
&& UNSERIALIZE(&last_column);
|
||||
}
|
||||
|
||||
void Location::Describe(ODesc* d) const
|
||||
{
|
||||
if ( filename )
|
||||
|
@ -228,29 +186,6 @@ void BroObj::PinPoint(ODesc* d, const BroObj* obj2, int pinpoint_only) const
|
|||
d->Add(")");
|
||||
}
|
||||
|
||||
bool BroObj::DoSerialize(SerialInfo* info) const
|
||||
{
|
||||
DO_SERIALIZE(SER_BRO_OBJ, SerialObj);
|
||||
|
||||
info->s->WriteOpenTag("Object");
|
||||
|
||||
Location* loc = info->include_locations ? location : 0;
|
||||
SERIALIZE_OPTIONAL(loc);
|
||||
info->s->WriteCloseTag("Object");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool BroObj::DoUnserialize(UnserialInfo* info)
|
||||
{
|
||||
DO_UNSERIALIZE(SerialObj);
|
||||
|
||||
delete location;
|
||||
|
||||
UNSERIALIZE_OPTIONAL(location, Location::Unserialize(info));
|
||||
return true;
|
||||
}
|
||||
|
||||
void print(const BroObj* obj)
|
||||
{
|
||||
static BroFile fstderr(stderr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue