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.

147 lines
5.5 KiB

  1. // Copyright (c) Microsoft Corp. 1993-94
  2. /*==============================================================================
  3. The Spool API is a file layer for buffers which supports random access to pages.
  4. This module is compiled to use secure files on IFAX and plain files on Windows.
  5. 27-Oct-93 RajeevD Created.
  6. 06-Dec-93 RajeevD Integrated with render server.
  7. 22-Dec-93 RajeevD Added SpoolReadSetPage.
  8. 06-Sep-94 RajeevD Added SpoolRepairFile.
  9. 09-Sep-94 RajeevD Added SpoolReadCountPages
  10. ==============================================================================*/
  11. #ifndef _FAXSPOOL_
  12. #define _FAXSPOOL_
  13. #include <ifaxos.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef struct // spool file header
  18. {
  19. WORD xRes; // X resolution [dpi]
  20. WORD yRes; // Y resolution [dpi]
  21. WORD cbLine; // X extent [bytes]
  22. }
  23. SPOOL_HEADER, FAR *LPSPOOL_HEADER;
  24. /*==============================================================================
  25. SpoolWriteOpen creates a context for writing buffers to a spool file.
  26. ==============================================================================*/
  27. LPVOID // context pointer (NULL on failure)
  28. WINAPI
  29. SpoolWriteOpen
  30. (
  31. LPVOID lpFilePath, // IFAX file key or Windows file name
  32. LPSPOOL_HEADER lpHeader // image attributes to record in file
  33. );
  34. /*==============================================================================
  35. SpoolWriteBuf dumps buffers to the spool file. The buffers are not freed or
  36. modified. Each page is terminated by passing a buffer with dwMetaData set to
  37. END_OF_PAGE, except the last page, which is terminated by END_OF_JOB. IFAX
  38. files are flushed at the end of each page. This call may fail if the disk
  39. becomes full, in which case the caller is responsible for deleting the file and
  40. destroying the context.
  41. ==============================================================================*/
  42. BOOL // TRUE (success) or FALSE (failure)
  43. WINAPI
  44. SpoolWritePutBuf
  45. (
  46. LPVOID lpContext, // context returned from SpoolWriteOpen
  47. LPBUFFER lpbuf // buffer to be written to spool file
  48. );
  49. /*==============================================================================
  50. SpoolWriteClose destroys a context returned from SpoolWriteOpen.
  51. ==============================================================================*/
  52. void
  53. WINAPI
  54. SpoolWriteClose
  55. (
  56. LPVOID lpContext // context returned from SpoolWriteOpen
  57. );
  58. /*==============================================================================
  59. SpoolRepairFile repairs a truncated file created by SpoolWriteOpen but not
  60. flushed by SpoolWriteClose due to a system failure.
  61. ==============================================================================*/
  62. WORD // number of complete pages recovered
  63. WINAPI
  64. SpoolRepairFile
  65. (
  66. LPVOID lpFileIn, // damaged file
  67. LPVOID lpFileOut // repaired file
  68. );
  69. /*==============================================================================
  70. SpoolReadOpen creates a context for reading buffers from a completed spool file.
  71. ==============================================================================*/
  72. LPVOID // context pointer (NULL on failure)
  73. WINAPI
  74. SpoolReadOpen
  75. (
  76. LPVOID lpFilePath, // IFAX file key or Windows file name
  77. LPSPOOL_HEADER lpHeader // image attributes to fill (or NULL)
  78. );
  79. /*==============================================================================
  80. SpoolReadCountPage returns the number of pages in a spool file.
  81. ==============================================================================*/
  82. WORD // number of pages
  83. WINAPI
  84. SpoolReadCountPages
  85. (
  86. LPVOID lpContext // context returned from SpoolReadOpen
  87. );
  88. /*==============================================================================
  89. SpoolReadSetPage sets the spool file to the start of the specified page.
  90. ==============================================================================*/
  91. BOOL // TRUE (success) or FALSE (failure)
  92. WINAPI
  93. SpoolReadSetPage
  94. (
  95. LPVOID lpContext, // context returned from SpoolReadOpen
  96. WORD iPage // page index (first page has index 0)
  97. );
  98. /*==============================================================================
  99. SpoolReadGetBuf to retrieves the next buffer from the spool file. Each page is
  100. terminated by an END_OF_PAGE buffer, except the last page, which is terminated
  101. by END_OF_JOB. The call may fail if a buffer cannot be allocated.
  102. ==============================================================================*/
  103. LPBUFFER // returns filled buffer (NULL on failure)
  104. WINAPI
  105. SpoolReadGetBuf
  106. (
  107. LPVOID lpContext // context returned from SpoolReadOpen
  108. );
  109. /*==============================================================================
  110. SpoolFreeBuf can free buffers returned from SpoolReadGetBuf.
  111. ==============================================================================*/
  112. BOOL // TRUE (success) or FALSE (failure)
  113. WINAPI
  114. SpoolFreeBuf
  115. (
  116. LPBUFFER lpbuf // buffer returned from SpoolReadGetBuf
  117. );
  118. /*==============================================================================
  119. SpoolReadClose destroys a context returned from SpoolReadOpen.
  120. ==============================================================================*/
  121. void
  122. WINAPI
  123. SpoolReadClose
  124. (
  125. LPVOID lpContext // context returned from SpoolReadOpen
  126. );
  127. #ifdef __cplusplus
  128. } // extern "C"
  129. #endif
  130. #endif // _FAXSPOOL_