skeleton.c 5.2 KB

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