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.

136 lines
7.4 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: adcgcfnc.h */
  3. /* */
  4. /* Purpose: C runtime functions - portable include file */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1997 */
  7. /* */
  8. /****************************************************************************/
  9. /** Changes:
  10. * $Log: Y:/logs/h/dcl/adcgcfnc.h_v $
  11. *
  12. * Rev 1.7 06 Aug 1997 14:32:22 AK
  13. * SFR1016: Apply Markups
  14. *
  15. * Rev 1.6 06 Aug 1997 10:40:42 AK
  16. * SFR1016: Complete removal of DCCHAR etc
  17. *
  18. * Rev 1.5 23 Jul 1997 10:47:52 mr
  19. * SFR1079: Merged \server\h duplicates to \h\dcl
  20. *
  21. * Rev 1.4 15 Jul 1997 15:42:48 AK
  22. * SFR1016: Add Unicode support
  23. *
  24. * Rev 1.3 09 Jul 1997 16:56:24 AK
  25. * SFR1016: Initial changes to support Unicode
  26. **/
  27. /**INC-**********************************************************************/
  28. #ifndef _H_ADCGCFNC
  29. #define _H_ADCGCFNC
  30. /****************************************************************************/
  31. /* */
  32. /* INCLUDES */
  33. /* */
  34. /****************************************************************************/
  35. /****************************************************************************/
  36. /* Include the required C headers */
  37. /****************************************************************************/
  38. #ifndef OS_WINCE
  39. #include <stdio.h>
  40. #endif // OS_WINCE
  41. #include <stdlib.h>
  42. #include <ctype.h>
  43. #include <string.h>
  44. #ifndef OS_WINCE
  45. #include <time.h>
  46. #endif // OS_WINCE
  47. /****************************************************************************/
  48. /* Include the Windows-specific header. */
  49. /****************************************************************************/
  50. #include <wdcgcfnc.h>
  51. /****************************************************************************/
  52. /* */
  53. /* CONSTANTS */
  54. /* */
  55. /****************************************************************************/
  56. /****************************************************************************/
  57. /* Character Class Tests (normally in ctype.h) */
  58. /* ===================== */
  59. /* In these definitions: */
  60. /* */
  61. /* 'C' is of type DCINT. */
  62. /* */
  63. /* These functions return a DCBOOL. */
  64. /****************************************************************************/
  65. #define DC_ISALNUM(C) isalnum(C)
  66. #define DC_ISALPHA(C) isalpha(C)
  67. #define DC_ISCNTRL(C) iscntrl(C)
  68. #define DC_ISDIGIT(C) isdigit(C)
  69. #define DC_ISGRAPH(C) isgraph(C)
  70. #define DC_ISLOWER(C) islower(C)
  71. #define DC_ISPRINT(C) isprint(C)
  72. #define DC_ISPUNCT(C) ispunct(C)
  73. #define DC_ISSPACE(C) isspace(C)
  74. #define DC_ISUPPER(C) isupper(C)
  75. #define DC_ISXDIGIT(C) isxdigit(C)
  76. /****************************************************************************/
  77. /* These functions return a DCINT. */
  78. /****************************************************************************/
  79. #define DC_TOLOWER(C) tolower(C)
  80. #ifdef OS_WINCE
  81. #define DC_TOUPPER(C) towupper(C)
  82. #else // OS_WINCE
  83. #define DC_TOUPPER(C) toupper(C)
  84. #endif // OS_WINCE
  85. /****************************************************************************/
  86. /* Memory functions (from string.h) */
  87. /* ================ */
  88. /* In these definitions: */
  89. /* 'S' and 'T' are of type PDCVOID. */
  90. /* 'CS' and 'CT' are of type (constant) PDCVOID. */
  91. /* 'N' is of type DCINT. */
  92. /* 'C' is an DCINT converted to DCACHAR. */
  93. /****************************************************************************/
  94. /****************************************************************************/
  95. /* These functions return a PDCVOID. */
  96. /****************************************************************************/
  97. #define DC_MEMCPY(S, CT, N) memcpy(S, CT, N)
  98. #define DC_MEMMOVE(S, CT, N) memmove(S, CT, N)
  99. #define DC_MEMSET(S, C, N) memset(S, C, N)
  100. /****************************************************************************/
  101. /* These functions return a DCINT. */
  102. /****************************************************************************/
  103. #define DC_MEMCMP(CS, CT, N) memcmp(CS, CT, N)
  104. /****************************************************************************/
  105. /* Utility functions (from stdlib.h) */
  106. /* ================= */
  107. /* In these defintions: */
  108. /* 'CS' is of type (constant) PDCACHAR. */
  109. /* 'N' is of type DCINT. */
  110. /* 'L' is of type DCINT32 */
  111. /****************************************************************************/
  112. /****************************************************************************/
  113. /* These functions return a DCINT. */
  114. /****************************************************************************/
  115. #define DC_ABS(N) abs(N)
  116. /****************************************************************************/
  117. /* These functions return a DCINT32. */
  118. /****************************************************************************/
  119. #define DC_ATOL(CS) atol(CS)
  120. #define DC_LABS(L) labs(L)
  121. /****************************************************************************/
  122. /* The maximum characters DC_?ITOA will convert into plus one for a */
  123. /* NULLTERM (see C library documentation). */
  124. /****************************************************************************/
  125. #define MAX_ITOA_LENGTH 18
  126. #endif /* _H_ADCGCFNC */