/* AMX Mod X * * by the AMX Mod X Development Team * originally developed by OLO * * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */ #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 *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