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.

98 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name :
  4. strconst.h
  5. Abstract:
  6. This class defines common constant strings used by
  7. W3 server for formatting the HTTP responses.
  8. Author:
  9. Murali R. Krishnan ( MuraliK ) 26-July-1996
  10. Environment:
  11. User mode - Win32
  12. Project:
  13. Internet Server DLL
  14. Revision History:
  15. --*/
  16. # ifndef _STRCONSTS_HXX_
  17. # define _STRCONSTS_HXX_
  18. /************************************************************
  19. * Symbolic Definitions
  20. ************************************************************/
  21. //
  22. // Below is a list of strings, which are commonly used.
  23. // Format:
  24. // CStrM( FriendlyName, ActualString)
  25. // This will be expanded into
  26. // extern const char PSZ_FriendlyName[]; - in a header
  27. // enumerated value LEN_FriendlyName = sizeof( ActualString). - in a header
  28. // const char PSZ_FriendlyName[] = ActualString; - in a c++ file (compiled)
  29. //
  30. //
  31. //
  32. //
  33. // Special Notes:
  34. // HTTP_VERSION_STR is always used with trailing blank (leave one)
  35. //
  36. # define ConstantStringsForThisModule() \
  37. CStrM( ENDING_CRLF, "\r\n") \
  38. CStrM( CONTENT_TYPE_END_HEADER, "Content-Type: text/html\r\n\r\n") \
  39. CStrM( HTTP_VERSION_STR, "HTTP/1.0 ") \
  40. CStrM( HTTP_VERSION_STR11, "HTTP/1.1 ") \
  41. CStrM( KWD_CONTENT_TYPE, "Content-Type: ") \
  42. CStrM( KWD_SYSTEM, "SYSTEM") \
  43. //
  44. // Generate the extern definitions for strings
  45. //
  46. # define CStrM( FriendlyName, ActualString) \
  47. extern const char PSZ_ ## FriendlyName[];
  48. ConstantStringsForThisModule()
  49. # undef CStrM
  50. //
  51. // Generate the enumerated values, containing the length of strings.
  52. // The values are constants and are computed at compile time
  53. // sizeof(string) - 1 ==> string length in bytes.
  54. // since sizeof(CHAR) == 1 ==> byte == character count
  55. //
  56. # define CStrM( FriendlyName, ActualString) \
  57. LEN_PSZ_ ## FriendlyName = (sizeof( ActualString) - 1),
  58. enum ConstantStringLengths {
  59. ConstantStringsForThisModule()
  60. ConstantStringLengthsDummy = 0,
  61. };
  62. # undef CStrM
  63. # endif // _STRCONSTS_HXX_
  64. /************************ End of File ***********************/