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.

247 lines
8.0 KiB

  1. /*
  2. * Copyright (C) 1992-1999 Open Systems Solutions, Inc. All rights reserved
  3. */
  4. /*
  5. * THIS FILE IS PROPRIETARY MATERIAL OF OPEN SYSTEMS SOLUTIONS, INC. AND
  6. * MAY BE USED ONLY BY DIRECT LICENSEES OF OPEN SYSTEMS SOLUTIONS, INC.
  7. * THIS FILE MAY NOT BE DISTRIBUTED.
  8. */
  9. /*
  10. * FILE: @(#)ossglobl.h 5.28.1.2 97/09/24
  11. */
  12. #ifndef OSSGLOBL_H
  13. #define OSSGLOBL_H
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. #include "ossdll.h"
  18. #ifndef OSS_TOED
  19. #define _EncDecGlobals soedData
  20. #endif
  21. #ifndef ossMemMgrVarLen
  22. #ifdef __OS400__
  23. #define ossMemMgrVarLen 100
  24. #define ossEncDecVarLen 500 /* The size of the
  25. encDecVar array shouldn't be less than
  26. the sizeof(world->c) since the latter
  27. structure overlays encDecVar */
  28. #else
  29. #define ossMemMgrVarLen 48
  30. #define ossEncDecVarLen 192 /* The size of the
  31. encDecVar array shouldn't be less than
  32. the sizeof(world->c) since the latter
  33. structure overlays encDecVar */
  34. #endif /* __OS400__ */
  35. #if !defined(EOF) && !defined(_FILE_DEFINED)
  36. typedef char FILE;
  37. #endif /* !EOF && !_FILE_DEFINED */
  38. #ifndef ERR_MSG_LENGTH
  39. #define ERR_MSG_LENGTH 512 /* length of error messages to be output */
  40. #endif
  41. #ifdef __cplusplus
  42. extern "C"
  43. {
  44. #endif
  45. typedef enum {
  46. OSS_BASIC = 0,
  47. OSS_SPARTAN
  48. } OssAPI;
  49. typedef enum {
  50. OSS_BER = 0,
  51. OSS_PER_ALIGNED,
  52. OSS_PER_UNALIGNED,
  53. OSS_DER
  54. } ossEncodingRules;
  55. /*
  56. * List of supported compatibility modes
  57. */
  58. typedef enum {
  59. OSS_CUSTOM_COMPATIBILITY = -2, /* Any combination of compatibility
  60. * flags set by a call to the function
  61. * ossSetCompatibilityFlags() */
  62. OSS_CURRENT_VERSION = 0, /* Current version */
  63. OSS_VERSION_412, /* Includes the following compatibility flags:
  64. * OSS_V412_TIME_AND_WIDE_CHAR_STRINGS,
  65. * OSS_TRUNCATE_0_SECONDS_FROM_GENERALIZED_TIME,
  66. * OSS_TRUNCATE_0_SECONDS_FROM_UTC_TIME and
  67. * OSS_EXTENDED_UNRESTRICTED_CHAR_STRINGS
  68. * OSS_ALLOW_ZERO_LENGTH_OPENTYPE_STRINGS
  69. */
  70. OSS_VERSION_419 /* Includes the following compatibiity flags:
  71. * OSS_TRUNCATE_0_SECONDS_FROM_GENERALIZED_TIME,
  72. OSS_TRUNCATE_0_SECONDS_FROM_UTC_TIME and
  73. OSS_EXTENDED_UNRESTRICTED_CHAR_STRINGS
  74. * OSS_ALLOW_ZERO_LENGTH_OPENTYPE_STRINGS
  75. */
  76. } OssRuntimeVersion;
  77. #if defined(_MSC_VER) && (defined(_WIN32) || defined(WIN32))
  78. #pragma pack(push, ossPacking, 4)
  79. #elif defined(_MSC_VER) && (defined(_WINDOWS) || defined(_MSDOS))
  80. #pragma pack(1)
  81. #elif defined(__BORLANDC__) && defined(__MSDOS__)
  82. #ifdef _BC31
  83. #pragma option -a-
  84. #else
  85. #pragma option -a1
  86. #endif /* _BC31 */
  87. #elif defined(__BORLANDC__) && defined(__WIN32__)
  88. #pragma option -a4
  89. #elif defined(__IBMC__)
  90. #pragma pack(4)
  91. #elif defined(__WATCOMC__) && defined(__NT__)
  92. #pragma pack(push, 4)
  93. #elif defined(__WATCOMC__) && (defined(__WINDOWS__) || defined(__DOS__))
  94. #pragma pack(push, 1)
  95. #endif /* _MSC_VER && _WIN32 */
  96. #ifdef macintosh
  97. #pragma options align=mac68k
  98. #endif
  99. typedef struct ossGlobal {
  100. /*
  101. * used for communicating with the memory manager and the tracing-routine
  102. */
  103. /* low-level memory allocator */
  104. void *(DLL_ENTRY_FPTR *_System mallocp)(size_t p);
  105. /* memory re-allocator */
  106. void *(DLL_ENTRY_FPTR *_System reallocp)(void *p, size_t s);
  107. /* low-level memory freer */
  108. void (DLL_ENTRY_FPTR *_System freep)(void *p);
  109. size_t asn1chop; /* 0 means do not truncate strings; greater
  110. * value means truncate long output strings
  111. * (OCTET STRING, BIT STRING, Character String)
  112. * to be "asn1chop" bytes long. Read by
  113. * encoder&decoder tracing and "printPDU"
  114. */
  115. size_t ossblock; /* if not 0, size of largest block
  116. * to allocate */
  117. size_t ossprefx; /* # bytes to leave before OSAK data buffer */
  118. FILE *asn1out; /* tracing output file */
  119. /* low-level tracing-output function; default is fprintf() */
  120. int (*asn1prnt)(FILE *stream, const char *format, ...);
  121. /*
  122. * available for use by user application
  123. */
  124. void *userVar;
  125. /*
  126. * used for storing DLL- & library NLMs-related parameters
  127. */
  128. #if defined(_WINDOWS) || defined(_WIN32) || \
  129. defined(__OS2__) || defined(NETWARE_DLL)
  130. FunctionTables ft;
  131. #endif /* _WINDOWS || _DLL || __OS2__ || NETWARE_DLL */
  132. /*
  133. * related to the new API; not for direct reference by user code
  134. */
  135. void *ctlTbl;
  136. OssAPI api;
  137. ossEncodingRules encRules;
  138. unsigned long encodingFlags;
  139. unsigned long decodingFlags;
  140. long decodingLength;
  141. char errMsg[ERR_MSG_LENGTH];
  142. /*
  143. * reserved for use by the encoder/decoder
  144. */
  145. double reserved[4];
  146. /*
  147. * reserved for use by the memory manager and the tracing-routine
  148. */
  149. #ifdef storing
  150. struct storHandling t;
  151. #else /* not storing */
  152. long int memMgrVar[ossMemMgrVarLen];
  153. #endif
  154. #if defined(OSS_TOED)
  155. struct _EncDecGlobals c;
  156. #elif defined(coding)
  157. struct _EncDecGlobals c;
  158. #else
  159. long int encDecVar[ossEncDecVarLen];
  160. #endif
  161. } OssGlobal;
  162. #if defined(_MSC_VER) && (defined(_WIN32) || defined(WIN32))
  163. #pragma pack(pop, ossPacking)
  164. #elif defined(_MSC_VER) && (defined(_WINDOWS) || defined(_MSDOS))
  165. #pragma pack()
  166. #elif defined(__BORLANDC__) && (defined(__WIN32__) || defined(__MSDOS__))
  167. #pragma option -a.
  168. #elif defined(__IBMC__)
  169. #pragma pack()
  170. #elif defined(__WATCOMC__)
  171. #pragma pack(pop)
  172. #endif /* _MSC_VER && _WIN32 */
  173. #ifdef macintosh
  174. #pragma options align=reset
  175. #endif
  176. PUBLIC int DLL_ENTRY ossSetEncodingRules(struct ossGlobal *world,
  177. ossEncodingRules rules);
  178. PUBLIC ossEncodingRules DLL_ENTRY ossGetEncodingRules(struct ossGlobal *world);
  179. PUBLIC int DLL_ENTRY ossSetDecodingLength(struct ossGlobal *world,
  180. long bufferLength);
  181. PUBLIC long DLL_ENTRY ossGetDecodingLength(struct ossGlobal *world);
  182. PUBLIC int DLL_ENTRY ossSetEncodingFlags(struct ossGlobal *world,
  183. unsigned long flags);
  184. PUBLIC unsigned long DLL_ENTRY ossGetEncodingFlags(struct ossGlobal *world);
  185. PUBLIC int DLL_ENTRY ossSetDecodingFlags(struct ossGlobal *world,
  186. unsigned long flags);
  187. PUBLIC unsigned long DLL_ENTRY ossGetDecodingFlags(struct ossGlobal *world);
  188. PUBLIC char *DLL_ENTRY ossGetErrMsg(struct ossGlobal *world);
  189. PUBLIC int DLL_ENTRY ossCallerIsDecoder(struct ossGlobal *world);
  190. PUBLIC int DLL_ENTRY ossSetFlags(struct ossGlobal *world,
  191. unsigned long flags);
  192. PUBLIC int DLL_ENTRY ossSetRuntimeVersion(struct ossGlobal *world,
  193. OssRuntimeVersion version);
  194. PUBLIC OssRuntimeVersion DLL_ENTRY ossGetRuntimeVersion(struct ossGlobal *world);
  195. PUBLIC int DLL_ENTRY ossSetCompatibilityFlags(struct ossGlobal *world,
  196. unsigned long flag);
  197. PUBLIC unsigned long DLL_ENTRY ossGetCompatibilityFlags(struct ossGlobal *world);
  198. PUBLIC int DLL_ENTRY ossGetOssGlobalSize(void);
  199. /*
  200. * The following are declarations for link routines
  201. * needed to link the encoding rule or rules specified
  202. * on the compiler command line. The function calls
  203. * are generated by the compiler into _ossinit_...()
  204. * in the control table. These functions are not
  205. * meant to be referenced by user code.
  206. */
  207. PUBLIC void DLL_ENTRY ossLinkAPI(OssGlobal *);
  208. PUBLIC void DLL_ENTRY ossLinkBer(OssGlobal *);
  209. PUBLIC void DLL_ENTRY ossLinkPer(OssGlobal *);
  210. PUBLIC void DLL_ENTRY ossLinkDer(OssGlobal *);
  211. PUBLIC void DLL_ENTRY ossLinkConstraint(OssGlobal *);
  212. PUBLIC void DLL_ENTRY ossLinkUserConstraint(OssGlobal *);
  213. PUBLIC void DLL_ENTRY ossLinkBerReal(OssGlobal *);
  214. PUBLIC void DLL_ENTRY ossLinkPerReal(OssGlobal *);
  215. PUBLIC void DLL_ENTRY ossLinkCmpValue(OssGlobal *);
  216. PUBLIC void DLL_ENTRY ossLinkCpyValue(OssGlobal *);
  217. PUBLIC void DLL_ENTRY ossLinkPerPDV(OssGlobal *);
  218. PUBLIC void DLL_ENTRY ossLinkOid(OssGlobal *);
  219. #ifdef __cplusplus
  220. }
  221. #endif
  222. #endif /* ossMemMgrVarLen */
  223. #endif /* OSSGLOBL_H */