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.

132 lines
6.1 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: wdcgcfnc.h */
  3. /* */
  4. /* Purpose: C runtime functions - Windows specific header */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1997 */
  7. /* */
  8. /****************************************************************************/
  9. /** Changes:
  10. * $Log: Y:/logs/h/dcl/wdcgcfnc.h_v $
  11. *
  12. * Rev 1.6 22 Aug 1997 15:10:48 SJ
  13. * SFR1291: Win16 Trace DLL doesn't write integers to ini file properly
  14. *
  15. * Rev 1.5 06 Aug 1997 14:33:10 AK
  16. * SFR1016: Apply Markups
  17. *
  18. * Rev 1.4 06 Aug 1997 10:41:14 AK
  19. * SFR1016: Complete removal of DCCHAR etc
  20. *
  21. * Rev 1.3 15 Jul 1997 15:41:48 AK
  22. * SFR1016: Add Unicode support
  23. *
  24. * Rev 1.2 09 Jul 1997 17:12:02 AK
  25. * SFR1016: Initial changes to support Unicode
  26. *
  27. * Rev 1.1 19 Jun 1997 14:26:36 ENH
  28. * Win16Port: Make compatible with 16 bit build
  29. **/
  30. /**INC-**********************************************************************/
  31. #ifndef _H_WDCGCFNC
  32. #define _H_WDCGCFNC
  33. /****************************************************************************/
  34. /* */
  35. /* CONSTANTS */
  36. /* */
  37. /****************************************************************************/
  38. /****************************************************************************/
  39. /* Huge memory functions (based on those from windows.h) */
  40. /* ===================== */
  41. /* In these definitions: */
  42. /* 'S' and 'T' are of type HPDCVOID. */
  43. /* 'CS' and 'CT' are of type (constant) HPDCVOID. */
  44. /* 'N' is of type DCINT32. */
  45. /****************************************************************************/
  46. /****************************************************************************/
  47. /* This function returns a PDCVOID (WIN32) or DCVOID (WIN16). */
  48. /****************************************************************************/
  49. #define DC_HMEMCPY(S, CT, N) hmemcpy(S, CT, N)
  50. #ifdef OS_WIN16
  51. #include <ddcgcfnc.h>
  52. #else
  53. #include <ndcgcfnc.h>
  54. #endif
  55. /****************************************************************************/
  56. /* String handling functions */
  57. /****************************************************************************/
  58. #define DC_ASTRLEN(S) strlen(S)
  59. #define DC_WSTRLEN(S) wcslen(S)
  60. #define DC_TSTRLEN(S) _tcslen(S)
  61. #define DC_ASTRCPY(S, T) strcpy(S, T)
  62. #define DC_WSTRCPY(S, T) wcscpy(S, T)
  63. #define DC_TSTRCPY(S, T) _tcscpy(S, T)
  64. #define DC_ASTRNCPY(S, CT, N) strncpy(S, CT, N)
  65. #define DC_WSTRNCPY(S, CT, N) wcsncpy(S, CT, N)
  66. #define DC_TSTRNCPY(S, CT, N) _tcsncpy(S, CT, N)
  67. #define DC_ASTRCAT(S, T) strcat(S, T)
  68. #define DC_WSTRCAT(S, T) wcscat(S, T)
  69. #define DC_TSTRCAT(S, T) _tcscat(S, T)
  70. #define DC_ASTRCMP(S, T) strcmp(S, T)
  71. #define DC_WSTRCMP(S, T) wcscmp(S, T)
  72. #define DC_TSTRCMP(S, T) _tcscmp(S, T)
  73. #define DC_ASPRINTF sprintf
  74. #define DC_WSPRINTF swprintf
  75. #define DC_TSPRINTF _stprintf
  76. #define DC_TNSPRINTF _sntprintf
  77. #define DC_ASTRCHR(S, C) strchr(S, C)
  78. #define DC_WSTRCHR(S, C) wcschr(S, C)
  79. #define DC_TSTRCHR(S, C) _tcschr(S, C)
  80. #define DC_ASTRTOK(S, T) strtok(S, T)
  81. #define DC_WSTRTOK(S, T) wcstok(S, T)
  82. #define DC_TSTRTOK(S, T) _tcstok(S, T)
  83. #define DC_ASTRICMP(S, T) _stricmp(S, T)
  84. #define DC_WSTRICMP(S, T) wcsicmp(S, T)
  85. #define DC_TSTRICMP(S, T) _tcsicmp(S, T)
  86. #define DC_ASTRNCMP(S, T, N) strncmp(S, T, N)
  87. #define DC_WSTRNCMP(S, T, N) wcsncmp(S, T, N)
  88. #define DC_TSTRNCMP(S, T, N) _tcsncmp(S, T, N)
  89. #define DC_ASTRNICMP(S, T, N) _strnicmp(S, T, N)
  90. #define DC_ASSCANF sscanf
  91. #define DC_WSSCANF swscanf
  92. #define DC_TSSCANF _stscanf
  93. #define DC_ACSLWR _strlwr
  94. #define DC_TCSLWR _tcslwr
  95. /****************************************************************************/
  96. /* Space required to hold null-terminated string. */
  97. /****************************************************************************/
  98. #define DC_ASTRBYTELEN(S) (DC_ASTRLEN(S) + 1)
  99. #define DC_WSTRBYTELEN(S) ((DC_WSTRLEN(S) + 1) * sizeof(DCWCHAR))
  100. #define DC_TSTRBYTELEN(S) ((DC_TSTRLEN(S) + 1) * sizeof(DCTCHAR))
  101. /****************************************************************************/
  102. /* ATOI and ITOA functions */
  103. /****************************************************************************/
  104. #define DC_ULTOA(N, S, M) _ultoa(N, S, M)
  105. #define DC_ITOA(N, S, M) _itoa(N, S, M)
  106. #define DC_ITOW(N, S, M) _itow(N, S, M)
  107. #define DC_ITOT(N, S, M) _itot(N, S, M)
  108. #define DC_ASTRTOUL(CS, ENDPTR, BASE) strtoul(CS, ENDPTR, BASE)
  109. #define DC_ATOI(CS) atoi(CS)
  110. #define DC_WTOI(CS) _wtoi(CS)
  111. #define DC_TTOI(CS) _ttoi(CS)
  112. #endif /* _H_WDCGCFNC */