// vim: set ts=4 sw=4 tw=99 noet: // // AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). // Copyright (C) The AMX Mod X Development Team. // // This software is licensed under the GNU General Public License, version 3 or higher. // Additional exceptions apply. For full license details, see LICENSE.txt or visit: // https://alliedmods.net/amxmodx-license #include "amxmodx.h" #include "libraries.h" #ifndef FAR #define FAR #endif // New typedef void* (*PFN_REQ_FNPTR)(const char * /*name*/); typedef int (FAR *QUERYMOD_NEW)(int * /*ifvers*/, amxx_module_info_s * /*modInfo*/); typedef int (FAR *CHECKGAME_NEW)(const char *); typedef int (FAR *ATTACHMOD_NEW)(PFN_REQ_FNPTR /*reqFnptrFunc*/); typedef int (FAR *DETACHMOD_NEW)(void); typedef void (FAR *PLUGINSLOADED_NEW)(void); typedef void (*PLUGINSUNLOADED_NEW)(void); typedef void (*PLUGINSUNLOADING_NEW)(void); // ***************************************************** // class CModule // ***************************************************** CModule::CModule(const char* fname) { m_Filename.assign(fname); clear(false); } CModule::~CModule() { // old & new if (m_Handle) DLFREE(m_Handle); clear(); } void CModule::clear(bool clearFilename) { // old & new m_Metamod = false; m_Handle = NULL; m_Status = MODULE_NONE; if (clearFilename) m_Filename.assign("unknown"); // new m_Amxx = false; m_InfoNew.author = "unknown"; m_InfoNew.name = "unknown"; m_InfoNew.version = "unknown"; m_InfoNew.reload = 0; m_MissingFunc = NULL; for (size_t i=0; i newlist; for (size_t j=0; curlist[j].func != NULL; j++) { found = false; for (size_t k=0; list[k].func != NULL; k++) { if (strcmp(curlist[j].name, list[k].name) == 0) { found = true; break; } } if (found) { changed = true; //don't break, we have to search it all } else { newlist.push_back(j); } } if (changed) { //now build the new list AMX_NATIVE_INFO *rlist = new AMX_NATIVE_INFO[newlist.size()+1]; for (size_t j=0; j