Reformat the world

This commit is contained in:
Tim Wojtulewicz 2021-09-16 15:35:39 -07:00
parent 194cb24547
commit b2f171ec69
714 changed files with 35149 additions and 35203 deletions

View file

@ -7,11 +7,13 @@
#include "zeek/Val.h"
#include "zeek/script_opt/CPP/Func.h"
namespace zeek {
namespace zeek
{
using SubNetValPtr = IntrusivePtr<zeek::SubNetVal>;
namespace detail {
namespace detail
{
// Returns the concatenation of the given strings.
extern StringValPtr str_concat__CPP(const String* s1, const String* s2);
@ -108,8 +110,7 @@ inline TableValPtr table_coerce__CPP(const ValPtr& v, const TypePtr& t)
if ( tv->Size() > 0 )
reporter->CPPRuntimeError("coercion of non-empty table/set");
return make_intrusive<TableVal>(cast_intrusive<TableType>(t),
tv->GetAttrs());
return make_intrusive<TableVal>(cast_intrusive<TableType>(t), tv->GetAttrs());
}
// The same, for an empty record.
@ -125,34 +126,27 @@ inline VectorValPtr vector_coerce__CPP(const ValPtr& v, const TypePtr& t)
// Constructs a set of the given type, containing the given elements, and
// with the associated attributes.
extern TableValPtr set_constructor__CPP(std::vector<ValPtr> elements,
TableTypePtr t,
std::vector<int> attr_tags,
std::vector<ValPtr> attr_vals);
extern TableValPtr set_constructor__CPP(std::vector<ValPtr> elements, TableTypePtr t,
std::vector<int> attr_tags, std::vector<ValPtr> attr_vals);
// Constructs a table of the given type, containing the given elements
// (specified as parallel index/value vectors), and with the associated
// attributes.
extern TableValPtr table_constructor__CPP(std::vector<ValPtr> indices,
std::vector<ValPtr> vals,
TableTypePtr t,
std::vector<int> attr_tags,
extern TableValPtr table_constructor__CPP(std::vector<ValPtr> indices, std::vector<ValPtr> vals,
TableTypePtr t, std::vector<int> attr_tags,
std::vector<ValPtr> attr_vals);
// Constructs a record of the given type, whose (ordered) fields are
// assigned to the corresponding elements of the given vector of values.
extern RecordValPtr record_constructor__CPP(std::vector<ValPtr> vals,
RecordTypePtr t);
extern RecordValPtr record_constructor__CPP(std::vector<ValPtr> vals, RecordTypePtr t);
// Constructs a vector of the given type, populated with the given values.
extern VectorValPtr vector_constructor__CPP(std::vector<ValPtr> vals,
VectorTypePtr t);
extern VectorValPtr vector_constructor__CPP(std::vector<ValPtr> vals, VectorTypePtr t);
// Schedules an event to occur at the given absolute time, parameterized
// with the given set of values. A separate function to facilitate avoiding
// the scheduling if Zeek is terminating.
extern ValPtr schedule__CPP(double dt, EventHandlerPtr event,
std::vector<ValPtr> args);
extern ValPtr schedule__CPP(double dt, EventHandlerPtr event, std::vector<ValPtr> args);
// Simple helper functions for supporting absolute value.
inline bro_uint_t iabs__CPP(bro_int_t v)
@ -202,5 +196,5 @@ inline double fdiv__CPP(double v1, double v2)
return v1 / v2;
}
} // namespace zeek::detail
} // namespace zeek
} // namespace zeek::detail
} // namespace zeek