skeleton.c 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /*
  2. * Skeleton platform-dependent support routines for PhysicsFS.
  3. *
  4. * Please see the file LICENSE in the source's root directory.
  5. *
  6. * This file written by Ryan C. Gordon.
  7. */
  8. #define __PHYSICSFS_INTERNAL__
  9. #include "physfs_internal.h"
  10. #error DO NOT COMPILE THIS. IT IS JUST A SKELETON EXAMPLE FILE.
  11. const char *__PHYSFS_platformDirSeparator = ":";
  12. int __PHYSFS_platformInit(void)
  13. {
  14. return(1); /* always succeed. */
  15. } /* __PHYSFS_platformInit */
  16. int __PHYSFS_platformDeinit(void)
  17. {
  18. return(1); /* always succeed. */
  19. } /* __PHYSFS_platformDeinit */
  20. char **__PHYSFS_platformDetectAvailableCDs(void)
  21. {
  22. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  23. } /* __PHYSFS_platformDetectAvailableCDs */
  24. char *__PHYSFS_platformCalcBaseDir(const char *argv0)
  25. {
  26. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  27. } /* __PHYSFS_platformCalcBaseDir */
  28. char *__PHYSFS_platformGetUserName(void)
  29. {
  30. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  31. } /* __PHYSFS_platformGetUserName */
  32. char *__PHYSFS_platformGetUserDir(void)
  33. {
  34. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  35. } /* __PHYSFS_platformGetUserDir */
  36. PHYSFS_uint64 __PHYSFS_platformGetThreadID(void)
  37. {
  38. return(1); /* single threaded. */
  39. } /* __PHYSFS_platformGetThreadID */
  40. int __PHYSFS_platformStricmp(const char *x, const char *y)
  41. {
  42. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  43. } /* __PHYSFS_platformStricmp */
  44. int __PHYSFS_platformExists(const char *fname)
  45. {
  46. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  47. } /* __PHYSFS_platformExists */
  48. int __PHYSFS_platformIsSymLink(const char *fname)
  49. {
  50. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  51. } /* __PHYSFS_platformIsSymlink */
  52. int __PHYSFS_platformIsDirectory(const char *fname)
  53. {
  54. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  55. } /* __PHYSFS_platformIsDirectory */
  56. char *__PHYSFS_platformCvtToDependent(const char *prepend,
  57. const char *dirName,
  58. const char *append)
  59. {
  60. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  61. } /* __PHYSFS_platformCvtToDependent */
  62. void __PHYSFS_platformTimeslice(void)
  63. {
  64. } /* __PHYSFS_platformTimeslice */
  65. LinkedStringList *__PHYSFS_platformEnumerateFiles(const char *dirname,
  66. int omitSymLinks)
  67. {
  68. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  69. } /* __PHYSFS_platformEnumerateFiles */
  70. char *__PHYSFS_platformCurrentDir(void)
  71. {
  72. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  73. } /* __PHYSFS_platformCurrentDir */
  74. char *__PHYSFS_platformRealPath(const char *path)
  75. {
  76. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  77. } /* __PHYSFS_platformRealPath */
  78. int __PHYSFS_platformMkDir(const char *path)
  79. {
  80. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  81. } /* __PHYSFS_platformMkDir */
  82. void *__PHYSFS_platformOpenRead(const char *filename)
  83. {
  84. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  85. } /* __PHYSFS_platformOpenRead */
  86. void *__PHYSFS_platformOpenWrite(const char *filename)
  87. {
  88. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  89. } /* __PHYSFS_platformOpenWrite */
  90. void *__PHYSFS_platformOpenAppend(const char *filename)
  91. {
  92. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  93. } /* __PHYSFS_platformOpenAppend */
  94. PHYSFS_sint64 __PHYSFS_platformRead(void *opaque, void *buffer,
  95. PHYSFS_uint32 size, PHYSFS_uint32 count)
  96. {
  97. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  98. } /* __PHYSFS_platformRead */
  99. PHYSFS_sint64 __PHYSFS_platformWrite(void *opaque, const void *buffer,
  100. PHYSFS_uint32 size, PHYSFS_uint32 count)
  101. {
  102. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  103. } /* __PHYSFS_platformWrite */
  104. int __PHYSFS_platformSeek(void *opaque, PHYSFS_uint64 pos)
  105. {
  106. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  107. } /* __PHYSFS_platformSeek */
  108. PHYSFS_sint64 __PHYSFS_platformTell(void *opaque)
  109. {
  110. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  111. } /* __PHYSFS_platformTell */
  112. PHYSFS_sint64 __PHYSFS_platformFileLength(void *opaque)
  113. {
  114. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  115. } /* __PHYSFS_platformFileLength */
  116. int __PHYSFS_platformEOF(void *opaque)
  117. {
  118. BAIL_MACRO(ERR_NOT_IMPLEMENTED, -1);
  119. } /* __PHYSFS_platformEOF */
  120. int __PHYSFS_platformFlush(void *opaque)
  121. {
  122. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  123. } /* __PHYSFS_platformFlush */
  124. int __PHYSFS_platformClose(void *opaque)
  125. {
  126. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  127. } /* __PHYSFS_platformClose */
  128. int __PHYSFS_platformDelete(const char *path)
  129. {
  130. BAIL_MACRO(ERR_NOT_IMPLEMENTED, 0);
  131. } /* __PHYSFS_platformDelete */
  132. void *__PHYSFS_platformCreateMutex(void)
  133. {
  134. BAIL_MACRO(ERR_NOT_IMPLEMENTED, NULL);
  135. } /* __PHYSFS_platformCreateMutex */
  136. void __PHYSFS_platformDestroyMutex(void *mutex)
  137. {
  138. } /* __PHYSFS_platformDestroyMutex */
  139. int __PHYSFS_platformGrabMutex(void *mutex)
  140. {
  141. /* not implemented, but can't call __PHYSFS_setError! */
  142. return(0);
  143. } /* __PHYSFS_platformGrabMutex */
  144. void __PHYSFS_platformReleaseMutex(void *mutex)
  145. {
  146. /* not implemented, but can't call __PHYSFS_setError! */
  147. } /* __PHYSFS_platformReleaseMutex */
  148. /* end of skeleton.c ... */