mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 11:08:20 +00:00
[Spicy] Clean up representation of EVT record fields.
This commit is contained in:
parent
cdadd934ce
commit
36a6770e98
5 changed files with 41 additions and 18 deletions
|
@ -151,9 +151,17 @@ extern TypePtr create_enum_type(
|
|||
const std::string& ns, const std::string& id,
|
||||
const hilti::rt::Vector<std::tuple<std::string, hilti::rt::integer::safe<int64_t>>>& labels);
|
||||
|
||||
using RecordField = std::tuple<std::string, TypePtr, hilti::rt::Bool, hilti::rt::Bool>; // (ID, type, optional, &log)
|
||||
struct RecordField {
|
||||
std::string id; /**< name of record field */
|
||||
TypePtr type; /**< Spicy-side type object */
|
||||
bool is_optional; /**< true if field is optional */
|
||||
bool is_log; /**< true if field has `&log` */
|
||||
};
|
||||
|
||||
extern TypePtr create_record_type(const std::string& ns, const std::string& id,
|
||||
const hilti::rt::Vector<RecordField>& fields);
|
||||
extern RecordField create_record_field(const std::string& id, const TypePtr& type, hilti::rt::Bool is_optional,
|
||||
hilti::rt::Bool is_log);
|
||||
|
||||
extern TypePtr create_table_type(TypePtr key, std::optional<TypePtr> value);
|
||||
extern TypePtr create_vector_type(const TypePtr& elem);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue