fixed a serious potential bug with swapping plugins to debug mode, leaving stale function pointers without plugin removal
2 * ===============================================================
3 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
4 * ===============================================================
6 * This file is not open source and may not be copied without explicit
7 * written permission of AlliedModders LLC. This file may not be redistributed
8 * in whole or significant part.
9 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
14 #ifndef _INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_
15 #define _INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_
18 * This file parses plugin_settings.cfg and stores the information in cached memory.
19 * It provides simplistic abstraction to retrieving the info.
20 * :TODO: currently untested
23 #include "sm_memtable.h"
24 #include "ITextParsers.h"
25 #include "IPluginSys.h"
26 #include "sm_globals.h"
45 class CPluginInfoDatabase : public ITextListener_SMC
48 CPluginInfoDatabase();
49 ~CPluginInfoDatabase();
50 public: //ITextListener_SMC
51 void ReadSMC_ParseStart();
52 SMCParseResult ReadSMC_NewSection(const char *name, bool opt_quotes);
53 SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
54 SMCParseResult ReadSMC_LeavingSection();
57 * Returns the number of plugin settings available.
59 unsigned int GetSettingsNum();
62 * Given an index, returns the plugin settings block if the filename matches.
63 * Otherwise, returns NULL.
65 PluginSettings *GetSettingsIfMatch(unsigned int index, const char *filename);
68 * Given a plugin settings struct and an index,
69 * returns the given JIT key/value option pair at that index.
70 * If the input is invalid, key and val will be set to NULL.
72 void GetOptionsForPlugin(PluginSettings *settings, unsigned int opt_num, const char **key, const char **val);
74 SMCParseResult MakeError(const char *fmt, ...);
76 BaseStringTable *m_strtab;
81 size_t m_infodb_count;
87 #endif //_INCLUDE_SOURCEMOD_CORE_SYSTEM_PLUGININFODATABASE_H_