physfs_internal.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. /*
  2. * Internal function/structure declaration. Do NOT include in your
  3. * application.
  4. *
  5. * Please see the file LICENSE in the source's root directory.
  6. *
  7. * This file written by Ryan C. Gordon.
  8. */
  9. #ifndef _INCLUDE_PHYSFS_INTERNAL_H_
  10. #define _INCLUDE_PHYSFS_INTERNAL_H_
  11. #ifndef __PHYSICSFS_INTERNAL__
  12. #error Do not include this header from your applications.
  13. #endif
  14. #include "physfs.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. struct __PHYSFS_DIRHANDLE__;
  19. struct __PHYSFS_FILEFUNCTIONS__;
  20. typedef struct __PHYSFS_LINKEDSTRINGLIST__
  21. {
  22. char *str;
  23. struct __PHYSFS_LINKEDSTRINGLIST__ *next;
  24. } LinkedStringList;
  25. typedef struct __PHYSFS_FILEHANDLE__
  26. {
  27. /*
  28. * This is reserved for the driver to store information.
  29. */
  30. void *opaque;
  31. /*
  32. * This should be the DirHandle that created this FileHandle.
  33. */
  34. const struct __PHYSFS_DIRHANDLE__ *dirHandle;
  35. /*
  36. * Pointer to the file i/o functions for this filehandle.
  37. */
  38. const struct __PHYSFS_FILEFUNCTIONS__ *funcs;
  39. } FileHandle;
  40. typedef struct __PHYSFS_FILEFUNCTIONS__
  41. {
  42. /*
  43. * Read more from the file.
  44. * Returns number of objects of (objSize) bytes read from file, -1
  45. * if complete failure.
  46. * On failure, call __PHYSFS_setError().
  47. */
  48. PHYSFS_sint64 (*read)(FileHandle *handle, void *buffer,
  49. PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
  50. /*
  51. * Write more to the file. Archives don't have to implement this.
  52. * (Set it to NULL if not implemented).
  53. * Returns number of objects of (objSize) bytes written to file, -1
  54. * if complete failure.
  55. * On failure, call __PHYSFS_setError().
  56. */
  57. PHYSFS_sint64 (*write)(FileHandle *handle, const void *buffer,
  58. PHYSFS_uint32 objSize, PHYSFS_uint32 objCount);
  59. /*
  60. * Returns non-zero if at end of file.
  61. */
  62. int (*eof)(FileHandle *handle);
  63. /*
  64. * Returns byte offset from start of file.
  65. */
  66. PHYSFS_sint64 (*tell)(FileHandle *handle);
  67. /*
  68. * Move read/write pointer to byte offset from start of file.
  69. * Returns non-zero on success, zero on error.
  70. * On failure, call __PHYSFS_setError().
  71. */
  72. int (*seek)(FileHandle *handle, PHYSFS_uint64 offset);
  73. /*
  74. * Return number of bytes available in the file, or -1 if you
  75. * aren't able to determine.
  76. * On failure, call __PHYSFS_setError().
  77. */
  78. PHYSFS_sint64 (*fileLength)(FileHandle *handle);
  79. /*
  80. * Close the file, and free the FileHandle structure (including "opaque").
  81. * returns non-zero on success, zero if can't close file.
  82. * On failure, call __PHYSFS_setError().
  83. */
  84. int (*fileClose)(FileHandle *handle);
  85. } FileFunctions;
  86. typedef struct __PHYSFS_DIRHANDLE__
  87. {
  88. /*
  89. * This is reserved for the driver to store information.
  90. */
  91. void *opaque;
  92. /*
  93. * Pointer to the directory i/o functions for this handle.
  94. */
  95. const struct __PHYSFS_DIRFUNCTIONS__ *funcs;
  96. } DirHandle;
  97. /*
  98. * Symlinks should always be followed; PhysicsFS will use
  99. * DirFunctions->isSymLink() and make a judgement on whether to
  100. * continue to call other methods based on that.
  101. */
  102. typedef struct __PHYSFS_DIRFUNCTIONS__
  103. {
  104. /*
  105. * Returns non-zero if (filename) is a valid archive that this
  106. * driver can handle. This filename is in platform-dependent
  107. * notation. forWriting is non-zero if this is to be used for
  108. * the write directory, and zero if this is to be used for an
  109. * element of the search path.
  110. */
  111. int (*isArchive)(const char *filename, int forWriting);
  112. /*
  113. * Return a DirHandle for dir/archive (name).
  114. * This filename is in platform-dependent notation.
  115. * forWriting is non-zero if this is to be used for
  116. * the write directory, and zero if this is to be used for an
  117. * element of the search path.
  118. * Returns NULL on failure, and calls __PHYSFS_setError().
  119. */
  120. DirHandle *(*openArchive)(const char *name, int forWriting);
  121. /*
  122. * Returns a list of all files in dirname. Each element of this list
  123. * (and its "str" field) will be deallocated with the system's free()
  124. * function by the caller, so be sure to explicitly malloc() each
  125. * chunk. Omit symlinks if (omitSymLinks) is non-zero.
  126. * If you have a memory failure, return as much as you can.
  127. * This dirname is in platform-independent notation.
  128. */
  129. LinkedStringList *(*enumerateFiles)(DirHandle *r,
  130. const char *dirname,
  131. int omitSymLinks);
  132. /*
  133. * Returns non-zero if filename can be opened for reading.
  134. * This filename is in platform-independent notation.
  135. */
  136. int (*exists)(DirHandle *r, const char *name);
  137. /*
  138. * Returns non-zero if filename is really a directory.
  139. * This filename is in platform-independent notation.
  140. */
  141. int (*isDirectory)(DirHandle *r, const char *name);
  142. /*
  143. * Returns non-zero if filename is really a symlink.
  144. * This filename is in platform-independent notation.
  145. */
  146. int (*isSymLink)(DirHandle *r, const char *name);
  147. /*
  148. * Open file for reading, and return a FileHandle.
  149. * This filename is in platform-independent notation.
  150. * If you can't handle multiple opens of the same file,
  151. * you can opt to fail for the second call.
  152. * Fail if the file does not exist.
  153. * Returns NULL on failure, and calls __PHYSFS_setError().
  154. */
  155. FileHandle *(*openRead)(DirHandle *r, const char *filename);
  156. /*
  157. * Open file for writing, and return a FileHandle.
  158. * If the file does not exist, it should be created. If it exists,
  159. * it should be truncated to zero bytes. The writing
  160. * offset should be the start of the file.
  161. * This filename is in platform-independent notation.
  162. * This method may be NULL.
  163. * If you can't handle multiple opens of the same file,
  164. * you can opt to fail for the second call.
  165. * Returns NULL on failure, and calls __PHYSFS_setError().
  166. */
  167. FileHandle *(*openWrite)(DirHandle *r, const char *filename);
  168. /*
  169. * Open file for appending, and return a FileHandle.
  170. * If the file does not exist, it should be created. The writing
  171. * offset should be the end of the file.
  172. * This filename is in platform-independent notation.
  173. * This method may be NULL.
  174. * If you can't handle multiple opens of the same file,
  175. * you can opt to fail for the second call.
  176. * Returns NULL on failure, and calls __PHYSFS_setError().
  177. */
  178. FileHandle *(*openAppend)(DirHandle *r, const char *filename);
  179. /*
  180. * Delete a file in the archive/directory.
  181. * Return non-zero on success, zero on failure.
  182. * This filename is in platform-independent notation.
  183. * This method may be NULL.
  184. * On failure, call __PHYSFS_setError().
  185. */
  186. int (*remove)(DirHandle *r, const char *filename);
  187. /*
  188. * Create a directory in the archive/directory.
  189. * If the application is trying to make multiple dirs, PhysicsFS
  190. * will split them up into multiple calls before passing them to
  191. * your driver.
  192. * Return non-zero on success, zero on failure.
  193. * This filename is in platform-independent notation.
  194. * This method may be NULL.
  195. * On failure, call __PHYSFS_setError().
  196. */
  197. int (*mkdir)(DirHandle *r, const char *filename);
  198. /*
  199. * Close directories/archives, and free the handle, including
  200. * the "opaque" entry. This should assume that it won't be called if
  201. * there are still files open from this DirHandle.
  202. */
  203. void (*dirClose)(DirHandle *r);
  204. } DirFunctions;
  205. /* error messages... */
  206. #define ERR_IS_INITIALIZED "Already initialized"
  207. #define ERR_NOT_INITIALIZED "Not initialized"
  208. #define ERR_INVALID_ARGUMENT "Invalid argument"
  209. #define ERR_FILES_STILL_OPEN "Files still open"
  210. #define ERR_NO_DIR_CREATE "Failed to create directories"
  211. #define ERR_OUT_OF_MEMORY "Out of memory"
  212. #define ERR_NOT_IN_SEARCH_PATH "No such entry in search path"
  213. #define ERR_NOT_SUPPORTED "Operation not supported"
  214. #define ERR_UNSUPPORTED_ARCHIVE "Archive type unsupported"
  215. #define ERR_NOT_A_HANDLE "Not a file handle"
  216. #define ERR_INSECURE_FNAME "Insecure filename"
  217. #define ERR_SYMLINK_DISALLOWED "Symbolic links are disabled"
  218. #define ERR_NO_WRITE_DIR "Write directory is not set"
  219. #define ERR_NO_SUCH_FILE "No such file"
  220. #define ERR_PAST_EOF "Past end of file"
  221. #define ERR_ARC_IS_READ_ONLY "Archive is read-only"
  222. #define ERR_IO_ERROR "I/O error"
  223. #define ERR_CANT_SET_WRITE_DIR "Can't set write directory"
  224. #define ERR_TOO_MANY_SYMLINKS "Too many symbolic links"
  225. #define ERR_COMPRESSION "(De)compression error"
  226. /*
  227. * Call this to set the message returned by PHYSFS_getLastError().
  228. * Please only use the ERR_* constants above, or add new constants to the
  229. * above group, but I want these all in one place.
  230. *
  231. * Calling this with a NULL argument is a safe no-op.
  232. */
  233. void __PHYSFS_setError(const char *err);
  234. /*
  235. * Convert (dirName) to platform-dependent notation, then prepend (prepend)
  236. * and append (append) to the converted string.
  237. *
  238. * So, on Win32, calling:
  239. * __PHYSFS_convertToDependent("C:\", "my/files", NULL);
  240. * ...will return the string "C:\my\files".
  241. *
  242. * This is a convenience function; you might want to hack something out that
  243. * is less generic (and therefore more efficient).
  244. *
  245. * Be sure to free() the return value when done with it.
  246. */
  247. char *__PHYSFS_convertToDependent(const char *prepend,
  248. const char *dirName,
  249. const char *append);
  250. /*
  251. * Verify that (fname) (in platform-independent notation), in relation
  252. * to (h) is secure. That means that each element of fname is checked
  253. * for symlinks (if they aren't permitted). Also, elements such as
  254. * ".", "..", or ":" are flagged.
  255. *
  256. * Returns non-zero if string is safe, zero if there's a security issue.
  257. * PHYSFS_getLastError() will specify what was wrong.
  258. */
  259. int __PHYSFS_verifySecurity(DirHandle *h, const char *fname);
  260. /* These get used all over for lessening code clutter. */
  261. #define BAIL_MACRO(e, r) { __PHYSFS_setError(e); return r; }
  262. #define BAIL_IF_MACRO(c, e, r) if (c) { __PHYSFS_setError(e); return r; }
  263. /*--------------------------------------------------------------------------*/
  264. /*--------------------------------------------------------------------------*/
  265. /*------------ ----------------*/
  266. /*------------ You MUST implement the following functions ----------------*/
  267. /*------------ if porting to a new platform. ----------------*/
  268. /*------------ (see platform/unix.c for an example) ----------------*/
  269. /*------------ ----------------*/
  270. /*--------------------------------------------------------------------------*/
  271. /*--------------------------------------------------------------------------*/
  272. /*
  273. * The dir separator; "/" on unix, "\\" on win32, ":" on MacOS, etc...
  274. * Obviously, this isn't a function, but it IS a null-terminated string.
  275. */
  276. extern const char *__PHYSFS_platformDirSeparator;
  277. /*
  278. * Initialize the platform. This is called when PHYSFS_init() is called from
  279. * the application. You can use this to (for example) determine what version
  280. * of Windows you're running.
  281. *
  282. * Return zero if there was a catastrophic failure (which prevents you from
  283. * functioning at all), and non-zero otherwise.
  284. */
  285. int __PHYSFS_platformInit(void);
  286. /*
  287. * Deinitialize the platform. This is called when PHYSFS_deinit() is called
  288. * from the application. You can use this to clean up anything you've
  289. * allocated in your platform driver.
  290. *
  291. * Return zero if there was a catastrophic failure (which prevents you from
  292. * functioning at all), and non-zero otherwise.
  293. */
  294. int __PHYSFS_platformDeinit(void);
  295. /*
  296. * Open a file for reading. (filename) is in platform-dependent notation. The
  297. * file pointer should be positioned on the first byte of the file.
  298. *
  299. * The return value will be some platform-specific datatype that is opaque to
  300. * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32.
  301. *
  302. * The same file can be opened for read multiple times, and each should have
  303. * a unique file handle; this is frequently employed to prevent race
  304. * conditions in the archivers.
  305. *
  306. * Call __PHYSFS_setError() and return (NULL) if the file can't be opened.
  307. */
  308. void *__PHYSFS_platformOpenRead(const char *filename);
  309. /*
  310. * Open a file for writing. (filename) is in platform-dependent notation. If
  311. * the file exists, it should be truncated to zero bytes, and if it doesn't
  312. * exist, it should be created as a zero-byte file. The file pointer should
  313. * be positioned on the first byte of the file.
  314. *
  315. * The return value will be some platform-specific datatype that is opaque to
  316. * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32,
  317. * etc.
  318. *
  319. * Opening a file for write multiple times has undefined results.
  320. *
  321. * Call __PHYSFS_setError() and return (NULL) if the file can't be opened.
  322. */
  323. void *__PHYSFS_platformOpenWrite(const char *filename);
  324. /*
  325. * Open a file for appending. (filename) is in platform-dependent notation. If
  326. * the file exists, the file pointer should be place just past the end of the
  327. * file, so that the first write will be one byte after the current end of
  328. * the file. If the file doesn't exist, it should be created as a zero-byte
  329. * file. The file pointer should be positioned on the first byte of the file.
  330. *
  331. * The return value will be some platform-specific datatype that is opaque to
  332. * the caller; it could be a (FILE *) under Unix, or a (HANDLE *) under win32,
  333. * etc.
  334. *
  335. * Opening a file for append multiple times has undefined results.
  336. *
  337. * Call __PHYSFS_setError() and return (NULL) if the file can't be opened.
  338. */
  339. void *__PHYSFS_platformOpenAppend(const char *filename);
  340. /*
  341. * Read more data from a platform-specific file handle. (opaque) should be
  342. * cast to whatever data type your platform uses. Read a maximum of (count)
  343. * objects of (size) 8-bit bytes to the area pointed to by (buffer). If there
  344. * isn't enough data available, return the number of full objects read, and
  345. * position the file pointer at the start of the first incomplete object.
  346. * On success, return (count) and position the file pointer one byte past
  347. * the end of the last read object. Return (-1) if there is a catastrophic
  348. * error, and call __PHYSFS_setError() to describe the problem; the file
  349. * pointer should not move in such a case.
  350. */
  351. PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
  352. PHYSFS_uint32 size, PHYSFS_uint32 count);
  353. /*
  354. * Write more data to a platform-specific file handle. (opaque) should be
  355. * cast to whatever data type your platform uses. Write a maximum of (count)
  356. * objects of (size) 8-bit bytes from the area pointed to by (buffer). If
  357. * there isn't enough data available, return the number of full objects
  358. * written, and position the file pointer at the start of the first
  359. * incomplete object. Return (-1) if there is a catastrophic error, and call
  360. * __PHYSFS_setError() to describe the problem; the file pointer should not
  361. * move in such a case.
  362. */
  363. PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, void *buffer,
  364. PHYSFS_uint32 size, PHYSFS_uint32 count);
  365. /*
  366. * Set the file pointer to a new position. (opaque) should be cast to
  367. * whatever data type your platform uses. (pos) specifies the number
  368. * of 8-bit bytes to seek to from the start of the file. Seeking past the
  369. * end of the file is an error condition, and you should check for it.
  370. *
  371. * Not all file types can seek; this is to be expected by the caller.
  372. *
  373. * On error, call __PHYSFS_setError() and return zero. On success, return
  374. * a non-zero value.
  375. */
  376. int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos);
  377. /*
  378. * Get the file pointer's position, in an 8-bit byte offset from the start of
  379. * the file. (opaque) should be cast to whatever data type your platform
  380. * uses.
  381. *
  382. * Not all file types can "tell"; this is to be expected by the caller.
  383. *
  384. * On error, call __PHYSFS_setError() and return zero. On success, return
  385. * a non-zero value.
  386. */
  387. PHYSFS_sint64 __PHYSFS_platformTell(void *opaque);
  388. /*
  389. * Determine the current size of a file, in 8-bit bytes, from an open file.
  390. *
  391. * The caller expects that this information may not be available for all
  392. * file types on all platforms.
  393. *
  394. * Return -1 if you can't do it, and call __PHYSFS_setError(). Otherwise,
  395. * return the file length in 8-bit bytes.
  396. */
  397. PHYSFS_sint64 __PHYSFS_platformFileLength(void *handle);
  398. /*
  399. * Determine if a file is at EOF. (opaque) should be cast to whatever data
  400. * type your platform uses.
  401. *
  402. * The caller expects that there was a short read before calling this.
  403. *
  404. * Return non-zero if EOF, zero if it is _not_ EOF.
  405. */
  406. int __PHYSFS_platformEOF(void *opaque);
  407. /*
  408. * Flush any pending writes to disk. (opaque) should be cast to whatever data
  409. * type your platform uses. Be sure to check for errors; the caller expects
  410. * that this function can fail if there was a flushing error, etc.
  411. *
  412. * Return zero on failure, non-zero on success.
  413. */
  414. int __PHYSFS_platformFlush(void *opaque);
  415. /*
  416. * Flush and close a file. (opaque) should be cast to whatever data type
  417. * your platform uses. Be sure to check for errors when closing; the
  418. * caller expects that this function can fail if there was a flushing
  419. * error, etc.
  420. *
  421. * You should clean up all resources associated with (opaque).
  422. *
  423. * Return zero on failure, non-zero on success.
  424. */
  425. int __PHYSFS_platformClose(void *opaque);
  426. /*
  427. * Platform implementation of PHYSFS_getCdRomDirs()...
  428. * See physfs.h. The retval should be freeable via PHYSFS_freeList().
  429. */
  430. char **__PHYSFS_platformDetectAvailableCDs(void);
  431. /*
  432. * Calculate the base dir, if your platform needs special consideration.
  433. * Just return NULL if the standard routines will suffice. (see
  434. * calculateBaseDir() in physfs.c ...)
  435. * Caller will free() the retval if it's not NULL.
  436. */
  437. char *__PHYSFS_platformCalcBaseDir(const char *argv0);
  438. /*
  439. * Get the platform-specific user name.
  440. * Caller will free() the retval if it's not NULL. If it's NULL, the username
  441. * will default to "default".
  442. */
  443. char *__PHYSFS_platformGetUserName(void);
  444. /*
  445. * Get the platform-specific user dir.
  446. * Caller will free() the retval if it's not NULL. If it's NULL, the userdir
  447. * will default to basedir/username.
  448. */
  449. char *__PHYSFS_platformGetUserDir(void);
  450. /*
  451. * Return a number that uniquely identifies the current thread.
  452. * On a platform without threading, (1) will suffice. These numbers are
  453. * arbitrary; the only requirement is that no two threads have the same
  454. * number.
  455. */
  456. PHYSFS_uint64 __PHYSFS_platformGetThreadID(void);
  457. /*
  458. * This is a pass-through to whatever stricmp() is called on your platform.
  459. */
  460. int __PHYSFS_platformStricmp(const char *str1, const char *str2);
  461. /*
  462. * Return non-zero if filename (in platform-dependent notation) exists.
  463. * Symlinks should be followed; if what the symlink points to is missing,
  464. * then the retval is false.
  465. */
  466. int __PHYSFS_platformExists(const char *fname);
  467. /*
  468. * Return non-zero if filename (in platform-dependent notation) is a symlink.
  469. */
  470. int __PHYSFS_platformIsSymLink(const char *fname);
  471. /*
  472. * Return non-zero if filename (in platform-dependent notation) is a symlink.
  473. * Symlinks should be followed; if what the symlink points to is missing,
  474. * or isn't a directory, then the retval is false.
  475. */
  476. int __PHYSFS_platformIsDirectory(const char *fname);
  477. /*
  478. * Convert (dirName) to platform-dependent notation, then prepend (prepend)
  479. * and append (append) to the converted string.
  480. *
  481. * So, on Win32, calling:
  482. * __PHYSFS_platformCvtToDependent("C:\", "my/files", NULL);
  483. * ...will return the string "C:\my\files".
  484. *
  485. * This can be implemented in a platform-specific manner, so you can get
  486. * get a speed boost that the default implementation can't, since
  487. * you can make assumptions about the size of strings, etc..
  488. *
  489. * Platforms that choose not to implement this may just call
  490. * __PHYSFS_convertToDependent() as a passthrough, which may fit the bill
  491. * already.
  492. *
  493. * Be sure to free() the return value when done with it.
  494. */
  495. char *__PHYSFS_platformCvtToDependent(const char *prepend,
  496. const char *dirName,
  497. const char *append);
  498. /*
  499. * Make the current thread give up a timeslice. This is called in a loop
  500. * while waiting for various external forces to get back to us.
  501. */
  502. void __PHYSFS_platformTimeslice(void);
  503. /*
  504. * Enumerate a directory of files. This follows the rules for the
  505. * DirFunctions->enumerateFiles() method (see above), except that the
  506. * (dirName) that is passed to this function is converted to
  507. * platform-DEPENDENT notation by the caller. The DirFunctions version
  508. * uses platform-independent notation. Note that ".", "..", and other
  509. * metaentries should always be ignored.
  510. */
  511. LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname,
  512. int omitSymLinks);
  513. /*
  514. * Get the current working directory. The return value should be an
  515. * absolute path in platform-dependent notation. The caller will deallocate
  516. * the return value with the standard C runtime free() function when it
  517. * is done with it.
  518. * On error, return NULL and set the error message.
  519. */
  520. char *__PHYSFS_platformCurrentDir(void);
  521. /*
  522. * Get the real physical path to a file. (path) is specified in
  523. * platform-dependent notation, as should your return value be.
  524. * All relative paths should be removed, leaving you with an absolute
  525. * path. Symlinks should be resolved, too, so that the returned value is
  526. * the most direct path to a file.
  527. * The return value will be deallocated with the standard C runtime free()
  528. * function when the caller is done with it.
  529. * On error, return NULL and set the error message.
  530. */
  531. char *__PHYSFS_platformRealPath(const char *path);
  532. /*
  533. * Make a directory in the actual filesystem. (path) is specified in
  534. * platform-dependent notation. On error, return zero and set the error
  535. * message. Return non-zero on success.
  536. */
  537. int __PHYSFS_platformMkDir(const char *path);
  538. #ifdef __cplusplus
  539. }
  540. #endif
  541. #endif
  542. /* end of physfs_internal.h ... */