🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.3 KiB

  1. /*
  2. * This code provides a glue layer between PhysicsFS and Simple Directmedia
  3. * Layer's (SDL) RWops i/o abstraction.
  4. *
  5. * License: this code is public domain. I make no warranty that it is useful,
  6. * correct, harmless, or environmentally safe.
  7. *
  8. * This particular file may be used however you like, including copying it
  9. * verbatim into a closed-source project, exploiting it commercially, and
  10. * removing any trace of my name from the source (although I hope you won't
  11. * do that). I welcome enhancements and corrections to this file, but I do
  12. * not require you to send me patches if you make changes. This code has
  13. * NO WARRANTY.
  14. *
  15. * Unless otherwise stated, the rest of PhysicsFS falls under the zlib license.
  16. * Please see LICENSE.txt in the root of the source tree.
  17. *
  18. * SDL 1.2 falls under the LGPL license. SDL 1.3+ is zlib, like PhysicsFS.
  19. * You can get SDL at https://www.libsdl.org/
  20. *
  21. * This file was written by Ryan C. Gordon. (icculus@icculus.org).
  22. */
  23. #ifndef _INCLUDE_PHYSFSRWOPS_H_
  24. #define _INCLUDE_PHYSFSRWOPS_H_
  25. #include "physfs.h"
  26. #include "SDL.h"
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. /**
  31. * Open a platform-independent filename for reading, and make it accessible
  32. * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
  33. * RWops is closed. PhysicsFS should be configured to your liking before
  34. * opening files through this method.
  35. *
  36. * @param filename File to open in platform-independent notation.
  37. * @return A valid SDL_RWops structure on success, NULL on error. Specifics
  38. * of the error can be gleaned from PHYSFS_getLastError().
  39. */
  40. PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname);
  41. /**
  42. * Open a platform-independent filename for writing, and make it accessible
  43. * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
  44. * RWops is closed. PhysicsFS should be configured to your liking before
  45. * opening files through this method.
  46. *
  47. * @param filename File to open in platform-independent notation.
  48. * @return A valid SDL_RWops structure on success, NULL on error. Specifics
  49. * of the error can be gleaned from PHYSFS_getLastError().
  50. */
  51. PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname);
  52. /**
  53. * Open a platform-independent filename for appending, and make it accessible
  54. * via an SDL_RWops structure. The file will be closed in PhysicsFS when the
  55. * RWops is closed. PhysicsFS should be configured to your liking before
  56. * opening files through this method.
  57. *
  58. * @param filename File to open in platform-independent notation.
  59. * @return A valid SDL_RWops structure on success, NULL on error. Specifics
  60. * of the error can be gleaned from PHYSFS_getLastError().
  61. */
  62. PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname);
  63. /**
  64. * Make a SDL_RWops from an existing PhysicsFS file handle. You should
  65. * dispose of any references to the handle after successful creation of
  66. * the RWops. The actual PhysicsFS handle will be destroyed when the
  67. * RWops is closed.
  68. *
  69. * @param handle a valid PhysicsFS file handle.
  70. * @return A valid SDL_RWops structure on success, NULL on error. Specifics
  71. * of the error can be gleaned from PHYSFS_getLastError().
  72. */
  73. PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* include-once blocker */
  78. /* end of physfsrwops.h ... */