1 #ifndef _INCLUDE_SOURCEMOD_SYSTEM_LIBRARY_H_
2 #define _INCLUDE_SOURCEMOD_SYSTEM_LIBRARY_H_
4 #include <ILibrarySys.h>
5 #include "sm_platform.h"
7 using namespace SourceMod;
9 #if defined PLATFORM_WINDOWS
10 typedef HMODULE LibraryHandle;
11 #else if defined PLATFORM_POSIX
12 typedef void * LibraryHandle;
15 class CDirectory : public IDirectory
18 CDirectory(const char *path);
21 virtual bool MoreFiles();
22 virtual void NextEntry();
23 virtual const char *GetEntryName();
24 virtual bool IsEntryDirectory();
25 virtual bool IsEntryFile();
29 #if defined PLATFORM_WINDOWS
31 WIN32_FIND_DATAA m_fd;
32 #else if defined PLATFORM_LINUX
35 char m_origpath[PLATFORM_MAX_PATH];
39 class CLibrary : public ILibrary
42 CLibrary(LibraryHandle me);
45 virtual void CloseLibrary();
46 virtual void *GetSymbolAddress(const char *symname);
51 class LibrarySystem : public ILibrarySys
54 virtual ILibrary *OpenLibrary(const char *path, char *error, size_t err_max);
55 virtual IDirectory *OpenDirectory(const char *path);
56 virtual void CloseDirectory(IDirectory *dir);
57 virtual bool PathExists(const char *path);
58 virtual bool IsPathFile(const char *path);
59 virtual bool IsPathDirectory(const char *path);
60 virtual void GetPlatformError(char *error, size_t err_max);
63 extern LibrarySystem g_LibSys;
65 #endif //_INCLUDE_SOURCEMOD_SYSTEM_LIBRARY_H_