|
@@ -36,14 +36,12 @@ ScriptInfo::~ScriptInfo()
|
|
|
free(this->name);
|
|
|
free(this->short_name);
|
|
|
free(this->description);
|
|
|
free(this->date);
|
|
|
free(this->instance_name);
|
|
|
free(this->url);
|
|
|
free(this->main_script);
|
|
|
free(this->tar_file);
|
|
|
free(this->SQ_instance);
|
|
|
}
|
|
|
|
|
|
bool ScriptInfo::CheckMethod(const char *name) const
|
|
|
{
|
|
|
if (!this->engine->MethodExists(*this->SQ_instance, name)) {
|
|
@@ -78,15 +76,14 @@ bool ScriptInfo::CheckMethod(const char
|
|
|
};
|
|
|
for (size_t i = 0; i < lengthof(required_functions); i++) {
|
|
|
if (!info->CheckMethod(required_functions[i])) return SQ_ERROR;
|
|
|
}
|
|
|
|
|
|
/* Get location information of the scanner */
|
|
|
info->main_script = stredup(info->scanner->GetMainScript());
|
|
|
const char *tar_name = info->scanner->GetTarFile();
|
|
|
if (tar_name != nullptr) info->tar_file = stredup(tar_name);
|
|
|
info->main_script = info->scanner->GetMainScript();
|
|
|
info->tar_file = info->scanner->GetTarFile();
|
|
|
|
|
|
/* Cache the data the info file gives us. */
|
|
|
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetAuthor", &info->author, MAX_GET_OPS)) return SQ_ERROR;
|
|
|
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetName", &info->name, MAX_GET_OPS)) return SQ_ERROR;
|
|
|
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetShortName", &info->short_name, MAX_GET_OPS)) return SQ_ERROR;
|
|
|
if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetDescription", &info->description, MAX_GET_OPS)) return SQ_ERROR;
|