file_stream_transforms.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* Copyright (C) 2010-2018 The RetroArch team
  2. *
  3. * ---------------------------------------------------------------------------------------
  4. * The following license statement only applies to this file (file_stream_transforms.h).
  5. * ---------------------------------------------------------------------------------------
  6. *
  7. * Permission is hereby granted, free of charge,
  8. * to any person obtaining a copy of this software and associated documentation files (the "Software"),
  9. * to deal in the Software without restriction, including without limitation the rights to
  10. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
  11. * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  16. * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  18. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. #ifndef __LIBRETRO_SDK_FILE_STREAM_TRANSFORMS_H
  23. #define __LIBRETRO_SDK_FILE_STREAM_TRANSFORMS_H
  24. #include <stdint.h>
  25. #include <string.h>
  26. #include <retro_common_api.h>
  27. #include <streams/file_stream.h>
  28. RETRO_BEGIN_DECLS
  29. #ifndef SKIP_STDIO_REDEFINES
  30. #define FILE RFILE
  31. #undef fopen
  32. #undef fclose
  33. #undef ftell
  34. #undef fseek
  35. #undef fread
  36. #undef fgets
  37. #undef fgetc
  38. #undef fwrite
  39. #undef fputc
  40. #undef fflush
  41. #undef fprintf
  42. #undef ferror
  43. #undef feof
  44. #undef fscanf
  45. #define fopen rfopen
  46. #define fclose rfclose
  47. #define ftell rftell
  48. #define fseek rfseek
  49. #define fread rfread
  50. #define fgets rfgets
  51. #define fgetc rfgetc
  52. #define fwrite rfwrite
  53. #define fputc rfputc
  54. #define fflush rfflush
  55. #define fprintf rfprintf
  56. #define ferror rferror
  57. #define feof rfeof
  58. #define fscanf rfscanf
  59. #endif
  60. RFILE* rfopen(const char *path, const char *mode);
  61. int rfclose(RFILE* stream);
  62. int64_t rftell(RFILE* stream);
  63. int64_t rfseek(RFILE* stream, int64_t offset, int origin);
  64. int64_t rfread(void* buffer,
  65. size_t elem_size, size_t elem_count, RFILE* stream);
  66. char *rfgets(char *buffer, int maxCount, RFILE* stream);
  67. int rfgetc(RFILE* stream);
  68. int64_t rfwrite(void const* buffer,
  69. size_t elem_size, size_t elem_count, RFILE* stream);
  70. int rfputc(int character, RFILE * stream);
  71. int64_t rfflush(RFILE * stream);
  72. int rfprintf(RFILE * stream, const char * format, ...);
  73. int rferror(RFILE* stream);
  74. int rfeof(RFILE* stream);
  75. int rfscanf(RFILE * stream, const char * format, ...);
  76. RETRO_END_DECLS
  77. #endif