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.

78 lines
3.0 KiB

  1. #ifndef _COMMON_HPP_
  2. #define _COMMON_HPP_
  3. // Ruler
  4. // 1 2 3 4 5 6 7 8
  5. //345678901234567890123456789012345678901234567890123456789012345678901234567890
  6. /********************************************************************/
  7. /* */
  8. /* The standard layout. */
  9. /* */
  10. /* The standard layout for 'hpp' files for this code is as */
  11. /* follows: */
  12. /* */
  13. /* 1. Include files. */
  14. /* 2. Constants exported from the class. */
  15. /* 3. Data structures exported from the class. */
  16. /* 4. Forward references to other data structures. */
  17. /* 5. Class specifications (including inline functions). */
  18. /* 6. Additional large inline functions. */
  19. /* */
  20. /* Any portion that is not required is simply omitted. */
  21. /* */
  22. /********************************************************************/
  23. #include "Global.hpp"
  24. #include "Assembly.hpp"
  25. /********************************************************************/
  26. /* */
  27. /* A collection of common functions. */
  28. /* */
  29. /* This class contains common functions that are needed */
  30. /* throughout the application. */
  31. /* */
  32. /********************************************************************/
  33. class COMMON : public ASSEMBLY
  34. {
  35. public:
  36. //
  37. // Public functions.
  38. //
  39. COMMON( VOID )
  40. { /* void */ }
  41. STATIC BOOLEAN ConvertDivideToShift( SBIT32 Divisor,SBIT32 *Shift );
  42. STATIC SBIT32 ForceToPowerOfTwo( SBIT32 Value );
  43. STATIC CHAR *LowerCase( CHAR *Text );
  44. STATIC CHAR *LowerCase( CHAR *Text,SBIT32 Size );
  45. STATIC BOOLEAN PowerOfTwo( SBIT32 Value );
  46. #ifndef DISABLE_ATOMIC_FLAGS
  47. STATIC VOID SetFlags( SBIT32 *CurrentFlags,SBIT32 NewFlags );
  48. STATIC VOID UnsetFlags( SBIT32 *CurrentFlags,SBIT32 NewFlags );
  49. STATIC CHAR *UpperCase( CHAR *Text );
  50. STATIC CHAR *UpperCase( CHAR *Text,SBIT32 Size );
  51. #endif
  52. ~COMMON( VOID )
  53. { /* void */ }
  54. private:
  55. //
  56. // Disabled operations.
  57. //
  58. COMMON( CONST COMMON & Copy );
  59. VOID operator=( CONST COMMON & Copy );
  60. };
  61. #endif