Windows NT 4.0 source code leak
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.

120 lines
2.5 KiB

4 years ago
  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1993 Microsoft Corporation
  3. Module Name:
  4. ilreg.hxx
  5. Abstract:
  6. Type registry for structure/union reuse.
  7. Notes:
  8. This file defines reuse registry for types which may be reused later.
  9. History:
  10. Oct-25-1993 GregJen Created.
  11. ----------------------------------------------------------------------------*/
  12. /****************************************************************************
  13. * include files
  14. ***************************************************************************/
  15. #ifndef __ILREG_HXX__
  16. #define __ILREG_HXX__
  17. #include "nulldefs.h"
  18. extern "C"
  19. {
  20. #include <stdio.h>
  21. #include <assert.h>
  22. }
  23. #include "dict.hxx"
  24. #include "listhndl.hxx"
  25. #include "ilxlat.hxx"
  26. /****************************************************************************
  27. * externs
  28. ***************************************************************************/
  29. extern int CompareReUseKey( void *, void *);
  30. extern void PrintReUseKey( void * );
  31. /****************************************************************************
  32. * class definitions
  33. ***************************************************************************/
  34. class REUSE_INFO
  35. {
  36. public:
  37. node_skl * pType;
  38. CG_CLASS * pSavedCG;
  39. XLAT_SIZE_INFO SizeInfo;
  40. REUSE_INFO( node_skl * pT )
  41. {
  42. pType = pT;
  43. pSavedCG = NULL;
  44. }
  45. void SaveInfo( XLAT_CTXT * pCtxt, CG_CLASS * pCG )
  46. {
  47. SizeInfo.ReturnSize( *pCtxt );
  48. pSavedCG = pCG;
  49. }
  50. void FetchInfo( XLAT_CTXT * pCtxt, CG_CLASS * & pCG )
  51. {
  52. pCtxt->ReturnSize( SizeInfo );
  53. pCG = pSavedCG;
  54. }
  55. void * operator new ( size_t size )
  56. {
  57. return AllocateOnceNew( size );
  58. }
  59. void operator delete( void * ptr )
  60. {
  61. AllocateOnceDelete( ptr );
  62. }
  63. };
  64. class REUSE_DICT : public Dictionary
  65. {
  66. public:
  67. // The constructor and destructors.
  68. REUSE_DICT();
  69. ~REUSE_DICT()
  70. {
  71. }
  72. //
  73. // Register a type.
  74. //
  75. REUSE_INFO * Register( REUSE_INFO * pNode );
  76. // Search for a type.
  77. REUSE_INFO * IsRegistered( REUSE_INFO * pNode );
  78. // Given a type, add it to the dictionary or return existing entry
  79. // true signifies "found"
  80. BOOL GetReUseEntry( REUSE_INFO * & pRI, node_skl * pNode );
  81. void MakeIterator( ITERATOR& Iter );
  82. int Compare( pUserType pL, pUserType pR );
  83. void Print( pUserType pItem )
  84. {
  85. }
  86. };
  87. #endif // __ILREG_HXX__