Source code of Windows XP (NT5)
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.

127 lines
2.6 KiB

  1. /***
  2. **
  3. ** Module: FileIO
  4. **
  5. ** Description:
  6. ** This is a module of the T1 to TT font converter. The module
  7. ** is the interface towards all low level I/O functions that are
  8. ** are available on the current platform.
  9. **
  10. ** Author: Michael Jansson
  11. **
  12. ** Created: 5/26/93
  13. **
  14. ***/
  15. #ifndef _ARGS
  16. # define IN const
  17. # define OUT
  18. # define INOUT
  19. # define _ARGS(arg) arg
  20. #endif
  21. #ifndef FASTCALL
  22. # ifdef MSDOS
  23. # define FASTCALL __fastcall
  24. # else
  25. # define FASTCALL
  26. # endif
  27. #endif
  28. #define READONLY 0
  29. #define READWRITE 1
  30. struct ioFile;
  31. /***
  32. ** Function: io_Close
  33. **
  34. ** Description:
  35. ** This function closes an open file.
  36. ***/
  37. errcode io_CloseFile _ARGS((INOUT struct ioFile *fp));
  38. /***
  39. ** Function: io_ReadOneByte
  40. **
  41. ** Description:
  42. ** This function reads one byte from the current position in
  43. ** the given file.
  44. ***/
  45. USHORT FASTCALL io_ReadOneByte _ARGS((INOUT struct ioFile *fp));
  46. /***
  47. ** Function: io_FileError
  48. **
  49. ** Description:
  50. ** This function returns the current error status of the file.
  51. ***/
  52. boolean io_FileError _ARGS((INOUT struct ioFile *fp));
  53. /***
  54. ** Function: io_FileTell
  55. **
  56. ** Description:
  57. ** This function returns the current position in the file.
  58. ***/
  59. long FASTCALL io_FileTell _ARGS((INOUT struct ioFile *fp));
  60. /***
  61. ** Function: io_RemoveFile
  62. **
  63. ** Description:
  64. ** This function removes an already closed file.
  65. ***/
  66. void FASTCALL io_RemoveFile _ARGS((IN char *name));
  67. /***
  68. ** Function: io_OpenFile
  69. **
  70. ** Description:
  71. ** This function opens a file.
  72. ***/
  73. struct ioFile *io_OpenFile _ARGS((IN char *name,
  74. IN int mode));
  75. /***
  76. ** Function: io_FileSeek
  77. **
  78. ** Description:
  79. ** This function moves the current position in the file,
  80. ** relative the beginning of the file.
  81. ***/
  82. long FASTCALL io_FileSeek _ARGS((INOUT struct ioFile *fp,
  83. INOUT long where));
  84. /***
  85. ** Function: io_WriteBytes
  86. **
  87. ** Description:
  88. ** This function writes a number of bytes, starting at the
  89. ** current position in the file.
  90. ***/
  91. USHORT FASTCALL io_WriteBytes _ARGS((IN UBYTE *,
  92. INOUT USHORT, struct ioFile *));
  93. /***
  94. ** Function: io_ReadBytes
  95. **
  96. ** Description:
  97. ** This function reades a number of bytes, starting at the
  98. ** current position in the file.
  99. ***/
  100. USHORT FASTCALL io_ReadBytes _ARGS((INOUT UBYTE *buf,
  101. INOUT USHORT len,
  102. INOUT struct ioFile *fp));