\section{physfs.\+h File Reference}
\label{physfs_8h}\index{physfs.\+h@{physfs.\+h}}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+File}
\begin{DoxyCompactList}\small\item\em A Physics\+F\+S file handle. \end{DoxyCompactList}\item 
struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info}
\begin{DoxyCompactList}\small\item\em Information on various Physics\+F\+S-\/supported archives. \end{DoxyCompactList}\item 
struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Version}
\begin{DoxyCompactList}\small\item\em Information the version of Physics\+F\+S in use. \end{DoxyCompactList}\item 
struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Allocator}
\begin{DoxyCompactList}\small\item\em Physics\+F\+S allocation function pointers. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf P\+H\+Y\+S\+F\+S\+\_\+file}~{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File}
\begin{DoxyCompactList}\small\item\em 1.\+0 A\+P\+I compatibility define. \end{DoxyCompactList}\item 
\#define {\bf P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N}(x)
\begin{DoxyCompactList}\small\item\em Macro to determine Physics\+F\+S version program was compiled against. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef unsigned char {\bf P\+H\+Y\+S\+F\+S\+\_\+uint8}\label{physfs_8h_abb348466106a912e03cf63f494a30356}

\begin{DoxyCompactList}\small\item\em An unsigned, 8-\/bit integer type. \end{DoxyCompactList}\item 
typedef signed char {\bf P\+H\+Y\+S\+F\+S\+\_\+sint8}\label{physfs_8h_a76505754bb5c7f8f5e964e1a4d1a2571}

\begin{DoxyCompactList}\small\item\em A signed, 8-\/bit integer type. \end{DoxyCompactList}\item 
typedef unsigned short {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16}\label{physfs_8h_ac4d1c74e276b04ef993530a405553574}

\begin{DoxyCompactList}\small\item\em An unsigned, 16-\/bit integer type. \end{DoxyCompactList}\item 
typedef signed short {\bf P\+H\+Y\+S\+F\+S\+\_\+sint16}\label{physfs_8h_aeed97311e1294c0b42648f99d331e5a0}

\begin{DoxyCompactList}\small\item\em A signed, 16-\/bit integer type. \end{DoxyCompactList}\item 
typedef unsigned int {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}\label{physfs_8h_aae011b45ebd619edb193fe196e1f5f74}

\begin{DoxyCompactList}\small\item\em An unsigned, 32-\/bit integer type. \end{DoxyCompactList}\item 
typedef signed int {\bf P\+H\+Y\+S\+F\+S\+\_\+sint32}\label{physfs_8h_ae0264996863470a315e29d5a740a0f36}

\begin{DoxyCompactList}\small\item\em A signed, 32-\/bit integer type. \end{DoxyCompactList}\item 
typedef unsigned long long {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}
\begin{DoxyCompactList}\small\item\em An unsigned, 64-\/bit integer type. \end{DoxyCompactList}\item 
typedef signed long long {\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}
\begin{DoxyCompactList}\small\item\em A signed, 64-\/bit integer type. \end{DoxyCompactList}\item 
typedef struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} {\bfseries P\+H\+Y\+S\+F\+S\+\_\+\+File}\label{physfs_8h_ac508755db9ce6adc2c77bc7637066439}

\item 
typedef struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info} {\bfseries P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info}\label{physfs_8h_af769bf94ebb564e044a3cfdd47201346}

\item 
typedef struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Version} {\bfseries P\+H\+Y\+S\+F\+S\+\_\+\+Version}\label{physfs_8h_acabe0a2df67a5981d3bf043092dce5c2}

\item 
typedef struct {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Allocator} {\bfseries P\+H\+Y\+S\+F\+S\+\_\+\+Allocator}\label{physfs_8h_a54199cc60c31722974c3072a42371c91}

\item 
typedef void($\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}) (void $\ast$data, const char $\ast$str)
\begin{DoxyCompactList}\small\item\em Function signature for callbacks that report strings. \end{DoxyCompactList}\item 
typedef void($\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}) (void $\ast$data, const char $\ast$origdir, const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Function signature for callbacks that enumerate files. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+Version} $\ast$ver)
\begin{DoxyCompactList}\small\item\em Get the version of Physics\+F\+S that is linked against your program. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+init} (const char $\ast$argv0)
\begin{DoxyCompactList}\small\item\em Initialize the Physics\+F\+S library. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+deinit} (void)
\begin{DoxyCompactList}\small\item\em Deinitialize the Physics\+F\+S library. \end{DoxyCompactList}\item 
const {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info} $\ast$$\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types} (void)
\begin{DoxyCompactList}\small\item\em Get a list of supported archive types. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+free\+List} (void $\ast$list\+Var)
\begin{DoxyCompactList}\small\item\em Deallocate resources of lists returned by Physics\+F\+S. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error} (void)
\begin{DoxyCompactList}\small\item\em Get human-\/readable error information. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator} (void)
\begin{DoxyCompactList}\small\item\em Get platform-\/dependent dir separator string. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links} (int allow)
\begin{DoxyCompactList}\small\item\em Enable or disable following of symbolic links. \end{DoxyCompactList}\item 
char $\ast$$\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs} (void)
\begin{DoxyCompactList}\small\item\em Get an array of paths to available C\+D-\/\+R\+O\+M drives. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir} (void)
\begin{DoxyCompactList}\small\item\em Get the path where the application resides. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir} (void)
\begin{DoxyCompactList}\small\item\em Get the path where user\textquotesingle{}s home directory resides. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir} (void)
\begin{DoxyCompactList}\small\item\em Get path where Physics\+F\+S will allow file writing. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir} (const char $\ast$new\+Dir)
\begin{DoxyCompactList}\small\item\em Tell Physics\+F\+S where it may write files. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path} (const char $\ast$new\+Dir, int append\+To\+Path)
\begin{DoxyCompactList}\small\item\em Add an archive or directory to the search path. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path} (const char $\ast$old\+Dir)
\begin{DoxyCompactList}\small\item\em Remove a directory or archive from the search path. \end{DoxyCompactList}\item 
char $\ast$$\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path} (void)
\begin{DoxyCompactList}\small\item\em Get the current search path. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config} (const char $\ast$organization, const char $\ast$app\+Name, const char $\ast$archive\+Ext, int include\+Cd\+Roms, int archives\+First)
\begin{DoxyCompactList}\small\item\em Set up sane, default paths. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+mkdir} (const char $\ast$dir\+Name)
\begin{DoxyCompactList}\small\item\em Create a directory. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+delete} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Delete a file or directory. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Figure out where in the search path a file resides. \end{DoxyCompactList}\item 
char $\ast$$\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files} (const char $\ast$dir)
\begin{DoxyCompactList}\small\item\em Get a file listing of a search path\textquotesingle{}s directory. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+exists} (const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Determine if a file exists in the search path. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+is\+Directory} (const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Determine if a file in the search path is really a directory. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link} (const char $\ast$fname)
\begin{DoxyCompactList}\small\item\em Determine if a file in the search path is really a symbolic link. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Get the last modification time of a file. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+open\+Write} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Open a file for writing. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+open\+Append} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Open a file for appending. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+open\+Read} (const char $\ast$filename)
\begin{DoxyCompactList}\small\item\em Open a file for reading. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+close} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle)
\begin{DoxyCompactList}\small\item\em Close a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+read} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle, void $\ast$buffer, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} obj\+Size, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} obj\+Count)
\begin{DoxyCompactList}\small\item\em Read data from a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+write} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle, const void $\ast$buffer, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} obj\+Size, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} obj\+Count)
\begin{DoxyCompactList}\small\item\em Write data to a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+eof} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle)
\begin{DoxyCompactList}\small\item\em Check for end-\/of-\/file state on a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+tell} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle)
\begin{DoxyCompactList}\small\item\em Determine current position within a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+seek} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} pos)
\begin{DoxyCompactList}\small\item\em Seek to a new position within a Physics\+F\+S filehandle. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+file\+Length} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle)
\begin{DoxyCompactList}\small\item\em Get total length of a file in bytes. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} bufsize)
\begin{DoxyCompactList}\small\item\em Set up buffering for a Physics\+F\+S file handle. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+flush} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$handle)
\begin{DoxyCompactList}\small\item\em Flush a buffered Physics\+F\+S file handle. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian signed 16 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian unsigned 16 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian signed 32 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian unsigned 32 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian signed 64 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} val)
\begin{DoxyCompactList}\small\item\em Swap littleendian unsigned 64 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian signed 16 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian unsigned 16 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian signed 32 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian unsigned 32 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian signed 64 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} {\bf P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} val)
\begin{DoxyCompactList}\small\item\em Swap bigendian unsigned 64 to platform\textquotesingle{}s native byte order. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 16-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 16-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 16-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 16-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 32-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 32-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 32-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 32-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 64-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 64-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert a signed 64-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} $\ast$val)
\begin{DoxyCompactList}\small\item\em Read and convert an unsigned 64-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 16-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 16-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 16-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 16-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 32-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 32-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 32-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 32-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 64-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 64-\/bit littleendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} val)
\begin{DoxyCompactList}\small\item\em Convert and write a signed 64-\/bit bigending value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$file, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} val)
\begin{DoxyCompactList}\small\item\em Convert and write an unsigned 64-\/bit bigendian value. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+is\+Init} (void)
\begin{DoxyCompactList}\small\item\em Determine if the Physics\+F\+S library is initialized. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted} (void)
\begin{DoxyCompactList}\small\item\em Determine if the symbolic links are permitted. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator} (const {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Allocator} $\ast$allocator)
\begin{DoxyCompactList}\small\item\em Hook your own allocation routines into Physics\+F\+S. \end{DoxyCompactList}\item 
int {\bf P\+H\+Y\+S\+F\+S\+\_\+mount} (const char $\ast$new\+Dir, const char $\ast$mount\+Point, int append\+To\+Path)
\begin{DoxyCompactList}\small\item\em Add an archive or directory to the search path. \end{DoxyCompactList}\item 
const char $\ast$ {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point} (const char $\ast$dir)
\begin{DoxyCompactList}\small\item\em Determine a mounted archive\textquotesingle{}s mountpoint. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback} c, void $\ast$d)
\begin{DoxyCompactList}\small\item\em Enumerate C\+D-\/\+R\+O\+M directories, using an application-\/defined callback. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback} ({\bf P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback} c, void $\ast$d)
\begin{DoxyCompactList}\small\item\em Enumerate the search path, using an application-\/defined callback. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback} (const char $\ast$dir, {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback} c, void $\ast$d)
\begin{DoxyCompactList}\small\item\em Get a file listing of a search path\textquotesingle{}s directory, using an application-\/defined callback. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4} (const {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$src, char $\ast$dst, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} len)
\begin{DoxyCompactList}\small\item\em Convert a U\+C\+S-\/4 string to a U\+T\+F-\/8 string. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4} (const char $\ast$src, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$dst, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} len)
\begin{DoxyCompactList}\small\item\em Convert a U\+T\+F-\/8 string to a U\+C\+S-\/4 string. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2} (const {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$src, char $\ast$dst, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} len)
\begin{DoxyCompactList}\small\item\em Convert a U\+C\+S-\/2 string to a U\+T\+F-\/8 string. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2} (const char $\ast$src, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$dst, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} len)
\begin{DoxyCompactList}\small\item\em Convert a U\+T\+F-\/8 string to a U\+C\+S-\/2 string. \end{DoxyCompactList}\item 
void {\bf P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1} (const char $\ast$src, char $\ast$dst, {\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} len)
\begin{DoxyCompactList}\small\item\em Convert a U\+T\+F-\/8 string to a Latin1 string. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Main header file for Physics\+F\+S. 

\subsection{Macro Definition Documentation}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+file@{P\+H\+Y\+S\+F\+S\+\_\+file}}
\index{P\+H\+Y\+S\+F\+S\+\_\+file@{P\+H\+Y\+S\+F\+S\+\_\+file}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+file}]{\setlength{\rightskip}{0pt plus 5cm}\#define P\+H\+Y\+S\+F\+S\+\_\+file~{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File}}\label{physfs_8h_ad32c738a1a111f0d3f29e4637633bfd1}


1.\+0 A\+P\+I compatibility define. 

P\+H\+Y\+S\+F\+S\+\_\+file is identical to \doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+File}{p.}{structPHYSFS__File}. This \#define is here for backwards compatibility with the 1.\+0 A\+P\+I, which had an inconsistent capitalization convention in this case. New code should use \doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+File}{p.}{structPHYSFS__File}, as this \#define may go away someday.

\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+File}{p.}{structPHYSFS__File} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N@{P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N}}
\index{P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N@{P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N(
\begin{DoxyParamCaption}
\item[{}]{x}
\end{DoxyParamCaption}
)}\label{physfs_8h_acb77c1f8f70028add43b9f81eef1ed78}
{\bfseries Value\+:}
\begin{DoxyCode}
\{ \(\backslash\)
    (x)->major = PHYSFS\_VER\_MAJOR; \(\backslash\)
    (x)->minor = PHYSFS\_VER\_MINOR; \(\backslash\)
    (x)->patch = PHYSFS\_VER\_PATCH; \(\backslash\)
\}
\end{DoxyCode}


Macro to determine Physics\+F\+S version program was compiled against. 

This macro fills in a \doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+Version}{p.}{structPHYSFS__Version} structure with the version of the library you compiled against. This is determined by what header the compiler uses. Note that if you dynamically linked the library, you might have a slightly newer or older version at runtime. That version can be determined with \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version()}{p.}{physfs_8h_a8977d0ba0a2301256e823532479f1a05}, which, unlike P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N, is not a macro.


\begin{DoxyParams}{Parameters}
{\em x} & A pointer to a \doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+Version}{p.}{structPHYSFS__Version} struct to initialize.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+Version}{p.}{structPHYSFS__Version} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version}{p.}{physfs_8h_a8977d0ba0a2301256e823532479f1a05} 
\end{DoxySeeAlso}


\subsection{Typedef Documentation}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}}
\index{P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}]{\setlength{\rightskip}{0pt plus 5cm}P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}\label{physfs_8h_a51c1e0145502aeaf080973d308d33c6a}


Function signature for callbacks that enumerate files. 

These are used to report a list of directory entries to an original caller, one file/dir/symlink per callback. All strings are U\+T\+F-\/8 encoded. Functions should not try to modify or free any string\textquotesingle{}s memory.

These callbacks are used, starting in Physics\+F\+S 1.\+1, as an alternative to functions that would return lists that need to be cleaned up with \doxyref{P\+H\+Y\+S\+F\+S\+\_\+free\+List()}{p.}{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05}. The callback means that the library doesn\textquotesingle{}t need to allocate an entire list and all the strings up front.

Be aware that promises data ordering in the list versions are not necessarily so in the callback versions. Check the documentation on specific A\+P\+Is, but strings may not be sorted as you expect.


\begin{DoxyParams}{Parameters}
{\em data} & User-\/defined data pointer, passed through from the A\+P\+I that eventually called the callback. \\
\hline
{\em origdir} & A string containing the full path, in platform-\/independent notation, of the directory containing this file. In most cases, this is the directory on which you requested enumeration, passed in the callback for your convenience. \\
\hline
{\em fname} & The filename that is being enumerated. It may not be in alphabetical order compared to other callbacks that have fired, and it will not contain the full path. You can recreate the fullpath with \$origdir/\$fname ... The file can be a subdirectory, a file, a symlink, etc.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback}{p.}{physfs_8h_a9d3541369a4eb0a95f946bc3f4103dfb} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+sint64@{P\+H\+Y\+S\+F\+S\+\_\+sint64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+sint64@{P\+H\+Y\+S\+F\+S\+\_\+sint64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+sint64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}}\label{physfs_8h_a88c5f1d7b088888c729b22644651c9f5}


A signed, 64-\/bit integer type. 

\begin{DoxyWarning}{Warning}
on platforms without any sort of 64-\/bit datatype, this is equivalent to P\+H\+Y\+S\+F\+S\+\_\+sint32! 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}}
\index{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}]{\setlength{\rightskip}{0pt plus 5cm}P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}\label{physfs_8h_a6331ac65f8e0d32288f8597e48188a4f}


Function signature for callbacks that report strings. 

These are used to report a list of strings to an original caller, one string per callback. All strings are U\+T\+F-\/8 encoded. Functions should not try to modify or free the string\textquotesingle{}s memory.

These callbacks are used, starting in Physics\+F\+S 1.\+1, as an alternative to functions that would return lists that need to be cleaned up with \doxyref{P\+H\+Y\+S\+F\+S\+\_\+free\+List()}{p.}{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05}. The callback means that the library doesn\textquotesingle{}t need to allocate an entire list and all the strings up front.

Be aware that promises data ordering in the list versions are not necessarily so in the callback versions. Check the documentation on specific A\+P\+Is, but strings may not be sorted as you expect.


\begin{DoxyParams}{Parameters}
{\em data} & User-\/defined data pointer, passed through from the A\+P\+I that eventually called the callback. \\
\hline
{\em str} & The string data about which the callback is meant to inform.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback}{p.}{physfs_8h_ace04dfd0654ce55a81a85f57f56c7410} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback}{p.}{physfs_8h_abd5f7188ab27722b0651e7503c6a737a} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+uint64@{P\+H\+Y\+S\+F\+S\+\_\+uint64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+uint64@{P\+H\+Y\+S\+F\+S\+\_\+uint64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+uint64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}\label{physfs_8h_a632ba02500231e5f6f6df2e4cb71c818}


An unsigned, 64-\/bit integer type. 

\begin{DoxyWarning}{Warning}
on platforms without any sort of 64-\/bit datatype, this is equivalent to P\+H\+Y\+S\+F\+S\+\_\+uint32! 
\end{DoxyWarning}


\subsection{Function Documentation}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path}}
\index{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{new\+Dir, }
\item[{int}]{append\+To\+Path}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0956d926822291a23ee540c2ffefa1af}


Add an archive or directory to the search path. 

This is a legacy call in Physics\+F\+S 2.\+0, equivalent to\+: P\+H\+Y\+S\+F\+S\+\_\+mount(new\+Dir, N\+U\+L\+L, append\+To\+Path);

You must use this and not P\+H\+Y\+S\+F\+S\+\_\+mount if binary compatibility with Physics\+F\+S 1.\+0 is important (which it may not be for many people).

\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+mount}{p.}{physfs_8h_a8eb320e9af03dcdb4c05bbff3ea604d4} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}{p.}{physfs_8h_a1e4ed59d6c80b8fb28904723cfd5b510} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+close@{P\+H\+Y\+S\+F\+S\+\_\+close}}
\index{P\+H\+Y\+S\+F\+S\+\_\+close@{P\+H\+Y\+S\+F\+S\+\_\+close}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+close}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+close (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2}


Close a Physics\+F\+S filehandle. 

This call is capable of failing if the operating system was buffering writes to the physical media, and, now forced to write those changes to physical media, can not store the data for some reason. In such a case, the filehandle stays open. A well-\/written program should A\+L\+W\+A\+Y\+S check the return value from the close call in addition to every writing call!


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}{p.}{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}{p.}{physfs_8h_abbf92d66c6cb82d0ede969aa2c964fba} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}{p.}{physfs_8h_abeeca12e2fe7c5f68cbd67e2e5cafa3d} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+deinit@{P\+H\+Y\+S\+F\+S\+\_\+deinit}}
\index{P\+H\+Y\+S\+F\+S\+\_\+deinit@{P\+H\+Y\+S\+F\+S\+\_\+deinit}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+deinit}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+deinit (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_aa465c9b58e5020f503085d433a413b5b}


Deinitialize the Physics\+F\+S library. 

This closes any files opened via Physics\+F\+S, blanks the search/write paths, frees memory, and invalidates all of your file handles.

Note that this call can F\+A\+I\+L if there\textquotesingle{}s a file open for writing that refuses to close (for example, the underlying operating system was buffering writes to network filesystem, and the fileserver has crashed, or a hard drive has failed, etc). It is usually best to close all write handles yourself before calling this function, so that you can gracefully handle a specific failure.

Once successfully deinitialized, \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} can be called again to restart the subsystem. All default A\+P\+I states are restored at this point, with the exception of any custom allocator you might have specified, which survives between initializations.

\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. If failure, state of Phys\+F\+S is undefined, and probably badly screwed up.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+init}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Init}{p.}{physfs_8h_a6154be7bfa5d924476356a9fbd0d8223} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+delete@{P\+H\+Y\+S\+F\+S\+\_\+delete}}
\index{P\+H\+Y\+S\+F\+S\+\_\+delete@{P\+H\+Y\+S\+F\+S\+\_\+delete}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+delete}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+delete (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_a27a939bce4c1132bacdfcb3d3cc29e37}


Delete a file or directory. 

(filename) is specified in platform-\/independent notation in relation to the write dir.

A directory must be empty before this call can delete it.

Deleting a symlink will remove the link, not what it points to, regardless of whether you \char`\"{}permit\+Sym\+Links\char`\"{} or not.

So if you\textquotesingle{}ve got the write dir set to \char`\"{}\+C\+:\textbackslash{}mygame\textbackslash{}writedir\char`\"{} and call P\+H\+Y\+S\+F\+S\+\_\+delete(\char`\"{}downloads/maps/level1.\+map\char`\"{}) then the file \char`\"{}\+C\+:\textbackslash{}mygame\textbackslash{}writedir\textbackslash{}downloads\textbackslash{}maps\textbackslash{}level1.\+map\char`\"{} is removed from the physical filesystem, if it exists and the operating system permits the deletion.

Note that on Unix systems, deleting a file may be successful, but the actual file won\textquotesingle{}t be removed until all processes that have an open filehandle to it (including your program) close their handles.

Chances are, the bits that make up the file still exist, they are just made available to be written over at a later point. Don\textquotesingle{}t consider this a security method or anything. \+:)


\begin{DoxyParams}{Parameters}
{\em filename} & Filename to delete. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files@{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files}}
\index{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files@{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files}]{\setlength{\rightskip}{0pt plus 5cm}char $\ast$$\ast$ P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dir}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4}


Get a file listing of a search path\textquotesingle{}s directory. 

Matching directories are interpolated. That is, if \char`\"{}\+C\+:\textbackslash{}mydir\char`\"{} is in the search path and contains a directory \char`\"{}savegames\char`\"{} that contains \char`\"{}x.\+sav\char`\"{}, \char`\"{}y.\+sav\char`\"{}, and \char`\"{}z.\+sav\char`\"{}, and there is also a \char`\"{}\+C\+:\textbackslash{}userdir\char`\"{} in the search path that has a \char`\"{}savegames\char`\"{} subdirectory with \char`\"{}w.\+sav\char`\"{}, then the following code\+:


\begin{DoxyCode}
1 char **rc = PHYSFS\_enumerateFiles("savegames");
2 char **i;
3 
4 for (i = rc; *i != NULL; i++)
5     printf(" * We've got [%s].\(\backslash\)n", *i);
6 
7 PHYSFS\_freeList(rc);
\end{DoxyCode}


...will print\+:

\begin{DoxyVerb}* We've got [x.sav].
* We've got [y.sav].
* We've got [z.sav].
* We've got [w.sav].\end{DoxyVerb}


Feel free to sort the list however you like. We only promise there will be no duplicates, but not what order the final list will come back in.

Don\textquotesingle{}t forget to call \doxyref{P\+H\+Y\+S\+F\+S\+\_\+free\+List()}{p.}{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05} with the return value from this function when you are done with it.


\begin{DoxyParams}{Parameters}
{\em dir} & directory in platform-\/independent notation to enumerate. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Null-\/terminated array of null-\/terminated strings.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback}{p.}{physfs_8h_a9d3541369a4eb0a95f946bc3f4103dfb} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback}}
\index{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files\+Callback (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dir, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}}]{c, }
\item[{void $\ast$}]{d}
\end{DoxyParamCaption}
)}\label{physfs_8h_a9d3541369a4eb0a95f946bc3f4103dfb}


Get a file listing of a search path\textquotesingle{}s directory, using an application-\/defined callback. 

Internally, \doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files()}{p.}{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4} just calls this function and then builds a list before returning to the application, so functionality is identical except for how the information is represented to the application.

Unlike \doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files()}{p.}{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4}, this function does not return an array. Rather, it calls a function specified by the application once per element of the search path\+:


\begin{DoxyCode}
1 static void printDir(void *data, const char *origdir, const char *fname)
2 \{
3     printf(" * We've got [%s] in [%s].\(\backslash\)n", fname, origdir);
4 \}
5 
6 // ...
7 PHYSFS\_enumerateFilesCallback("/some/path", printDir, NULL);
\end{DoxyCode}


Items sent to the callback are not guaranteed to be in any order whatsoever. There is no sorting done at this level, and if you need that, you should probably use \doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files()}{p.}{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4} instead, which guarantees alphabetical sorting. This form reports whatever is discovered in each archive before moving on to the next. Even within one archive, we can\textquotesingle{}t guarantee what order it will discover data. {\itshape Any sorting you find in these callbacks is just pure luck. Do not rely on it.}


\begin{DoxyParams}{Parameters}
{\em dir} & Directory, in platform-\/independent notation, to enumerate. \\
\hline
{\em c} & Callback function to notify about search path elements. \\
\hline
{\em d} & Application-\/defined data passed to callback. Can be N\+U\+L\+L.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+Enum\+Files\+Callback}{p.}{physfs_8h_a51c1e0145502aeaf080973d308d33c6a} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files}{p.}{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+eof@{P\+H\+Y\+S\+F\+S\+\_\+eof}}
\index{P\+H\+Y\+S\+F\+S\+\_\+eof@{P\+H\+Y\+S\+F\+S\+\_\+eof}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+eof}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+eof (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6d7ac838797951323072060392645dbe}


Check for end-\/of-\/file state on a Physics\+F\+S filehandle. 

Determine if the end of file has been reached in a Physics\+F\+S filehandle.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Read()}{p.}{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63}. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero if E\+O\+F, zero if not.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+read}{p.}{physfs_8h_a91234f576477f7de67d635761d01aa7b} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+tell}{p.}{physfs_8h_a0d481bdd4cf32ed1a41540ee59840c24} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+exists@{P\+H\+Y\+S\+F\+S\+\_\+exists}}
\index{P\+H\+Y\+S\+F\+S\+\_\+exists@{P\+H\+Y\+S\+F\+S\+\_\+exists}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+exists}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+exists (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{fname}
\end{DoxyParamCaption}
)}\label{physfs_8h_accd31941b636ff153d328aebf72048c7}


Determine if a file exists in the search path. 

Reports true if there is an entry anywhere in the search path by the name of (fname).

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, so you might end up further down in the search path than expected.


\begin{DoxyParams}{Parameters}
{\em fname} & filename in platform-\/independent notation. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
non-\/zero if filename exists. zero otherwise.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory}{p.}{physfs_8h_a5877fcafb72dca892c1c2465292eef47} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link}{p.}{physfs_8h_ae44880fa7528d0b4edb00034324a0884} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+file\+Length@{P\+H\+Y\+S\+F\+S\+\_\+file\+Length}}
\index{P\+H\+Y\+S\+F\+S\+\_\+file\+Length@{P\+H\+Y\+S\+F\+S\+\_\+file\+Length}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+file\+Length}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+file\+Length (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle}
\end{DoxyParamCaption}
)}\label{physfs_8h_a3f1d8b415d37d8040ca423ed29536fde}


Get total length of a file in bytes. 

Note that if the file size can\textquotesingle{}t be determined (since the archive is \char`\"{}streamed\char`\"{} or whatnot) than this will report (-\/1). Also note that if another process/thread is writing to this file at the same time, then the information this function supplies could be incorrect before you get it. Use with caution, or better yet, don\textquotesingle{}t use at all.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
size in bytes of the file. -\/1 if can\textquotesingle{}t be determined.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+tell}{p.}{physfs_8h_a0d481bdd4cf32ed1a41540ee59840c24} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+seek}{p.}{physfs_8h_ae562b45b1e1b02505ce1d82ad785f04a} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+flush@{P\+H\+Y\+S\+F\+S\+\_\+flush}}
\index{P\+H\+Y\+S\+F\+S\+\_\+flush@{P\+H\+Y\+S\+F\+S\+\_\+flush}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+flush}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+flush (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle}
\end{DoxyParamCaption}
)}\label{physfs_8h_a3fd8f9cfdfd09f4fb778a386d8e97e8a}


Flush a buffered Physics\+F\+S file handle. 

For buffered files opened for writing, this will put the current contents of the buffer to disk and flag the buffer as empty if possible.

For buffered files opened for reading or unbuffered files, this is a safe no-\/op, and will report success.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero if successful, zero on error.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer}{p.}{physfs_8h_aede5de47197e1a613d2091802befc886} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+close}{p.}{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+free\+List@{P\+H\+Y\+S\+F\+S\+\_\+free\+List}}
\index{P\+H\+Y\+S\+F\+S\+\_\+free\+List@{P\+H\+Y\+S\+F\+S\+\_\+free\+List}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+free\+List}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+free\+List (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{list\+Var}
\end{DoxyParamCaption}
)}\label{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05}


Deallocate resources of lists returned by Physics\+F\+S. 

Certain Physics\+F\+S functions return lists of information that are dynamically allocated. Use this function to free those resources.


\begin{DoxyParams}{Parameters}
{\em list\+Var} & List of information specified as freeable by this function.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs}{p.}{physfs_8h_af9a9674a36f7c96ed7813f9db06eefed} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+enumerate\+Files}{p.}{physfs_8h_a0f4ae950c2dae0735a91263ddd20fbf4} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0034c327dfb381a1c95deb80878bcede}


Get the path where the application resides. 

Helper function.

Get the \char`\"{}base dir\char`\"{}. This is the directory where the application was run from, which is probably the installation directory, and may or may not be the process\textquotesingle{}s current working directory.

You should probably use the base dir in your search path.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y string of base dir in platform-\/dependent notation.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir}{p.}{physfs_8h_a9d86fca7a5cbbc53f5425ff7539b1426} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs@{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs@{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs}]{\setlength{\rightskip}{0pt plus 5cm}char $\ast$$\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_af9a9674a36f7c96ed7813f9db06eefed}


Get an array of paths to available C\+D-\/\+R\+O\+M drives. 

The dirs returned are platform-\/dependent (\char`\"{}\+D\+:\textbackslash{}\char`\"{} on Win32, \char`\"{}/cdrom\char`\"{} or whatnot on Unix). Dirs are only returned if there is a disc ready and accessible in the drive. So if you\textquotesingle{}ve got two drives (D\+: and E\+:), and only E\+: has a disc in it, then that\textquotesingle{}s all you get. If the user inserts a disc in D\+: and you call this function again, you get both drives. If, on a Unix box, the user unmounts a disc and remounts it elsewhere, the next call to this function will reflect that change.

This function refers to \char`\"{}\+C\+D-\/\+R\+O\+M\char`\"{} media, but it really means \char`\"{}inserted disc
 media,\char`\"{} such as D\+V\+D-\/\+R\+O\+M, H\+D-\/\+D\+V\+D, C\+D\+R\+W, and Blu-\/\+Ray discs. It looks for filesystems, and as such won\textquotesingle{}t report an audio C\+D, unless there\textquotesingle{}s a mounted filesystem track on it.

The returned value is an array of strings, with a N\+U\+L\+L entry to signify the end of the list\+:


\begin{DoxyCode}
1 char **cds = PHYSFS\_getCdRomDirs();
2 char **i;
3 
4 for (i = cds; *i != NULL; i++)
5     printf("cdrom dir [%s] is available.\(\backslash\)n", *i);
6 
7 PHYSFS\_freeList(cds);
\end{DoxyCode}


This call may block while drives spin up. Be forewarned.

When you are done with the returned information, you may dispose of the resources by calling \doxyref{P\+H\+Y\+S\+F\+S\+\_\+free\+List()}{p.}{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05} with the returned pointer.

\begin{DoxyReturn}{Returns}
Null-\/terminated array of null-\/terminated strings.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback}{p.}{physfs_8h_ace04dfd0654ce55a81a85f57f56c7410} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs\+Callback (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}}]{c, }
\item[{void $\ast$}]{d}
\end{DoxyParamCaption}
)}\label{physfs_8h_ace04dfd0654ce55a81a85f57f56c7410}


Enumerate C\+D-\/\+R\+O\+M directories, using an application-\/defined callback. 

Internally, \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs()}{p.}{physfs_8h_af9a9674a36f7c96ed7813f9db06eefed} just calls this function and then builds a list before returning to the application, so functionality is identical except for how the information is represented to the application.

Unlike \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs()}{p.}{physfs_8h_af9a9674a36f7c96ed7813f9db06eefed}, this function does not return an array. Rather, it calls a function specified by the application once per detected disc\+:


\begin{DoxyCode}
1 static void foundDisc(void *data, const char *cddir)
2 \{
3     printf("cdrom dir [%s] is available.\(\backslash\)n", cddir);
4 \}
5 
6 // ...
7 PHYSFS\_getCdRomDirsCallback(foundDisc, NULL);
\end{DoxyCode}


This call may block while drives spin up. Be forewarned.


\begin{DoxyParams}{Parameters}
{\em c} & Callback function to notify about detected drives. \\
\hline
{\em d} & Application-\/defined data passed to callback. Can be N\+U\+L\+L.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}{p.}{physfs_8h_a6331ac65f8e0d32288f8597e48188a4f} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Cd\+Rom\+Dirs}{p.}{physfs_8h_af9a9674a36f7c96ed7813f9db06eefed} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator@{P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator@{P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Dir\+Separator (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_ad1dc17d387c45e9155d1f0c348a7cbcc}


Get platform-\/dependent dir separator string. 

This returns \char`\"{}\textbackslash{}\textbackslash{}\char`\"{} on win32, \char`\"{}/\char`\"{} on Unix, and \char`\"{}\+:\char`\"{} on Mac\+O\+S. It may be more than one character, depending on the platform, and your code should take that into account. Note that this is only useful for setting up the search/write paths, since access into those dirs always use \textquotesingle{}/\textquotesingle{} (platform-\/independent notation) to separate directories. This is also handy for getting platform-\/independent access when using stdio calls.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y null-\/terminated string of platform\textquotesingle{}s dir separator. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error@{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error@{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}


Get human-\/readable error information. 

Get the last Physics\+F\+S error message as a human-\/readable, null-\/terminated string. This will be N\+U\+L\+L if there\textquotesingle{}s been no error since the last call to this function. The pointer returned by this call points to an internal buffer. Each thread has a unique error state associated with it, but each time a new error message is set, it will overwrite the previous one associated with that thread. It is safe to call this function at anytime, even before \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1}.

It is not wise to expect a specific string of characters here, since the error message may be localized into an unfamiliar language. These strings are meant to be passed on directly to the user.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y string of last error message. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time@{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time@{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Mod\+Time (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_a58e182a3deb67dd780f1de23440fa3e5}


Get the last modification time of a file. 

The modtime is returned as a number of seconds since the epoch (Jan 1, 1970). The exact derivation and accuracy of this time depends on the particular archiver. If there is no reasonable way to obtain this information for a particular archiver, or there was some sort of error, this function returns (-\/1).


\begin{DoxyParams}{Parameters}
{\em filename} & filename to check, in platform-\/independent notation. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
last modified time of the file. -\/1 if it can\textquotesingle{}t be determined. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version@{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version@{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+get\+Linked\+Version (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+Version} $\ast$}]{ver}
\end{DoxyParamCaption}
)}\label{physfs_8h_a8977d0ba0a2301256e823532479f1a05}


Get the version of Physics\+F\+S that is linked against your program. 

If you are using a shared library (D\+L\+L) version of Phys\+F\+S, then it is possible that it will be different than the version you compiled against.

This is a real function; the macro P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N tells you what version of Phys\+F\+S you compiled against\+:


\begin{DoxyCode}
1 PHYSFS\_Version compiled;
2 PHYSFS\_Version linked;
3 
4 PHYSFS\_VERSION(&compiled);
5 PHYSFS\_getLinkedVersion(&linked);
6 printf("We compiled against PhysFS version %d.%d.%d ...\(\backslash\)n",
7           compiled.major, compiled.minor, compiled.patch);
8 printf("But we linked against PhysFS version %d.%d.%d.\(\backslash\)n",
9           linked.major, linked.minor, linked.patch);
\end{DoxyCode}


This function may be called safely at any time, even before \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1}.

\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+V\+E\+R\+S\+I\+O\+N}{p.}{physfs_8h_acb77c1f8f70028add43b9f81eef1ed78} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point@{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point@{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dir}
\end{DoxyParamCaption}
)}\label{physfs_8h_a365aee0c326b0e6bfbba5c039f7c4b5b}


Determine a mounted archive\textquotesingle{}s mountpoint. 

You give this function the name of an archive or dir you successfully added to the search path, and it reports the location in the interpolated tree where it is mounted. Files mounted with a N\+U\+L\+L mountpoint or through \doxyref{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path()}{p.}{physfs_8h_a0956d926822291a23ee540c2ffefa1af} will report \char`\"{}/\char`\"{}. The return value is R\+E\+A\+D O\+N\+L\+Y and valid until the archive is removed from the search path.


\begin{DoxyParams}{Parameters}
{\em dir} & directory or archive previously added to the path, in platform-\/dependent notation. This must match the string used when adding, even if your string would also reference the same file with a different string of characters. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
R\+E\+A\+D-\/\+O\+N\+L\+Y string of mount point if added to path, N\+U\+L\+L on failure (bogus archive, etc) Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}{p.}{physfs_8h_a1e4ed59d6c80b8fb28904723cfd5b510} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point}{p.}{physfs_8h_a365aee0c326b0e6bfbba5c039f7c4b5b} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Real\+Dir (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_a539bcf0ebde6271e3e4a90dd287ca975}


Figure out where in the search path a file resides. 

The file is specified in platform-\/independent notation. The returned filename will be the element of the search path where the file was found, which may be a directory, or an archive. Even if there are multiple matches in different parts of the search path, only the first one found is used, just like when opening a file.

So, if you look for \char`\"{}maps/level1.\+map\char`\"{}, and C\+:\textbackslash{}mygame is in your search path and C\+:\textbackslash{}mygame\textbackslash{}maps\textbackslash{}level1.\+map exists, then \char`\"{}\+C\+:\textbackslash{}mygame\char`\"{} is returned.

If a any part of a match is a symbolic link, and you\textquotesingle{}ve not explicitly permitted symlinks, then it will be ignored, and the search for a match will continue.

If you specify a fake directory that only exists as a mount point, it\textquotesingle{}ll be associated with the first archive mounted there, even though that directory isn\textquotesingle{}t necessarily contained in a real archive.


\begin{DoxyParams}{Parameters}
{\em filename} & file to look for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y string of element of search path containing the the file in question. N\+U\+L\+L if not found. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}]{\setlength{\rightskip}{0pt plus 5cm}char $\ast$$\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4}


Get the current search path. 

The default search path is an empty list.

The returned value is an array of strings, with a N\+U\+L\+L entry to signify the end of the list\+:


\begin{DoxyCode}
1 char **i;
2 
3 for (i = PHYSFS\_getSearchPath(); *i != NULL; i++)
4     printf("[%s] is in the search path.\(\backslash\)n", *i);
\end{DoxyCode}


When you are done with the returned information, you may dispose of the resources by calling \doxyref{P\+H\+Y\+S\+F\+S\+\_\+free\+List()}{p.}{physfs_8h_af6aeb2ffdcee44f02cf380da62462b05} with the returned pointer.

\begin{DoxyReturn}{Returns}
Null-\/terminated array of null-\/terminated strings. N\+U\+L\+L if there was a problem (read\+: O\+U\+T O\+F M\+E\+M\+O\+R\+Y).
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback}{p.}{physfs_8h_abd5f7188ab27722b0651e7503c6a737a} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path}{p.}{physfs_8h_a0956d926822291a23ee540c2ffefa1af} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}{p.}{physfs_8h_a1e4ed59d6c80b8fb28904723cfd5b510} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback@{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path\+Callback (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}}]{c, }
\item[{void $\ast$}]{d}
\end{DoxyParamCaption}
)}\label{physfs_8h_abd5f7188ab27722b0651e7503c6a737a}


Enumerate the search path, using an application-\/defined callback. 

Internally, \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path()}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} just calls this function and then builds a list before returning to the application, so functionality is identical except for how the information is represented to the application.

Unlike \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path()}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4}, this function does not return an array. Rather, it calls a function specified by the application once per element of the search path\+:


\begin{DoxyCode}
1 static void printSearchPath(void *data, const char *pathItem)
2 \{
3     printf("[%s] is in the search path.\(\backslash\)n", pathItem);
4 \}
5 
6 // ...
7 PHYSFS\_getSearchPathCallback(printSearchPath, NULL);
\end{DoxyCode}


Elements of the search path are reported in order search priority, so the first archive/dir that would be examined when looking for a file is the first element passed through the callback.


\begin{DoxyParams}{Parameters}
{\em c} & Callback function to notify about search path elements. \\
\hline
{\em d} & Application-\/defined data passed to callback. Can be N\+U\+L\+L.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+String\+Callback}{p.}{physfs_8h_a6331ac65f8e0d32288f8597e48188a4f} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+User\+Dir (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a9d86fca7a5cbbc53f5425ff7539b1426}


Get the path where user\textquotesingle{}s home directory resides. 

Helper function.

Get the \char`\"{}user dir\char`\"{}. This is meant to be a suggestion of where a specific user of the system can store files. On Unix, this is her home directory. On systems with no concept of multiple home directories (Mac\+O\+S, win95), this will default to something like \char`\"{}\+C\+:\textbackslash{}mybasedir\textbackslash{}users\textbackslash{}username\char`\"{} where \char`\"{}username\char`\"{} will either be the login name, or \char`\"{}default\char`\"{} if the platform doesn\textquotesingle{}t support multiple users, either.

You should probably use the user dir as the basis for your write dir, and also put it near the beginning of your search path.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y string of user dir in platform-\/dependent notation.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir}{p.}{physfs_8h_a0034c327dfb381a1c95deb80878bcede} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir}]{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6533ff91180a4c8abfe24d458f6b9915}


Get path where Physics\+F\+S will allow file writing. 

Get the current write dir. The default write dir is N\+U\+L\+L.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y string of write dir in platform-\/dependent notation, O\+R N\+U\+L\+L I\+F N\+O W\+R\+I\+T\+E P\+A\+T\+H I\+S C\+U\+R\+R\+E\+N\+T\+L\+Y S\+E\+T.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir}{p.}{physfs_8h_a36c408d40b3a93c8f9fc02a16c02e430} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+init@{P\+H\+Y\+S\+F\+S\+\_\+init}}
\index{P\+H\+Y\+S\+F\+S\+\_\+init@{P\+H\+Y\+S\+F\+S\+\_\+init}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+init (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{argv0}
\end{DoxyParamCaption}
)}\label{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1}


Initialize the Physics\+F\+S library. 

This must be called before any other Physics\+F\+S function.

This should be called prior to any attempts to change your process\textquotesingle{}s current working directory.


\begin{DoxyParams}{Parameters}
{\em argv0} & the argv[0] string passed to your program\textquotesingle{}s mainline. This may be N\+U\+L\+L on most platforms (such as ones without a standard main() function), but you should always try to pass something in here. Unix-\/like systems such as Linux {\itshape need} to pass argv[0] from main() in here. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+deinit}{p.}{physfs_8h_aa465c9b58e5020f503085d433a413b5b} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Init}{p.}{physfs_8h_a6154be7bfa5d924476356a9fbd0d8223} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+is\+Directory@{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory}}
\index{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory@{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+is\+Directory (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{fname}
\end{DoxyParamCaption}
)}\label{physfs_8h_a5877fcafb72dca892c1c2465292eef47}


Determine if a file in the search path is really a directory. 

Determine if the first occurence of (fname) in the search path is really a directory entry.

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, so you might end up further down in the search path than expected.


\begin{DoxyParams}{Parameters}
{\em fname} & filename in platform-\/independent notation. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
non-\/zero if filename exists and is a directory. zero otherwise.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+exists}{p.}{physfs_8h_accd31941b636ff153d328aebf72048c7} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link}{p.}{physfs_8h_ae44880fa7528d0b4edb00034324a0884} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+is\+Init@{P\+H\+Y\+S\+F\+S\+\_\+is\+Init}}
\index{P\+H\+Y\+S\+F\+S\+\_\+is\+Init@{P\+H\+Y\+S\+F\+S\+\_\+is\+Init}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+is\+Init}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+is\+Init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6154be7bfa5d924476356a9fbd0d8223}


Determine if the Physics\+F\+S library is initialized. 

Once \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} returns successfully, this will return non-\/zero. Before a successful \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} and after \doxyref{P\+H\+Y\+S\+F\+S\+\_\+deinit()}{p.}{physfs_8h_aa465c9b58e5020f503085d433a413b5b} returns successfully, this will return zero. This function is safe to call at any time.

\begin{DoxyReturn}{Returns}
non-\/zero if library is initialized, zero if library is not.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+init}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+deinit}{p.}{physfs_8h_aa465c9b58e5020f503085d433a413b5b} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link@{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link}}
\index{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link@{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+is\+Symbolic\+Link (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{fname}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae44880fa7528d0b4edb00034324a0884}


Determine if a file in the search path is really a symbolic link. 

Determine if the first occurence of (fname) in the search path is really a symbolic link.

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, and as such, this function will always return 0 in that case.


\begin{DoxyParams}{Parameters}
{\em fname} & filename in platform-\/independent notation. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
non-\/zero if filename exists and is a symlink. zero otherwise.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+exists}{p.}{physfs_8h_accd31941b636ff153d328aebf72048c7} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+is\+Directory}{p.}{physfs_8h_a5877fcafb72dca892c1c2465292eef47} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+mkdir@{P\+H\+Y\+S\+F\+S\+\_\+mkdir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+mkdir@{P\+H\+Y\+S\+F\+S\+\_\+mkdir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+mkdir}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+mkdir (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{dir\+Name}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae11fb98bf8c08a2e028f52ac9a728aa9}


Create a directory. 

This is specified in platform-\/independent notation in relation to the write dir. All missing parent directories are also created if they don\textquotesingle{}t exist.

So if you\textquotesingle{}ve got the write dir set to \char`\"{}\+C\+:\textbackslash{}mygame\textbackslash{}writedir\char`\"{} and call P\+H\+Y\+S\+F\+S\+\_\+mkdir(\char`\"{}downloads/maps\char`\"{}) then the directories \char`\"{}\+C\+:\textbackslash{}mygame\textbackslash{}writedir\textbackslash{}downloads\char`\"{} and \char`\"{}\+C\+:\textbackslash{}mygame\textbackslash{}writedir\textbackslash{}downloads\textbackslash{}maps\char`\"{} will be created if possible. If the creation of \char`\"{}maps\char`\"{} fails after we have successfully created \char`\"{}downloads\char`\"{}, then the function leaves the created directory behind and reports failure.


\begin{DoxyParams}{Parameters}
{\em dir\+Name} & New dir to create. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+delete}{p.}{physfs_8h_a27a939bce4c1132bacdfcb3d3cc29e37} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+mount@{P\+H\+Y\+S\+F\+S\+\_\+mount}}
\index{P\+H\+Y\+S\+F\+S\+\_\+mount@{P\+H\+Y\+S\+F\+S\+\_\+mount}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+mount}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+mount (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{new\+Dir, }
\item[{const char $\ast$}]{mount\+Point, }
\item[{int}]{append\+To\+Path}
\end{DoxyParamCaption}
)}\label{physfs_8h_a8eb320e9af03dcdb4c05bbff3ea604d4}


Add an archive or directory to the search path. 

If this is a duplicate, the entry is not added again, even though the function succeeds. You may not add the same archive to two different mountpoints\+: duplicate checking is done against the archive and not the mountpoint.

When you mount an archive, it is added to a virtual file system...all files in all of the archives are interpolated into a single hierachical file tree. Two archives mounted at the same place (or an archive with files overlapping another mountpoint) may have overlapping files\+: in such a case, the file earliest in the search path is selected, and the other files are inaccessible to the application. This allows archives to be used to override previous revisions; you can use the mounting mechanism to place archives at a specific point in the file tree and prevent overlap; this is useful for downloadable mods that might trample over application data or each other, for example.

The mountpoint does not need to exist prior to mounting, which is different than those familiar with the Unix concept of \char`\"{}mounting\char`\"{} may not expect. As well, more than one archive can be mounted to the same mountpoint, or mountpoints and archive contents can overlap...the interpolation mechanism still functions as usual.


\begin{DoxyParams}{Parameters}
{\em new\+Dir} & directory or archive to add to the path, in platform-\/dependent notation. \\
\hline
{\em mount\+Point} & Location in the interpolated tree that this archive will be \char`\"{}mounted\char`\"{}, in platform-\/independent notation. N\+U\+L\+L or \char`\"{}\char`\"{} is equivalent to \char`\"{}/\char`\"{}. \\
\hline
{\em append\+To\+Path} & nonzero to append to search path, zero to prepend. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero if added to path, zero on failure (bogus archive, dir missing, etc). Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}{p.}{physfs_8h_a1e4ed59d6c80b8fb28904723cfd5b510} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Mount\+Point}{p.}{physfs_8h_a365aee0c326b0e6bfbba5c039f7c4b5b} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+open\+Append@{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}}
\index{P\+H\+Y\+S\+F\+S\+\_\+open\+Append@{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ P\+H\+Y\+S\+F\+S\+\_\+open\+Append (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_abeeca12e2fe7c5f68cbd67e2e5cafa3d}


Open a file for appending. 

Open a file for writing, in platform-\/independent notation and in relation to the write dir as the root of the writable filesystem. The specified file is created if it doesn\textquotesingle{}t exist. If it does exist, the writing offset is set to the end of the file, so the first write will be the byte after the end.

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, and opening a symlink with this function will fail in such a case.


\begin{DoxyParams}{Parameters}
{\em filename} & File to open. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A valid Physics\+F\+S filehandle on success, N\+U\+L\+L on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}{p.}{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}{p.}{physfs_8h_abbf92d66c6cb82d0ede969aa2c964fba} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+write}{p.}{physfs_8h_af5dc83d5e4ef0b0c9bce1834ea1bb498} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+close}{p.}{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+open\+Read@{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}}
\index{P\+H\+Y\+S\+F\+S\+\_\+open\+Read@{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ P\+H\+Y\+S\+F\+S\+\_\+open\+Read (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63}


Open a file for reading. 

Open a file for reading, in platform-\/independent notation. The search path is checked one at a time until a matching file is found, in which case an abstract filehandle is associated with it, and reading may be done. The reading offset is set to the first byte of the file.

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, and opening a symlink with this function will fail in such a case.


\begin{DoxyParams}{Parameters}
{\em filename} & File to open. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A valid Physics\+F\+S filehandle on success, N\+U\+L\+L on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}{p.}{physfs_8h_abbf92d66c6cb82d0ede969aa2c964fba} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}{p.}{physfs_8h_abeeca12e2fe7c5f68cbd67e2e5cafa3d} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+read}{p.}{physfs_8h_a91234f576477f7de67d635761d01aa7b} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+close}{p.}{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+open\+Write@{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}}
\index{P\+H\+Y\+S\+F\+S\+\_\+open\+Write@{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+open\+Write}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$ P\+H\+Y\+S\+F\+S\+\_\+open\+Write (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename}
\end{DoxyParamCaption}
)}\label{physfs_8h_abbf92d66c6cb82d0ede969aa2c964fba}


Open a file for writing. 

Open a file for writing, in platform-\/independent notation and in relation to the write dir as the root of the writable filesystem. The specified file is created if it doesn\textquotesingle{}t exist. If it does exist, it is truncated to zero bytes, and the writing offset is set to the start.

Note that entries that are symlinks are ignored if P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links(1) hasn\textquotesingle{}t been called, and opening a symlink with this function will fail in such a case.


\begin{DoxyParams}{Parameters}
{\em filename} & File to open. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A valid Physics\+F\+S filehandle on success, N\+U\+L\+L on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Read}{p.}{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Append}{p.}{physfs_8h_abeeca12e2fe7c5f68cbd67e2e5cafa3d} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+write}{p.}{physfs_8h_af5dc83d5e4ef0b0c9bce1834ea1bb498} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+close}{p.}{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links@{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links}}
\index{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links@{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links (
\begin{DoxyParamCaption}
\item[{int}]{allow}
\end{DoxyParamCaption}
)}\label{physfs_8h_aad451d9b3f46f627a1be8caee2eef9b7}


Enable or disable following of symbolic links. 

Some physical filesystems and archives contain files that are just pointers to other files. On the physical filesystem, opening such a link will (transparently) open the file that is pointed to.

By default, Physics\+F\+S will check if a file is really a symlink during open calls and fail if it is. Otherwise, the link could take you outside the write and search paths, and compromise security.

If you want to take that risk, call this function with a non-\/zero parameter. Note that this is more for sandboxing a program\textquotesingle{}s scripting language, in case untrusted scripts try to compromise the system. Generally speaking, a user could very well have a legitimate reason to set up a symlink, so unless you feel there\textquotesingle{}s a specific danger in allowing them, you should permit them.

Symlinks are only explicitly checked when dealing with filenames in platform-\/independent notation. That is, when setting up your search and write paths, etc, symlinks are never checked for.

Symbolic link permission can be enabled or disabled at any time after you\textquotesingle{}ve called \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1}, and is disabled by default.


\begin{DoxyParams}{Parameters}
{\em allow} & nonzero to permit symlinks, zero to deny linking.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted}{p.}{physfs_8h_a5223ccbe06246dd5379d6a57d6cd0d87} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read@{P\+H\+Y\+S\+F\+S\+\_\+read}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read@{P\+H\+Y\+S\+F\+S\+\_\+read}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+read (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle, }
\item[{void $\ast$}]{buffer, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{obj\+Size, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{obj\+Count}
\end{DoxyParamCaption}
)}\label{physfs_8h_a91234f576477f7de67d635761d01aa7b}


Read data from a Physics\+F\+S filehandle. 

The file must be opened for reading.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Read()}{p.}{physfs_8h_a5e38a425bb0b44c09ec25b105f770c63}. \\
\hline
{\em buffer} & buffer to store read data into. \\
\hline
{\em obj\+Size} & size in bytes of objects being read from (handle). \\
\hline
{\em obj\+Count} & number of (obj\+Size) objects to read from (handle). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of objects read. \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6} can shed light on the reason this might be $<$ (obj\+Count), as can \doxyref{P\+H\+Y\+S\+F\+S\+\_\+eof()}{p.}{physfs_8h_a6d7ac838797951323072060392645dbe}. -\/1 if complete failure.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+eof}{p.}{physfs_8h_a6d7ac838797951323072060392645dbe} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_ad524c869540cc428264c318330a89144}


Read and convert a signed 16-\/bit bigendian value. 

Convenience function. Read a signed 16-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_aab2bc016ea5dbe2a91479045576e644d}


Read and convert a signed 32-\/bit bigendian value. 

Convenience function. Read a signed 32-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a04eabd9e8da4265ede4018b24d4a39b1}


Read and convert a signed 64-\/bit bigendian value. 

Convenience function. Read a signed 64-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+sint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0959e10405416c139aad78dbc21617a0}


Read and convert a signed 16-\/bit littleendian value. 

Convenience function. Read a signed 16-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a2e2bfb4e8204c99f75642c4833e18566}


Read and convert a signed 32-\/bit littleendian value. 

Convenience function. Read a signed 32-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+S\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae916644039fad7ae4cb7d81440150d35}


Read and convert a signed 64-\/bit littleendian value. 

Convenience function. Read a signed 64-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+sint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a083c97d848b89e08f6529c31cd7dba67}


Read and convert an unsigned 16-\/bit bigendian value. 

Convenience function. Read an unsigned 16-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a357b5757a9483ef893977761d7d3fc1e}


Read and convert an unsigned 32-\/bit bigendian value. 

Convenience function. Read an unsigned 32-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a380430eda70acd8728930a2f1256c071}


Read and convert an unsigned 64-\/bit bigendian value. 

Convenience function. Read an unsigned 64-\/bit bigendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_af13248f4af186eda3983831dd8632da1}


Read and convert an unsigned 16-\/bit littleendian value. 

Convenience function. Read an unsigned 16-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_adef7cf2fb6311b0bc9d39634b4088545}


Read and convert an unsigned 32-\/bit littleendian value. 

Convenience function. Read an unsigned 32-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+read\+U\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} $\ast$}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae72ad9e14404add23d432838f4e9f35a}


Read and convert an unsigned 64-\/bit littleendian value. 

Convenience function. Read an unsigned 64-\/bit littleendian value from a file and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle from which to read. \\
\hline
{\em val} & pointer to where value should be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. If successful, ($\ast$val) will store the result. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}}
\index{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path@{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+remove\+From\+Search\+Path (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{old\+Dir}
\end{DoxyParamCaption}
)}\label{physfs_8h_a1e4ed59d6c80b8fb28904723cfd5b510}


Remove a directory or archive from the search path. 

This must be a (case-\/sensitive) match to a dir or archive already in the search path, specified in platform-\/dependent notation.

This call will fail (and fail to remove from the path) if the element still has files open in it.


\begin{DoxyParams}{Parameters}
{\em old\+Dir} & dir/archive to remove. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on failure. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+add\+To\+Search\+Path}{p.}{physfs_8h_a0956d926822291a23ee540c2ffefa1af} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Search\+Path}{p.}{physfs_8h_ac738531e9c7e5ca3797b64985c103cf4} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+seek@{P\+H\+Y\+S\+F\+S\+\_\+seek}}
\index{P\+H\+Y\+S\+F\+S\+\_\+seek@{P\+H\+Y\+S\+F\+S\+\_\+seek}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+seek}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+seek (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{pos}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae562b45b1e1b02505ce1d82ad785f04a}


Seek to a new position within a Physics\+F\+S filehandle. 

The next read or write will occur at that place. Seeking past the beginning or end of the file is not allowed, and causes an error.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
{\em pos} & number of bytes from start of file to seek to. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+tell}{p.}{physfs_8h_a0d481bdd4cf32ed1a41540ee59840c24} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator@{P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator}}
\index{P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator@{P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+set\+Allocator (
\begin{DoxyParamCaption}
\item[{const {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Allocator} $\ast$}]{allocator}
\end{DoxyParamCaption}
)}\label{physfs_8h_ae6297d1ae7755b9236b01950bfbb0ef1}


Hook your own allocation routines into Physics\+F\+S. 

(This is for limited, hardcore use. If you don\textquotesingle{}t immediately see a need for it, you can probably ignore this forever.)

By default, Physics\+F\+S will use whatever is reasonable for a platform to manage dynamic memory (usually A\+N\+S\+I C malloc/realloc/calloc/free, but some platforms might use something else), but in some uncommon cases, the app might want more control over the library\textquotesingle{}s memory management. This lets you redirect Physics\+F\+S to use your own allocation routines instead. You can only call this function before \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1}; if the library is initialized, it\textquotesingle{}ll reject your efforts to change the allocator mid-\/stream. You may call this function after \doxyref{P\+H\+Y\+S\+F\+S\+\_\+deinit()}{p.}{physfs_8h_aa465c9b58e5020f503085d433a413b5b} if you are willing to shut down the library and restart it with a new allocator; this is a safe and supported operation. The allocator remains intact between deinit/init calls. If you want to return to the platform\textquotesingle{}s default allocator, pass a N\+U\+L\+L in here.

If you aren\textquotesingle{}t immediately sure what to do with this function, you can safely ignore it altogether.


\begin{DoxyParams}{Parameters}
{\em allocator} & Structure containing your allocator\textquotesingle{}s entry points. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. This call only fails when used between \doxyref{P\+H\+Y\+S\+F\+S\+\_\+init()}{p.}{physfs_8h_a61b94cac8e65267afb8a5f2344e60dd1} and \doxyref{P\+H\+Y\+S\+F\+S\+\_\+deinit()}{p.}{physfs_8h_aa465c9b58e5020f503085d433a413b5b} calls. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer@{P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer}}
\index{P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer@{P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+set\+Buffer (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{bufsize}
\end{DoxyParamCaption}
)}\label{physfs_8h_aede5de47197e1a613d2091802befc886}


Set up buffering for a Physics\+F\+S file handle. 

Define an i/o buffer for a file handle. A memory block of (bufsize) bytes will be allocated and associated with (handle).

For files opened for reading, up to (bufsize) bytes are read from (handle) and stored in the internal buffer. Calls to \doxyref{P\+H\+Y\+S\+F\+S\+\_\+read()}{p.}{physfs_8h_a91234f576477f7de67d635761d01aa7b} will pull from this buffer until it is empty, and then refill it for more reading. Note that compressed files, like Z\+I\+P archives, will decompress while buffering, so this can be handy for offsetting C\+P\+U-\/intensive operations. The buffer isn\textquotesingle{}t filled until you do your next read.

For files opened for writing, data will be buffered to memory until the buffer is full or the buffer is flushed. Closing a handle implicitly causes a flush...check your return values!

Seeking, etc transparently accounts for buffering.

You can resize an existing buffer by calling this function more than once on the same file. Setting the buffer size to zero will free an existing buffer.

Physics\+F\+S file handles are unbuffered by default.

Please check the return value of this function! Failures can include not being able to seek backwards in a read-\/only file when removing the buffer, not being able to allocate the buffer, and not being able to flush the buffer to disk, among other unexpected problems.


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
{\em bufsize} & size, in bytes, of buffer to allocate. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero if successful, zero on error.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+flush}{p.}{physfs_8h_a3fd8f9cfdfd09f4fb778a386d8e97e8a} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+read}{p.}{physfs_8h_a91234f576477f7de67d635761d01aa7b} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+write}{p.}{physfs_8h_af5dc83d5e4ef0b0c9bce1834ea1bb498} 

\doxyref{P\+H\+Y\+S\+F\+S\+\_\+close}{p.}{physfs_8h_a6822f8ff10073e855a1c3a6485b882f2} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config@{P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config}}
\index{P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config@{P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+set\+Sane\+Config (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{organization, }
\item[{const char $\ast$}]{app\+Name, }
\item[{const char $\ast$}]{archive\+Ext, }
\item[{int}]{include\+Cd\+Roms, }
\item[{int}]{archives\+First}
\end{DoxyParamCaption}
)}\label{physfs_8h_afef8700f714b6800ff688372c540bfe2}


Set up sane, default paths. 

Helper function.

The write dir will be set to \char`\"{}userdir/.\+organization/app\+Name\char`\"{}, which is created if it doesn\textquotesingle{}t exist.

The above is sufficient to make sure your program\textquotesingle{}s configuration directory is separated from other clutter, and platform-\/independent. The period before \char`\"{}mygame\char`\"{} even hides the directory on Unix systems.

The search path will be\+:


\begin{DoxyItemize}
\item The Write Dir (created if it doesn\textquotesingle{}t exist)
\item The Base Dir (\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Base\+Dir()}{p.}{physfs_8h_a0034c327dfb381a1c95deb80878bcede})
\item All found C\+D-\/\+R\+O\+M dirs (optionally)
\end{DoxyItemize}

These directories are then searched for files ending with the extension (archive\+Ext), which, if they are valid and supported archives, will also be added to the search path. If you specified \char`\"{}\+P\+K\+G\char`\"{} for (archive\+Ext), and there\textquotesingle{}s a file named data.\+P\+K\+G in the base dir, it\textquotesingle{}ll be checked. Archives can either be appended or prepended to the search path in alphabetical order, regardless of which directories they were found in.

All of this can be accomplished from the application, but this just does it all for you. Feel free to add more to the search path manually, too.


\begin{DoxyParams}{Parameters}
{\em organization} & Name of your company/group/etc to be used as a dirname, so keep it small, and no-\/frills.\\
\hline
{\em app\+Name} & Program-\/specific name of your program, to separate it from other programs using Physics\+F\+S.\\
\hline
{\em archive\+Ext} & File extension used by your program to specify an archive. For example, Quake 3 uses \char`\"{}pk3\char`\"{}, even though they are just zipfiles. Specify N\+U\+L\+L to not dig out archives automatically. Do not specify the \textquotesingle{}.\textquotesingle{} char; If you want to look for Z\+I\+P files, specify \char`\"{}\+Z\+I\+P\char`\"{} and not \char`\"{}.\+Z\+I\+P\char`\"{} ... the archive search is case-\/insensitive.\\
\hline
{\em include\+Cd\+Roms} & Non-\/zero to include C\+D-\/\+R\+O\+Ms in the search path, and (if (archive\+Ext) != N\+U\+L\+L) search them for archives. This may cause a significant amount of blocking while discs are accessed, and if there are no discs in the drive (or even not mounted on Unix systems), then they may not be made available anyhow. You may want to specify zero and handle the disc setup yourself.\\
\hline
{\em archives\+First} & Non-\/zero to prepend the archives to the search path. Zero to append them. Ignored if !(archive\+Ext).\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
nonzero on success, zero on error. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir}}
\index{P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir@{P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+set\+Write\+Dir (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{new\+Dir}
\end{DoxyParamCaption}
)}\label{physfs_8h_a36c408d40b3a93c8f9fc02a16c02e430}


Tell Physics\+F\+S where it may write files. 

Set a new write dir. This will override the previous setting.

This call will fail (and fail to change the write dir) if the current write dir still has files open in it.


\begin{DoxyParams}{Parameters}
{\em new\+Dir} & The new directory to be the root of the write dir, specified in platform-\/dependent notation. Setting to N\+U\+L\+L disables the write dir, so no files can be opened for writing via Physics\+F\+S. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
non-\/zero on success, zero on failure. All attempts to open a file for writing via Physics\+F\+S will fail until this call succeeds. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Write\+Dir}{p.}{physfs_8h_a6533ff91180a4c8abfe24d458f6b9915} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types@{P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types}}
\index{P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types@{P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info} $\ast$$\ast$ P\+H\+Y\+S\+F\+S\+\_\+supported\+Archive\+Types (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a4ca65fbaa485d68113912bbbd70bd19e}


Get a list of supported archive types. 

Get a list of archive types supported by this implementation of Physic\+F\+S. These are the file formats usable for search path entries. This is for informational purposes only. Note that the extension listed is merely convention\+: if we list \char`\"{}\+Z\+I\+P\char`\"{}, you can open a Pk\+Zip-\/compatible archive with an extension of \char`\"{}\+X\+Y\+Z\char`\"{}, if you like.

The returned value is an array of pointers to \doxyref{P\+H\+Y\+S\+F\+S\+\_\+\+Archive\+Info}{p.}{structPHYSFS__ArchiveInfo} structures, with a N\+U\+L\+L entry to signify the end of the list\+:


\begin{DoxyCode}
1 PHYSFS\_ArchiveInfo **i;
2 
3 for (i = PHYSFS\_supportedArchiveTypes(); *i != NULL; i++)
4 \{
5     printf("Supported archive: [%s], which is [%s].\(\backslash\)n",
6              (*i)->extension, (*i)->description);
7 \}
\end{DoxyCode}


The return values are pointers to static internal memory, and should be considered R\+E\+A\+D O\+N\+L\+Y, and never freed.

\begin{DoxyReturn}{Returns}
R\+E\+A\+D O\+N\+L\+Y Null-\/terminated array of R\+E\+A\+D O\+N\+L\+Y structures. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a5fc8e4b9696316e25e3f6422910726c6}


Swap bigendian signed 16 to platform\textquotesingle{}s native byte order. 

Take a 16-\/bit signed value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a8908fb655aa60f0feb2f1662c93c8a0e}


Swap bigendian signed 32 to platform\textquotesingle{}s native byte order. 

Take a 32-\/bit signed value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a974af7dedc1125735efd9b14e23f20e6}


Swap bigendian signed 64 to platform\textquotesingle{}s native byte order. 

Take a 64-\/bit signed value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a73f900bb3ed3a2df81cf7c12b83b0fd4}


Swap littleendian signed 16 to platform\textquotesingle{}s native byte order. 

Take a 16-\/bit signed value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a9b59892fb2846084a272c1bfc4aade4e}


Swap littleendian signed 32 to platform\textquotesingle{}s native byte order. 

Take a 32-\/bit signed value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+swap\+S\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_af032bd8e6116b2b3b6de279cb05b98a8}


Swap littleendian signed 64 to platform\textquotesingle{}s native byte order. 

Take a 64-\/bit signed value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a056321eea71215938431ad4501c2cf9c}


Swap bigendian unsigned 16 to platform\textquotesingle{}s native byte order. 

Take a 16-\/bit unsigned value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a464ba8bc7f121e7f31423ad5d2ec6ed2}


Swap bigendian unsigned 32 to platform\textquotesingle{}s native byte order. 

Take a 32-\/bit unsigned value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6c9b62d93cd121039c00554cb627a425}


Swap bigendian unsigned 64 to platform\textquotesingle{}s native byte order. 

Take a 64-\/bit unsigned value in bigendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_acb9b90e29f097f4feaa4568ec405db01}


Swap littleendian unsigned 16 to platform\textquotesingle{}s native byte order. 

Take a 16-\/bit unsigned value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a6e86a4c1461dc47784e3f68034ad97c9}


Swap littleendian unsigned 32 to platform\textquotesingle{}s native byte order. 

Take a 32-\/bit unsigned value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64} P\+H\+Y\+S\+F\+S\+\_\+swap\+U\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a4b7249bf3cae48f1e04d99505011f280}


Swap littleendian unsigned 64 to platform\textquotesingle{}s native byte order. 

Take a 64-\/bit unsigned value in littleendian format and convert it to the platform\textquotesingle{}s native byte order.


\begin{DoxyParams}{Parameters}
{\em val} & value to convert \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted value.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted@{P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted}}
\index{P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted@{P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+symbolic\+Links\+Permitted (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{physfs_8h_a5223ccbe06246dd5379d6a57d6cd0d87}


Determine if the symbolic links are permitted. 

This reports the setting from the last call to \doxyref{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links()}{p.}{physfs_8h_aad451d9b3f46f627a1be8caee2eef9b7}. If \doxyref{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links()}{p.}{physfs_8h_aad451d9b3f46f627a1be8caee2eef9b7} hasn\textquotesingle{}t been called since the library was last initialized, symbolic links are implicitly disabled.

\begin{DoxyReturn}{Returns}
non-\/zero if symlinks are permitted, zero if not.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+permit\+Symbolic\+Links}{p.}{physfs_8h_aad451d9b3f46f627a1be8caee2eef9b7} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+tell@{P\+H\+Y\+S\+F\+S\+\_\+tell}}
\index{P\+H\+Y\+S\+F\+S\+\_\+tell@{P\+H\+Y\+S\+F\+S\+\_\+tell}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+tell}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+tell (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0d481bdd4cf32ed1a41540ee59840c24}


Determine current position within a Physics\+F\+S filehandle. 


\begin{DoxyParams}{Parameters}
{\em handle} & handle returned from P\+H\+Y\+S\+F\+S\+\_\+open$\ast$(). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
offset in bytes from start of file. -\/1 if error occurred. Specifics of the error can be gleaned from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\doxyref{P\+H\+Y\+S\+F\+S\+\_\+seek}{p.}{physfs_8h_ae562b45b1e1b02505ce1d82ad785f04a} 
\end{DoxySeeAlso}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1}}
\index{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Latin1 (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{src, }
\item[{char $\ast$}]{dst, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{len}
\end{DoxyParamCaption}
)}\label{physfs_8h_a2838ad1240439afd3a21109ea7138014}


Convert a U\+T\+F-\/8 string to a Latin1 string. 

Latin1 strings are 8-\/bits per character\+: a popular \char`\"{}high A\+S\+C\+I\+I\char`\"{} encoding.

To ensure that the destination buffer is large enough for the conversion, please allocate a buffer that is double the size of the source buffer. U\+T\+F-\/8 expands latin1 codepoints over 127 from 1 to 2 bytes, so the string may grow in some cases.

Strings that don\textquotesingle{}t fit in the destination buffer will be truncated, but will always be null-\/terminated and never have an incomplete U\+T\+F-\/8 sequence at the end. If the buffer length is 0, this function does nothing.

Please note that we do not supply a U\+T\+F-\/8 to Latin1 converter, since Latin1 can\textquotesingle{}t express most Unicode codepoints. It\textquotesingle{}s a legacy encoding; you should be converting away from it at all times.


\begin{DoxyParams}{Parameters}
{\em src} & Null-\/terminated source string in Latin1 format. \\
\hline
{\em dst} & Buffer to store converted U\+T\+F-\/8 string. \\
\hline
{\em len} & Size, in bytes, of destination buffer. \\
\hline
\end{DoxyParams}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2}}
\index{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs2 (
\begin{DoxyParamCaption}
\item[{const {\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$}]{src, }
\item[{char $\ast$}]{dst, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{len}
\end{DoxyParamCaption}
)}\label{physfs_8h_ac4fdac7e09fb03ccdccdeed997f09c1a}


Convert a U\+C\+S-\/2 string to a U\+T\+F-\/8 string. 

U\+C\+S-\/2 strings are 16-\/bits per character\+: {\ttfamily T\+C\+H\+A\+R} on Windows, when building with Unicode support.

To ensure that the destination buffer is large enough for the conversion, please allocate a buffer that is double the size of the source buffer. U\+T\+F-\/8 never uses more than 32-\/bits per character, so while it may shrink a U\+C\+S-\/2 string, it may also expand it.

Strings that don\textquotesingle{}t fit in the destination buffer will be truncated, but will always be null-\/terminated and never have an incomplete U\+T\+F-\/8 sequence at the end. If the buffer length is 0, this function does nothing.

Please note that U\+C\+S-\/2 is not U\+T\+F-\/16; we do not support the \char`\"{}surrogate\char`\"{} values at this time.


\begin{DoxyParams}{Parameters}
{\em src} & Null-\/terminated source string in U\+C\+S-\/2 format. \\
\hline
{\em dst} & Buffer to store converted U\+T\+F-\/8 string. \\
\hline
{\em len} & Size, in bytes, of destination buffer. \\
\hline
\end{DoxyParams}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4}}
\index{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+utf8\+From\+Ucs4 (
\begin{DoxyParamCaption}
\item[{const {\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$}]{src, }
\item[{char $\ast$}]{dst, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{len}
\end{DoxyParamCaption}
)}\label{physfs_8h_ac18c9c45db1be6fd26be19d0f4d25a60}


Convert a U\+C\+S-\/4 string to a U\+T\+F-\/8 string. 

U\+C\+S-\/4 strings are 32-\/bits per character\+: {\ttfamily wchar\+\_\+t} on Unix.

To ensure that the destination buffer is large enough for the conversion, please allocate a buffer that is the same size as the source buffer. U\+T\+F-\/8 never uses more than 32-\/bits per character, so while it may shrink a U\+C\+S-\/4 string, it will never expand it.

Strings that don\textquotesingle{}t fit in the destination buffer will be truncated, but will always be null-\/terminated and never have an incomplete U\+T\+F-\/8 sequence at the end. If the buffer length is 0, this function does nothing.


\begin{DoxyParams}{Parameters}
{\em src} & Null-\/terminated source string in U\+C\+S-\/4 format. \\
\hline
{\em dst} & Buffer to store converted U\+T\+F-\/8 string. \\
\hline
{\em len} & Size, in bytes, of destination buffer. \\
\hline
\end{DoxyParams}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2}}
\index{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2}]{\setlength{\rightskip}{0pt plus 5cm}P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs2 (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{src, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16} $\ast$}]{dst, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{len}
\end{DoxyParamCaption}
)}\label{physfs_8h_a0ab51c265f7ca4e8218d6c74b4f43401}


Convert a U\+T\+F-\/8 string to a U\+C\+S-\/2 string. 

U\+C\+S-\/2 strings are 16-\/bits per character\+: {\ttfamily T\+C\+H\+A\+R} on Windows, when building with Unicode support.

To ensure that the destination buffer is large enough for the conversion, please allocate a buffer that is double the size of the source buffer. U\+T\+F-\/8 uses from one to four bytes per character, but U\+C\+S-\/2 always uses two, so an entirely low-\/\+A\+S\+C\+I\+I string will double in size!

Strings that don\textquotesingle{}t fit in the destination buffer will be truncated, but will always be null-\/terminated and never have an incomplete U\+C\+S-\/2 sequence at the end. If the buffer length is 0, this function does nothing.

Please note that U\+C\+S-\/2 is not U\+T\+F-\/16; we do not support the \char`\"{}surrogate\char`\"{} values at this time.


\begin{DoxyParams}{Parameters}
{\em src} & Null-\/terminated source string in U\+T\+F-\/8 format. \\
\hline
{\em dst} & Buffer to store converted U\+C\+S-\/2 string. \\
\hline
{\em len} & Size, in bytes, of destination buffer. \\
\hline
\end{DoxyParams}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4}}
\index{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4@{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4}]{\setlength{\rightskip}{0pt plus 5cm}void P\+H\+Y\+S\+F\+S\+\_\+utf8\+To\+Ucs4 (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{src, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32} $\ast$}]{dst, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{len}
\end{DoxyParamCaption}
)}\label{physfs_8h_a3ff1045e71cd4c14607973da7bfc41e5}


Convert a U\+T\+F-\/8 string to a U\+C\+S-\/4 string. 

U\+C\+S-\/4 strings are 32-\/bits per character\+: {\ttfamily wchar\+\_\+t} on Unix.

To ensure that the destination buffer is large enough for the conversion, please allocate a buffer that is four times the size of the source buffer. U\+T\+F-\/8 uses from one to four bytes per character, but U\+C\+S-\/4 always uses four, so an entirely low-\/\+A\+S\+C\+I\+I string will quadruple in size!

Strings that don\textquotesingle{}t fit in the destination buffer will be truncated, but will always be null-\/terminated and never have an incomplete U\+C\+S-\/4 sequence at the end. If the buffer length is 0, this function does nothing.


\begin{DoxyParams}{Parameters}
{\em src} & Null-\/terminated source string in U\+T\+F-\/8 format. \\
\hline
{\em dst} & Buffer to store converted U\+C\+S-\/4 string. \\
\hline
{\em len} & Size, in bytes, of destination buffer. \\
\hline
\end{DoxyParams}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write@{P\+H\+Y\+S\+F\+S\+\_\+write}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write@{P\+H\+Y\+S\+F\+S\+\_\+write}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write}]{\setlength{\rightskip}{0pt plus 5cm}{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64} P\+H\+Y\+S\+F\+S\+\_\+write (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{handle, }
\item[{const void $\ast$}]{buffer, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{obj\+Size, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{obj\+Count}
\end{DoxyParamCaption}
)}\label{physfs_8h_af5dc83d5e4ef0b0c9bce1834ea1bb498}


Write data to a Physics\+F\+S filehandle. 

The file must be opened for writing.


\begin{DoxyParams}{Parameters}
{\em handle} & retval from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Write()}{p.}{physfs_8h_abbf92d66c6cb82d0ede969aa2c964fba} or \doxyref{P\+H\+Y\+S\+F\+S\+\_\+open\+Append()}{p.}{physfs_8h_abeeca12e2fe7c5f68cbd67e2e5cafa3d}. \\
\hline
{\em buffer} & buffer of bytes to write to (handle). \\
\hline
{\em obj\+Size} & size in bytes of objects being written to (handle). \\
\hline
{\em obj\+Count} & number of (obj\+Size) objects to write to (handle). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of objects written. \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6} can shed light on the reason this might be $<$ (obj\+Count). -\/1 if complete failure. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a621ed6d4cb61f9f31efb58acbe3090e3}


Convert and write a signed 16-\/bit bigendian value. 

Convenience function. Convert a signed 16-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a065910571b8d1bc82eb6ef8e93936028}


Convert and write a signed 32-\/bit bigendian value. 

Convenience function. Convert a signed 32-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_ab5f40bbc37733f52fde58e7a5bc55341}


Convert and write a signed 64-\/bit bigending value. 

Convenience function. Convert a signed 64-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_aeaee4b15c4d683a1996ffc72d1d2a6aa}


Convert and write a signed 16-\/bit littleendian value. 

Convenience function. Convert a signed 16-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a3a702d04d16b0fa732905b0e7daab407}


Convert and write a signed 32-\/bit littleendian value. 

Convenience function. Convert a signed 32-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+S\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+sint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_ab48f7be67e4d68315709e7b3fa48f34b}


Convert and write a signed 64-\/bit littleendian value. 

Convenience function. Convert a signed 64-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a66a392f7637bb2ad4c3e395e1a71c54e}


Convert and write an unsigned 16-\/bit bigendian value. 

Convenience function. Convert an unsigned 16-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a98a497bc47cb177fe1bf835abe28baad}


Convert and write an unsigned 32-\/bit bigendian value. 

Convenience function. Convert an unsigned 32-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+B\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a03fc124e5dfd2801361eeefcee7d1ff7}


Convert and write an unsigned 64-\/bit bigendian value. 

Convenience function. Convert an unsigned 64-\/bit value from the platform\textquotesingle{}s native byte order to bigendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E16 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint16}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_add6bdd5da0e7466b2bace0c914bcf3ac}


Convert and write an unsigned 16-\/bit littleendian value. 

Convenience function. Convert an unsigned 16-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E32 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint32}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_a9566e5d04e793b851dc7b9c26f3b23cb}


Convert and write an unsigned 32-\/bit littleendian value. 

Convenience function. Convert an unsigned 32-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}. 
\end{DoxyReturn}
\index{physfs.\+h@{physfs.\+h}!P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64}}
\index{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64@{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64}!physfs.\+h@{physfs.\+h}}
\subsubsection[{P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64}]{\setlength{\rightskip}{0pt plus 5cm}int P\+H\+Y\+S\+F\+S\+\_\+write\+U\+L\+E64 (
\begin{DoxyParamCaption}
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+\+File} $\ast$}]{file, }
\item[{{\bf P\+H\+Y\+S\+F\+S\+\_\+uint64}}]{val}
\end{DoxyParamCaption}
)}\label{physfs_8h_aaeb795dbdde0fb87fbc8b92471fb85ab}


Convert and write an unsigned 64-\/bit littleendian value. 

Convenience function. Convert an unsigned 64-\/bit value from the platform\textquotesingle{}s native byte order to littleendian and write it to a file.


\begin{DoxyParams}{Parameters}
{\em file} & Physics\+F\+S file handle to which to write. \\
\hline
{\em val} & Value to convert and write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
zero on failure, non-\/zero on success. On failure, you can find out what went wrong from \doxyref{P\+H\+Y\+S\+F\+S\+\_\+get\+Last\+Error()}{p.}{physfs_8h_a9f78e4ab560885fd10202988d2fff1b6}.
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
Remember, P\+H\+Y\+S\+F\+S\+\_\+uint64 is only 32 bits on platforms without any sort of 64-\/bit support. 
\end{DoxyWarning}
