mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Allow default function/hook/event parameters. Addresses #972.
And changed the endianness parameter of bytestring_to_count() BIF to default to false (big endian), mostly just to prove that the BIF parser doesn't choke on default parameters.
This commit is contained in:
parent
69c7363147
commit
e2a1d4a233
14 changed files with 239 additions and 28 deletions
|
@ -30,11 +30,13 @@ BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, int arg_type)
|
|||
type_str = "";
|
||||
}
|
||||
|
||||
BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str)
|
||||
BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str,
|
||||
const char* arg_attr_str)
|
||||
{
|
||||
name = arg_name;
|
||||
type = TYPE_OTHER;
|
||||
type_str = arg_type_str;
|
||||
attr_str = arg_attr_str;
|
||||
|
||||
for ( int i = 0; builtin_func_arg_type[i].bif_type[0] != '\0'; ++i )
|
||||
if ( ! strcmp(builtin_func_arg_type[i].bif_type, arg_type_str) )
|
||||
|
@ -46,7 +48,8 @@ BuiltinFuncArg::BuiltinFuncArg(const char* arg_name, const char* arg_type_str)
|
|||
|
||||
void BuiltinFuncArg::PrintBro(FILE* fp)
|
||||
{
|
||||
fprintf(fp, "%s: %s%s", name, builtin_func_arg_type[type].bro_type, type_str);
|
||||
fprintf(fp, "%s: %s%s %s", name, builtin_func_arg_type[type].bro_type,
|
||||
type_str, attr_str);
|
||||
}
|
||||
|
||||
void BuiltinFuncArg::PrintCDef(FILE* fp, int n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue