|
|
@ -1,4 +1,5 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PhysFS
|
|
|
|
namespace PhysFS
|
|
|
@ -61,266 +62,166 @@ namespace PhysFS
|
|
|
|
public FreeDelegate Free;
|
|
|
|
public FreeDelegate Free;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class DynamicLoader
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
#region Windows
|
|
|
|
|
|
|
|
[DllImport("kernel32.dll", SetLastError = true)]
|
|
|
|
|
|
|
|
public static extern IntPtr LoadLibrary(string lpFileName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
|
|
|
|
|
|
|
|
public static extern IntPtr GetProcAddress(IntPtr hModule, string procName);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, ExactSpelling = true, SetLastError = true)]
|
|
|
|
|
|
|
|
public static extern bool FreeLibrary(IntPtr hModule);
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Unix
|
|
|
|
|
|
|
|
[DllImport("libdl.so")]
|
|
|
|
|
|
|
|
public static extern IntPtr dlopen(string filename, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("libdl.so")]
|
|
|
|
|
|
|
|
public static extern IntPtr dlsym(IntPtr handle, string symbol);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport("libdl.so")]
|
|
|
|
|
|
|
|
public static extern bool dlclose(IntPtr handle);
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static class Interop
|
|
|
|
static class Interop
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const string DLL_NAME = "physfs.dll";
|
|
|
|
public static bool init = false;
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern void PHYSFS_getLinkedVersion(ref Version ver);
|
|
|
|
public delegate void FnGetLinkedVersion(ref Version v);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate int FnInit(string argv0);
|
|
|
|
public static extern int PHYSFS_init(string argv0);
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate int FnDeinit();
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern int PHYSFS_deinit();
|
|
|
|
public delegate int FnClose(IntPtr ptr);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate IntPtr FnSupportedArchiveTypes();
|
|
|
|
public static extern IntPtr PHYSFS_supportedArchiveTypes();
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate void FnFreeList(IntPtr h);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern void PHYSFS_freeList(IntPtr listVar);
|
|
|
|
public delegate IntPtr FnGetLastError();
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate string FnGetDirSeparator();
|
|
|
|
public static extern IntPtr PHYSFS_getLastError();
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate void FnPermitSymbolicLinks(int permit);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern string PHYSFS_getDirSeparator();
|
|
|
|
public delegate int FnSetWriteDir(string s);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate int FnAddToSearchPath(string s, int i);
|
|
|
|
public static extern void PHYSFS_permitSymbolicLinks(int allow);
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate int FnSetSaneConfig(string s1, string s2, string s3, int i1, int i2);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static unsafe extern IntPtr PHYSFS_getCdRomDirs();
|
|
|
|
public delegate string FnGetRealDir(string s);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate IntPtr FnEnumerateFiles(string s);
|
|
|
|
public static extern string PHYSFS_getBaseDir();
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate long FnGetLastModTime(string s);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern string PHYSFS_getUserDir();
|
|
|
|
public delegate long FnRead(IntPtr ptr1, IntPtr ptr2, uint i1, uint i2);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate long FnTell(IntPtr ptr);
|
|
|
|
public static extern string PHYSFS_getWriteDir();
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate int FnSeek(IntPtr ptr, ulong u);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern int PHYSFS_setWriteDir(string newDir);
|
|
|
|
public delegate long FnFileLength(IntPtr ptr);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate int FnSetAllocator(Allocator alloc);
|
|
|
|
public static extern int PHYSFS_addToSearchPath(string newDir, int appendToPath);
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public delegate int FnMount(string s1, string s2, int i);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
public static extern int PHYSFS_removeFromSearchPath(string oldDir);
|
|
|
|
public delegate void FnGetCdRomDirsCallback(StringCallback c, IntPtr ptr);
|
|
|
|
|
|
|
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public delegate void FnEnumerateFilesCallback(string s, EnumFilesCallback c, IntPtr ptr);
|
|
|
|
public static unsafe extern IntPtr PHYSFS_getSearchPath();
|
|
|
|
|
|
|
|
|
|
|
|
public static FnGetLinkedVersion PHYSFS_getLinkedVersion;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnInit PHYSFS_init;
|
|
|
|
public static extern int PHYSFS_setSaneConfig(string organization, string appName, string archiveExt, int includeCdRoms, int archivesFirst);
|
|
|
|
public static FnDeinit PHYSFS_deinit;
|
|
|
|
|
|
|
|
public static FnSupportedArchiveTypes PHYSFS_supportedArchiveTypes;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnFreeList PHYSFS_freeList;
|
|
|
|
public static extern int PHYSFS_mkdir(string dirName);
|
|
|
|
public static FnGetLastError PHYSFS_getLastError;
|
|
|
|
|
|
|
|
public static FnGetDirSeparator PHYSFS_getDirSeparator;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnPermitSymbolicLinks PHYSFS_permitSymbolicLinks;
|
|
|
|
public static extern int PHYSFS_delete(string filename);
|
|
|
|
public static FnSupportedArchiveTypes PHYSFS_getCdRomDirs;
|
|
|
|
|
|
|
|
public static FnGetDirSeparator PHYSFS_getBaseDir;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnGetDirSeparator PHYSFS_getUserDir;
|
|
|
|
public static extern string PHYSFS_getRealDir(string filename);
|
|
|
|
public static FnGetDirSeparator PHYSFS_getWriteDir;
|
|
|
|
|
|
|
|
public static FnSetWriteDir PHYSFS_setWriteDir;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnAddToSearchPath PHYSFS_addToSearchPath;
|
|
|
|
public static unsafe extern IntPtr PHYSFS_enumerateFiles(string dir);
|
|
|
|
public static FnSetWriteDir PHYSFS_removeFromSearchPath;
|
|
|
|
|
|
|
|
public static FnSupportedArchiveTypes PHYSFS_getSearchPath;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnSetSaneConfig PHYSFS_setSaneConfig;
|
|
|
|
public static extern int PHYSFS_exists(string fname);
|
|
|
|
public static FnSetWriteDir PHYSFS_mkdir;
|
|
|
|
|
|
|
|
public static FnSetWriteDir PHYSFS_delete;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnGetRealDir PHYSFS_getRealDir;
|
|
|
|
public static extern int PHYSFS_isDirectory(string fname);
|
|
|
|
public static FnEnumerateFiles PHYSFS_enumerateFiles;
|
|
|
|
|
|
|
|
public static FnSetWriteDir PHYSFS_exists;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnSetWriteDir PHYSFS_isDirectory;
|
|
|
|
public static extern int PHYSFS_isSymbolicLink(string fname);
|
|
|
|
public static FnSetWriteDir PHYSFS_isSymbolicLink;
|
|
|
|
|
|
|
|
public static FnGetLastModTime PHYSFS_getLastModTime;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnEnumerateFiles PHYSFS_openWrite;
|
|
|
|
public static extern long PHYSFS_getLastModTime(string filename);
|
|
|
|
public static FnEnumerateFiles PHYSFS_openAppend;
|
|
|
|
|
|
|
|
public static FnEnumerateFiles PHYSFS_openRead;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnClose PHYSFS_close;
|
|
|
|
public static extern IntPtr PHYSFS_openWrite(string filename);
|
|
|
|
public static FnRead PHYSFS_read;
|
|
|
|
|
|
|
|
public static FnRead PHYSFS_write;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnClose PHYSFS_eof;
|
|
|
|
public static extern IntPtr PHYSFS_openAppend(string filename);
|
|
|
|
public static FnTell PHYSFS_tell;
|
|
|
|
|
|
|
|
public static FnSeek PHYSFS_seek;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnFileLength PHYSFS_fileLength;
|
|
|
|
public static extern IntPtr PHYSFS_openRead(string filename);
|
|
|
|
public static FnSeek PHYSFS_setBuffer;
|
|
|
|
|
|
|
|
public static FnClose PHYSFS_flush;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnDeinit PHYSFS_isInit;
|
|
|
|
public static extern int PHYSFS_close(IntPtr handle);
|
|
|
|
public static FnDeinit PHYSFS_symbolicLinksPermitted;
|
|
|
|
|
|
|
|
public static FnSetAllocator PHYSFS_setAllocator;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnMount PHYSFS_mount;
|
|
|
|
public static extern long PHYSFS_read(IntPtr handle, IntPtr buffer, uint objSize, uint objCount);
|
|
|
|
public static FnGetRealDir PHYSFS_getMountPoint;
|
|
|
|
|
|
|
|
public static FnGetCdRomDirsCallback PHYSFS_getCdRomDirsCallback;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static FnGetCdRomDirsCallback PHYSFS_getSearchPathCallback;
|
|
|
|
public static extern long PHYSFS_write(IntPtr handle, IntPtr buffer, uint objSize, uint objCount);
|
|
|
|
public static FnEnumerateFilesCallback PHYSFS_enumerateFilesCallback;
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
public static void SetUpInterop()
|
|
|
|
public static extern int PHYSFS_eof(IntPtr handle);
|
|
|
|
{
|
|
|
|
|
|
|
|
Func<string, IntPtr> loadLibrary;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
Func<IntPtr, string, IntPtr> loadSymbol;
|
|
|
|
public static extern long PHYSFS_tell(IntPtr handle);
|
|
|
|
|
|
|
|
|
|
|
|
IntPtr library;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_seek(IntPtr handle, ulong pos);
|
|
|
|
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
|
|
|
|
|
|
|
{
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
loadLibrary = DynamicLoader.LoadLibrary;
|
|
|
|
public static extern long PHYSFS_fileLength(IntPtr handle);
|
|
|
|
|
|
|
|
|
|
|
|
loadSymbol = DynamicLoader.GetProcAddress;
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_setBuffer(IntPtr handle, ulong bufsize);
|
|
|
|
library = loadLibrary("physfs.dll");
|
|
|
|
|
|
|
|
}
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
else
|
|
|
|
public static extern int PHYSFS_flush(IntPtr handle);
|
|
|
|
{
|
|
|
|
|
|
|
|
loadLibrary = n =>
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
{
|
|
|
|
public static extern short PHYSFS_swapSLE16(short val);
|
|
|
|
return DynamicLoader.dlopen(n, 1);
|
|
|
|
|
|
|
|
};
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern ushort PHYSFS_swapULE16(ushort val);
|
|
|
|
loadSymbol = DynamicLoader.dlsym;
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
library = loadLibrary("physfs.so");
|
|
|
|
public static extern int PHYSFS_swapSLE32(int val);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
var fields = typeof(Interop).GetFields();
|
|
|
|
public static extern uint PHYSFS_swapULE32(uint val);
|
|
|
|
|
|
|
|
|
|
|
|
foreach(var field in fields.Where(x => x.Name.StartsWith("PHYSFS_")))
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
{
|
|
|
|
public static extern long PHYSFS_swapSLE64(long val);
|
|
|
|
var funcPtr = loadSymbol(library, field.Name);
|
|
|
|
|
|
|
|
var del = Marshal.GetDelegateForFunctionPointer(funcPtr, field.FieldType);
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern ulong PHYSFS_swapULE64(ulong val);
|
|
|
|
field.SetValue(null, del);
|
|
|
|
|
|
|
|
}
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern short PHYSFS_swapSBE16(short val);
|
|
|
|
init = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern ushort PHYSFS_swapUBE16(ushort val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_swapSBE32(int val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern uint PHYSFS_swapUBE32(uint val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern long PHYSFS_swapSBE64(long val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern ulong PHYSFS_swapUBE64(ulong val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSLE16(IntPtr file, ref short val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readULE16(IntPtr file, ref ushort val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSBE16(IntPtr file, ref short val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readUBE16(IntPtr file, ref ushort val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSLE32(IntPtr file, ref int val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readULE32(IntPtr file, ref uint val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSBE32(IntPtr file, ref int val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readUBE32(IntPtr file, ref uint val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSLE64(IntPtr file, ref long val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readULE64(IntPtr file, ref ulong val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readSBE64(IntPtr file, ref long val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_readUBE64(IntPtr file, ref ulong val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSLE16(IntPtr file, short val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeULE16(IntPtr file, ushort val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSBE16(IntPtr file, short val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeUBE16(IntPtr file, ushort val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSLE32(IntPtr file, int val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeULE32(IntPtr file, uint val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSBE32(IntPtr file, int val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeUBE32(IntPtr file, uint val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSLE64(IntPtr file, long val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeULE64(IntPtr file, ulong val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeSBE64(IntPtr file, long val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_writeUBE64(IntPtr file, ulong val);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_isInit();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_symbolicLinksPermitted();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_setAllocator(Allocator allocator);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern int PHYSFS_mount(string newDir, string mountPoint, int appendToPath);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern string PHYSFS_getMountPoint(string dir);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern void PHYSFS_getCdRomDirsCallback(StringCallback c, IntPtr d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern void PHYSFS_getSearchPathCallback(StringCallback c, IntPtr d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static extern void PHYSFS_enumerateFilesCallback(string dir, EnumFilesCallback c, IntPtr d);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static unsafe extern void PHYSFS_utf8FromUcs4(uint* src, char* dst, ulong len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static unsafe extern void PHYSFS_utf8ToUcs4(string src, uint* dst, ulong len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static unsafe extern void PHYSFS_utf8FromUcs2(ushort* src, char* dst, ulong len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static unsafe extern void PHYSFS_utf8ToUcs2(string src, ushort* dst, ulong len);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[DllImport(DLL_NAME, CallingConvention = CallingConvention.Cdecl)]
|
|
|
|
|
|
|
|
public static unsafe extern void PHYSFS_utf8FromLatin1(string src, char* dst, ulong len);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|