Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
3 * ================================================================
5 * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
6 * ================================================================
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License,
10 * version 3.0, as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * As a special exception, AlliedModders LLC gives you permission to
21 * link the code of this program (as well as its derivative works) to
22 * "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
23 * Game MODs that run on software by the Valve Corporation. You must
24 * obey the GNU General Public License in all respects for all other
25 * code used. Additionally, AlliedModders LLC grants this exception
26 * to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version
28 * JULY-31-2007), or <http://www.sourcemod.net/license.php>.
33 #ifndef _INCLUDE_SOURCEMOD_LIBRARY_INTERFACE_SYS_H_
34 #define _INCLUDE_SOURCEMOD_LIBRARY_INTERFACE_SYS_H_
38 * @brief Defines platform-dependent operations, such as opening libraries and files.
41 #include <IShareSys.h>
45 #define SMINTERFACE_LIBRARYSYS_NAME "ILibrarySys"
46 #define SMINTERFACE_LIBRARYSYS_VERSION 3
51 /** Virtual destructor (calls CloseLibrary) */
57 * @brief Closes dynamic library and invalidates pointer.
59 virtual void CloseLibrary() =0;
62 * @brief Retrieves a symbol pointer from the dynamic library.
64 * @param symname Symbol name.
65 * @return Symbol pointer, NULL if not found.
67 virtual void *GetSymbolAddress(const char *symname) =0;
71 * @brief Directory browsing abstraction.
76 /** Virtual destructor */
82 * @brief Returns true if there are more files to read, false otherwise.
84 virtual bool MoreFiles() =0;
87 * @brief Advances to the next entry in the stream.
89 virtual void NextEntry() =0;
92 * @brief Returns the name of the current entry.
94 virtual const char *GetEntryName() =0;
97 * @brief Returns whether the current entry is a directory.
99 virtual bool IsEntryDirectory() =0;
102 * @brief Returns whether the current entry is a file.
104 virtual bool IsEntryFile() =0;
107 * @brief Returns true if the current entry is valid
108 * (Used similarly to MoreFiles).
110 virtual bool IsEntryValid() =0;
114 * @brief Contains various operating system specific code.
116 class ILibrarySys : public SMInterface
119 virtual const char *GetInterfaceName()
121 return SMINTERFACE_LIBRARYSYS_NAME;
123 virtual unsigned int GetInterfaceVersion()
125 return SMINTERFACE_LIBRARYSYS_VERSION;
129 * @brief Opens a dynamic library file.
131 * @param path Path to library file (.dll/.so).
132 * @param error Buffer for any error message (may be NULL).
133 * @param maxlength Maximum length of error buffer.
134 * @return Pointer to an ILibrary, NULL if failed.
136 virtual ILibrary *OpenLibrary(const char *path, char *error, size_t maxlength) =0;
139 * @brief Opens a directory for reading.
141 * @param path Path to directory.
142 * @return Pointer to an IDirectory, NULL if failed.
144 virtual IDirectory *OpenDirectory(const char *path) =0;
147 * @brief Closes a directory and frees its handle.
149 * @param dir Pointer to IDirectory.
151 virtual void CloseDirectory(IDirectory *dir) =0;
154 * @brief Returns true if a path exists.
156 virtual bool PathExists(const char *path) =0;
159 * @brief Returns true if the path is a normal file.
161 virtual bool IsPathFile(const char *path) =0;
164 * @brief Returns true if the path is a normal directory.
166 virtual bool IsPathDirectory(const char *path) =0;
169 * @brief Gets a platform-specific error message.
170 * This should only be called when an ILibrary function fails.
171 * Win32 equivalent: GetLastError() + FormatMessage()
172 * POSIX equivalent: errno + strerror()
174 * @param error Error message buffer.
175 * @param maxlength Maximum length of error buffer.
177 virtual void GetPlatformError(char *error, size_t maxlength) =0;
180 * @brief Formats a string similar to snprintf(), except
181 * corrects all non-platform compatible path separators to be
182 * the correct platform character.
184 * @param buffer Output buffer pointer.
185 * @param maxlength Output buffer size.
186 * @param pathfmt Format string of path.
187 * @param ... Format string arguments.
189 virtual size_t PathFormat(char *buffer, size_t maxlength, const char *pathfmt, ...) =0;
192 * @brief Returns a pointer to the extension in a filename.
194 * @param filename Name of file from which the extension should be extracted.
195 * @return Pointer to file extension.
197 virtual const char *GetFileExtension(const char *filename) =0;
200 * @brief Creates a directory.
202 * @param path Full, absolute path of the directory to create.
203 * @return True on success, false otherwise.
205 virtual bool CreateFolder(const char *path) =0;
209 #endif //_INCLUDE_SOURCEMOD_LIBRARY_INTERFACE_SYS_H_