bifcl: Renaming/scoping of lookup functions

This commit is contained in:
Jon Siwek 2020-05-12 18:08:23 -07:00 committed by Tim Wojtulewicz
parent 53d6f6665e
commit 59e86c6ea0

View file

@ -387,7 +387,7 @@ type_def: TOK_TYPE opt_ws TOK_ID opt_ws ':' opt_ws type_def_types opt_ws ';'
decl.c_namespace_start.c_str(), type_name.c_str(),
decl.bare_name.c_str(), decl.c_namespace_end.c_str());
fprintf(fp_netvar_init,
"\t%s = zeek::lookup_type(\"%s\")->As%sType();\n",
"\t%s = zeek::id::lookup_type(\"%s\")->As%sType();\n",
decl.c_fullname.c_str(), decl.bro_fullname.c_str(),
type_name.c_str());
@ -447,7 +447,7 @@ enum_def: enum_def_1 enum_list TOK_RPB opt_attr_list
fprintf(fp_netvar_def, "%s EnumType * %s; %s\n",
decl.c_namespace_start.c_str(), decl.bare_name.c_str(), decl.c_namespace_end.c_str());
fprintf(fp_netvar_init,
"\t%s = zeek::lookup_type(\"%s\")->AsEnumType();\n",
"\t%s = zeek::id::lookup_type(\"%s\")->AsEnumType();\n",
decl.c_fullname.c_str(), decl.bro_fullname.c_str());
record_bif_item(decl.bro_fullname.c_str(), "TYPE");
@ -502,7 +502,7 @@ const_def: TOK_CONST opt_ws TOK_ID opt_ws ':' opt_ws TOK_ID opt_ws ';'
decl.c_namespace_start.c_str(),
builtin_types[typeidx].c_type, decl.bare_name.c_str(),
decl.c_namespace_end.c_str());
fprintf(fp_netvar_init, "\t%s = zeek::lookup_const(\"%s\").get()%s;\n",
fprintf(fp_netvar_init, "\t%s = zeek::id::lookup_const(\"%s\").get()%s;\n",
decl.c_fullname.c_str(), decl.bro_fullname.c_str(),
accessor);