bifcl: Move BuiltinFunc to zeek namespace

This commit is contained in:
Tim Wojtulewicz 2020-06-22 15:46:52 -07:00
parent 13dac12521
commit ff7b41ff12

View file

@ -621,7 +621,7 @@ head_1: TOK_ID opt_ws arg_begin
if ( definition_type == FUNC_DEF ) if ( definition_type == FUNC_DEF )
{ {
fprintf(fp_func_init, fprintf(fp_func_init,
"\t(void) new BuiltinFunc(zeek::%s_bif, \"%s\", 0);\n", "\t(void) new zeek::detail::BuiltinFunc(zeek::%s_bif, \"%s\", 0);\n",
decl.c_fullname.c_str(), decl.bro_fullname.c_str()); decl.c_fullname.c_str(), decl.bro_fullname.c_str());
// This is the "canonical" version, with argument type and order // This is the "canonical" version, with argument type and order
@ -631,20 +631,20 @@ head_1: TOK_ID opt_ws arg_begin
// (e.g. ones at global scope that may be used to implement // (e.g. ones at global scope that may be used to implement
// the BIF itself). // the BIF itself).
fprintf(fp_func_h, fprintf(fp_func_h,
"namespace zeek { %sextern BifReturnVal %s_bif(zeek::detail::Frame* frame, const zeek::Args*);%s }\n", "namespace zeek { %sextern BifReturnVal %s_bif(::zeek::detail::Frame* frame, const ::zeek::Args*);%s }\n",
decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str()); decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str());
// This is the deprecated, legacy, version of the BIF that // This is the deprecated, legacy, version of the BIF that
// forwards to the "canonical" version. It also does have // forwards to the "canonical" version. It also does have
// a "bro_" prefix in the name itself, but no "_bif" suffix. // a "bro_" prefix in the name itself, but no "_bif" suffix.
fprintf(fp_func_h, fprintf(fp_func_h,
"%s [[deprecated(\"Remove in v4.1. Use zeek::%s_bif.\")]] inline BifReturnVal bro_%s(zeek::detail::Frame* frame, const zeek::Args* args)", "%s [[deprecated(\"Remove in v4.1. Use zeek::%s_bif.\")]] inline BifReturnVal bro_%s(::zeek::detail::Frame* frame, const ::zeek::Args* args)",
decl.c_namespace_start.c_str(), decl.c_fullname.c_str(), decl.bare_name.c_str()); decl.c_namespace_start.c_str(), decl.c_fullname.c_str(), decl.bare_name.c_str());
fprintf(fp_func_h, " { return zeek::%s_bif(frame, args); } %s\n", fprintf(fp_func_h, " { return zeek::%s_bif(frame, args); } %s\n",
decl.c_fullname.c_str(), decl.c_namespace_end.c_str()); decl.c_fullname.c_str(), decl.c_namespace_end.c_str());
fprintf(fp_func_def, fprintf(fp_func_def,
"BifReturnVal zeek::%s_bif(zeek::detail::Frame* frame, const zeek::Args* %s)", "BifReturnVal zeek::%s_bif(::zeek::detail::Frame* frame, const ::zeek::Args* %s)",
decl.c_fullname.c_str(), arg_list_name); decl.c_fullname.c_str(), arg_list_name);
record_bif_item(decl.bro_fullname.c_str(), "FUNCTION"); record_bif_item(decl.bro_fullname.c_str(), "FUNCTION");