Leaked source code of windows server 2003
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.

142 lines
4.2 KiB

  1. /*
  2. * Adobe Universal Font Library
  3. *
  4. * Copyright (c) 1996 Adobe Systems Inc.
  5. * All Rights Reserved
  6. *
  7. * UFLStrm.h -- UFL Output Stream
  8. *
  9. *
  10. * $Header:
  11. */
  12. #ifndef _H_UFLStrm
  13. #define _H_UFLStrm
  14. /*===============================================================================*
  15. * Include files used by this interface *
  16. *===============================================================================*/
  17. #include "UFL.h"
  18. /*===============================================================================*
  19. * Theory of Operation *
  20. *===============================================================================*/
  21. /*
  22. UFL Output stream buffers and output data in different format such as eexec encrypt data format, and ASCIIHex.
  23. */
  24. /*===============================================================================*
  25. * Constants/Macros *
  26. *===============================================================================*/
  27. #ifdef MAC_ENV
  28. /* Place Mac Macros here.... !!! MAC - Check its correctness!!! */
  29. #define GET_HIBYTE(c) (((c) & 0x00FF) >> 8)
  30. #define GET_LOBYTE(c) ((c) & 0xFF00)
  31. #else
  32. /* Windows/Intel Macros */
  33. #define GET_HIBYTE(c) (((c) & 0xFF00) >> 8)
  34. #define GET_LOBYTE(c) ((c) & 0x00FF)
  35. #endif
  36. /*===============================================================================*
  37. * Scalar Types *
  38. *===============================================================================*/
  39. /*==================================================================================================*
  40. * UFLOutStream *
  41. *==================================================================================================*/
  42. typedef struct UFLOutStream {
  43. const UFLMemObj *pMem;
  44. const UFLStream *pStream;
  45. UFLBool flOutputAscii;
  46. unsigned long lAddEOL;
  47. } UFLOutStream;
  48. /* Public methods */
  49. UFLHANDLE StrmInit(
  50. const UFLMemObj *pMem,
  51. const UFLStream *stream,
  52. const UFLBool outputAscii
  53. );
  54. void StrmCleanUp(
  55. const UFLHANDLE h
  56. );
  57. UFLErrCode StrmPutBytes (
  58. const UFLHANDLE h,
  59. const char *data,
  60. const UFLsize_t len,
  61. const UFLBool bAscii
  62. );
  63. UFLErrCode StrmPutAsciiHex(
  64. const UFLHANDLE h,
  65. const char *data,
  66. const unsigned long len
  67. );
  68. UFLErrCode
  69. StrmPutWordAsciiHex(
  70. const UFLHANDLE h,
  71. const unsigned short wData
  72. );
  73. UFLErrCode StrmPutAscii85(
  74. const UFLHANDLE h,
  75. const char *data,
  76. const unsigned long len
  77. );
  78. UFLErrCode StrmPutString(
  79. const UFLHANDLE h,
  80. const char *data
  81. );
  82. UFLErrCode StrmPutStringBinary(
  83. const UFLHANDLE h,
  84. const char *data,
  85. const unsigned long len
  86. );
  87. UFLErrCode StrmPutInt(
  88. const UFLHANDLE h,
  89. const long int i
  90. );
  91. UFLErrCode StrmPutFixed(
  92. const UFLHANDLE h,
  93. const UFLFixed f
  94. );
  95. UFLErrCode StrmPutStringEOL(
  96. const UFLHANDLE h,
  97. const char *data
  98. );
  99. UFLErrCode StrmPutMatrix(
  100. const UFLHANDLE h,
  101. const UFLFixedMatrix *matrix,
  102. const UFLBool skipEF
  103. );
  104. #define StrmCanOutputBinary( h ) ( ( ((UFLOutStream *)h)->flOutputAscii ) ? 0 : 1)
  105. /* Private methods */
  106. UFLErrCode Output85(
  107. const UFLHANDLE h,
  108. unsigned long inWord,
  109. short nBytes
  110. );
  111. static void Fixed2CString(
  112. UFLFixed f,
  113. char *s,
  114. short precision,
  115. char skipTrailSpace
  116. );
  117. #endif