zeek/src/module_util.h
Max Kellermann 0548e1255f module_util: make GLOBAL_MODULE_NAME constexpr
This allows the compiler to hard-code pointers to the string without
looking up a global variable at runtime.
2020-02-07 10:56:14 +01:00

17 lines
556 B
C++

//
// These functions are used by both Bro and bifcl.
//
#pragma once
#include <string>
static constexpr const char* GLOBAL_MODULE_NAME = "GLOBAL";
extern std::string extract_module_name(const char* name);
extern std::string extract_var_name(const char* name);
extern std::string normalized_module_name(const char* module_name); // w/o ::
// Concatenates module_name::var_name unless var_name is already fully
// qualified, in which case it is returned unmodified.
extern std::string make_full_var_name(const char* module_name, const char* var_name);