patterns: Disallow calling of dangerous functions by default

Closes #330
This commit is contained in:
WerWolv
2021-12-19 12:32:15 +01:00
parent 0efb226c2f
commit 376cb01a16
13 changed files with 128 additions and 25 deletions

View File

@@ -94,9 +94,10 @@ namespace hex {
struct Function {
u32 parameterCount;
Callback func;
bool dangerous;
};
void add(const Namespace &ns, const std::string &name, u32 parameterCount, const Callback &func);
void add(const Namespace &ns, const std::string &name, u32 parameterCount, const Callback &func, bool dangerous = false);
std::map<std::string, ContentRegistry::PatternLanguageFunctions::Function>& getEntries();
}