home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / objam01.lha / objam / runtime / streams.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-11  |  3.2 KB  |  191 lines

  1. /*
  2. ** ObjectiveAmiga: NeXTSTEP NXStream implementation for AmigaOS
  3. ** See GNU:lib/libobjam/ReadMe for details
  4. */
  5.  
  6.  
  7. #include <exec/lists.h>
  8. #include <proto/exec.h>
  9. #include <clib/alib_protos.h>
  10. #include <stddef.h>
  11.  
  12. #include <libraries/objc.h>
  13. #include <clib/objc_protos.h>
  14.  
  15. #include "streams.h"
  16.  
  17. #include "misc.h" /* For the ANSI function emulations */
  18. #include "zone.h" /* For quick access to the default zone */
  19.  
  20.  
  21. /*
  22. ** File and port streams
  23. */
  24.  
  25. NXStream *NXOpenFile(int fd, int mode) /* Open an open()ed file */
  26. {
  27. }
  28.  
  29. NXStream *NXOpenPort(port_t port, int mode) /* Open a mach port */
  30. {
  31. }
  32.  
  33.  
  34. /*
  35. ** Memory streams
  36. */
  37.  
  38. NXStream *NXOpenMemory(const char *address, int size, int mode) /* Open a memory block */
  39. /* 'NULL, 0, NX_WRITEONLY' indicates dynamic memory management */
  40. {
  41. }
  42.  
  43. NXStream *NXMapFile(const char *pathName, int mode) /* Open a file on disk via a memory stream */
  44. {
  45. }
  46.  
  47. int NXSaveToFile(NXStream *stream, const char *name) /* Save stream contents to file */
  48. /* Return value of -1 indicates error */
  49. {
  50. }
  51.  
  52. void NXGetMemoryBuffer(NXStream *stream, char **streambuf, int *len, int *maxlen)
  53. /* Return memory buffer dimensions */
  54. {
  55. }
  56.  
  57. void NXCloseMemory(NXStream *stream, int option) /* Close a memory stream */
  58. /* NX_TRUNCATEBUFFER: free unused memory pages */
  59. /* NX_SAVEBUFFER: don't free */
  60. /* Internal buffers are never freed. Use NXGetMemoryBuffer() and deallocate with vm_deallocate() */
  61. {
  62. }
  63.  
  64.  
  65. /*
  66. ** Close a stream
  67. */
  68.  
  69. void NXClose(NXStream *stream) /* Flush and close any kind of stream */
  70. {
  71. }
  72.  
  73.  
  74. /*
  75. ** Flush a stream
  76. */
  77.  
  78. int NXFlush(NXStream *stream) /* Flush a stream */
  79. /* Returns number of characters written */
  80. {
  81. }
  82.  
  83.  
  84. /*
  85. ** Read/write unformatted data
  86. */
  87.  
  88. int NXRead(NXStream *stream, void *buf, int count) /* Read raw data */
  89. {
  90. }
  91.  
  92. int NXWrite(NXStream *stream, const void *buf, int count) /* Write raw data */
  93. {
  94. }
  95.  
  96.  
  97. /*
  98. ** Read/write formatted data
  99. */
  100.  
  101. int NXPutc(NXStream *stream, char c) /* Write a character */
  102. /* Returns the character written */
  103. {
  104. }
  105.  
  106. int NXGetc(NXStream *stream) /* Read a character */
  107. /* Returns the character read */
  108. {
  109. }
  110.  
  111. void NXUngetc(NXStream *stream) /* Puts back the last *one* character */
  112. {
  113. }
  114.  
  115. int NXScanf(NXStream *stream, const char *format,...)
  116. /* Returns number of characters read for failure, EOF for success */
  117. {
  118. }
  119.  
  120. void NXPrintf(NXStream *stream, const char *format,...)
  121. {
  122. }
  123.  
  124. int NXVScanf(NXStream *stream, const char *format, va_list argList)
  125. /* Returns number of characters read for failure, EOF for success */
  126. {
  127. }
  128.  
  129. void NXVPrintf(NXStream *stream, const char *format, va_list argList)
  130. {
  131. }
  132.  
  133.  
  134. /*
  135. ** Register a formatting procedure
  136. */
  137.  
  138. void NXRegisterPrintfProc(char formatChar, NXPrintProc *proc, void *procData)
  139. {
  140. }
  141.  
  142.  
  143. /*
  144. ** Set or report current position
  145. */
  146.  
  147. void NXSeek(NXStream *stream, long offset, int ptrName)
  148. {
  149. }
  150.  
  151. long NXTell(NXStream *stream)
  152. {
  153. }
  154.  
  155. BOOL NXAtEOS(NXStream *stream)
  156. {
  157. }
  158.  
  159.  
  160. /*
  161. ** Support a user-defined stream
  162. */
  163.  
  164. NXStream *NXStreamCreateFromZone(int mode, int createBuf, NXZone *zone)
  165. {
  166. }
  167.  
  168. NXStream *NXStreamCreate(int mode, int createBuf)
  169. {
  170. }
  171.  
  172. void NXStreamDestroy(NXStream *stream)
  173. {
  174. }
  175.  
  176. int NXDefaultRead(NXStream *stream, void *buf, int count)
  177. {
  178. }
  179.  
  180. int NXDefaultWrite(NXStream *stream, const void *buf, int count)
  181. {
  182. }
  183.  
  184. int NXFill(NXStream *stream)
  185. {
  186. }
  187.  
  188. void NXChangeBuffer(NXStream *stream)
  189. {
  190. }
  191.