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.

104 lines
2.7 KiB

  1. /*******************************************************************************
  2. * Copyright (c) 1998 Gemplus Development
  3. *
  4. * Name : COMPCERT.H
  5. *
  6. * Description :
  7. *
  8. Author : Christophe Clavier
  9. Compiler : Microsoft Visual C 1.5x/2.0
  10. ANSI C UNIX.
  11. Host : IBM PC and compatible machines under Windows 3.x.
  12. UNIX machine.
  13. * Release : 1.10.001
  14. *
  15. * Last Modif. : 04/03/98: V1.10.001 - New dictionary management.
  16. * 27/08/97: V1.00.001 - First implementation.
  17. *
  18. ********************************************************************************
  19. *
  20. * Warning :
  21. *
  22. * Remark :
  23. *
  24. *******************************************************************************/
  25. /*------------------------------------------------------------------------------
  26. Name definition:
  27. _COMPCERT_H is used to avoid multiple inclusion.
  28. ------------------------------------------------------------------------------*/
  29. #ifndef _COMPCERT_H
  30. #define _COMPCERT_H
  31. /* Errors code */
  32. #define RV_SUCCESS 0 /* Info */
  33. #define RV_COMPRESSION_FAILED 1 /* Warning */
  34. #define RV_MALLOC_FAILED 2 /* Error */
  35. #define RV_BAD_DICTIONARY 3 /* Error */
  36. #define RV_INVALID_DATA 4 /* Error */
  37. #define RV_BLOC_TOO_LONG 5 /* Warning */
  38. #define RV_FILE_OPEN_FAILED 6 /* Error */
  39. #define RV_BUFFER_TOO_SMALL 7 /* Error */
  40. /* Dictionary mode */
  41. #define DICT_STANDARD (0) // DLL mode only
  42. #define DICT_REGISTRY (1)
  43. #define DICT_FILE (2)
  44. /*------------------------------------------------------------------------------
  45. Types definitions
  46. ------------------------------------------------------------------------------*/
  47. typedef unsigned char TAG;
  48. typedef TAG* TAG_PTR;
  49. typedef BYTE* BYTE_PTR;
  50. #pragma pack(push, 8)
  51. typedef struct
  52. {
  53. USHORT usLen;
  54. BYTE_PTR pData;
  55. } BLOC, * BLOC_PTR;
  56. typedef struct
  57. {
  58. BLOC Asn1;
  59. BLOC Content;
  60. TAG Tag;
  61. } ASN1, * ASN1_PTR;
  62. #pragma pack(pop)
  63. /*------------------------------------------------------------------------------
  64. Functions Prototypes definitions
  65. ------------------------------------------------------------------------------*/
  66. #ifdef __cplusplus
  67. extern "C"
  68. {
  69. #endif
  70. int CC_Init (BYTE bDictMode,
  71. BYTE *pszDictName
  72. );
  73. int CC_Exit (void);
  74. int CC_Compress (BLOC *pCert,
  75. BLOC *pCompCert
  76. );
  77. int CC_Uncompress(BLOC *pCompCert,
  78. BLOC *pUncompCert
  79. );
  80. #ifdef __cplusplus
  81. }
  82. #endif
  83. #endif