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.

165 lines
6.5 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. gfrapip.h
  5. Abstract:
  6. Contains private or internal definitions for client gopher protocol
  7. provider
  8. Author:
  9. Richard L Firth (rfirth) 13-Oct-1994
  10. Revision History:
  11. 13-Oct-1994 rfirth
  12. Created
  13. --*/
  14. //
  15. // manifests
  16. //
  17. //
  18. // gopher strings
  19. //
  20. #define GOPHER_REQUEST_TERMINATOR "\r\n"
  21. #define GOPHER_REQUEST_TERMINATOR_LENGTH (sizeof(GOPHER_REQUEST_TERMINATOR) - 1)
  22. #define GOPHER_DOT_TERMINATOR ".\r\n"
  23. #define GOPHER_DOT_TERMINATOR_LENGTH (sizeof(GOPHER_DOT_TERMINATOR) - 1)
  24. //
  25. // gopher+ strings
  26. //
  27. #define GOPHER_PLUS_INDICATOR "\t+"
  28. #define GOPHER_PLUS_INDICATOR_LENGTH (sizeof(GOPHER_PLUS_INDICATOR) - 1)
  29. #define GOPHER_PLUS_ITEM_INFO "\t!"
  30. #define GOPHER_PLUS_ITEM_INFO_LENGTH (sizeof(GOPHER_PLUS_ITEM_INFO) - 1)
  31. #define GOPHER_PLUS_INFO_REQUEST "\t!\r\n"
  32. #define GOPHER_PLUS_INFO_REQUEST_LENGTH (sizeof(GOPHER_PLUS_INFO_REQUEST) - 1)
  33. #define GOPHER_PLUS_DIRECTORY_REQUEST "\t$"
  34. #define GOPHER_PLUS_DIRECTORY_REQUEST_LENGTH (sizeof(GOPHER_PLUS_DIRECTORY_REQUEST) - 1)
  35. #define GOPHER_PLUS_INFO_TOKEN "+INFO"
  36. #define GOPHER_PLUS_INFO_TOKEN_LENGTH (sizeof(GOPHER_PLUS_INFO_TOKEN) - 1)
  37. #define GOPHER_PLUS_ADMIN_TOKEN "+ADMIN"
  38. #define GOPHER_PLUS_ADMIN_TOKEN_LENGTH (sizeof(GOPHER_PLUS_ADMIN_TOKEN) - 1)
  39. #define GOPHER_PLUS_VIEWS_TOKEN "+VIEWS"
  40. #define GOPHER_PLUS_VIEWS_TOKEN_LENGTH (sizeof(GOPHER_PLUS_VIEWS_TOKEN) - 1)
  41. //
  42. // single characters
  43. //
  44. #define GOPHER_FIELD_SEPARATOR '\t'
  45. #define GOPHER_PLUS_SUCCESS_INDICATOR '+'
  46. #define GOPHER_PLUS_ERROR_INDICATOR '-'
  47. //
  48. // misc.
  49. //
  50. #define INVALID_GOPHER_CHAR 0
  51. #define INVALID_GOPHER_TYPE 0
  52. #define DEFAULT_GOPHER_DISPLAY_STRING ""
  53. #define DEFAULT_GOPHER_SELECTOR_STRING ""
  54. #define UNKNOWN_GOPHER_TYPE 0
  55. //
  56. // types and masks
  57. //
  58. #define VALID_GOPHER_TYPES (GOPHER_TYPE_TEXT_FILE \
  59. | GOPHER_TYPE_DIRECTORY \
  60. | GOPHER_TYPE_CSO \
  61. | GOPHER_TYPE_MAC_BINHEX \
  62. | GOPHER_TYPE_DOS_ARCHIVE \
  63. | GOPHER_TYPE_UNIX_UUENCODED \
  64. | GOPHER_TYPE_INDEX_SERVER \
  65. | GOPHER_TYPE_TELNET \
  66. | GOPHER_TYPE_BINARY \
  67. | GOPHER_TYPE_REDUNDANT \
  68. | GOPHER_TYPE_TN3270 \
  69. | GOPHER_TYPE_GIF \
  70. | GOPHER_TYPE_IMAGE \
  71. | GOPHER_TYPE_BITMAP \
  72. | GOPHER_TYPE_MOVIE \
  73. | GOPHER_TYPE_SOUND \
  74. | GOPHER_TYPE_HTML \
  75. | GOPHER_TYPE_PDF \
  76. | GOPHER_TYPE_CALENDAR \
  77. | GOPHER_TYPE_INLINE \
  78. )
  79. #define GOPHER_TYPE_MASK (~(GOPHER_TYPE_GOPHER_PLUS))
  80. #define GOPHER_ATTRIBUTE_MASK (GOPHER_TYPE_GOPHER_PLUS)
  81. #define GOPHER_FILE_MASK (GOPHER_TYPE_TEXT_FILE \
  82. | GOPHER_TYPE_MAC_BINHEX \
  83. | GOPHER_TYPE_DOS_ARCHIVE \
  84. | GOPHER_TYPE_UNIX_UUENCODED \
  85. | GOPHER_TYPE_BINARY \
  86. | GOPHER_TYPE_GIF \
  87. | GOPHER_TYPE_IMAGE \
  88. | GOPHER_TYPE_BITMAP \
  89. | GOPHER_TYPE_MOVIE \
  90. | GOPHER_TYPE_SOUND \
  91. | GOPHER_TYPE_HTML \
  92. | GOPHER_TYPE_PDF \
  93. | GOPHER_TYPE_CALENDAR \
  94. | GOPHER_TYPE_INLINE \
  95. )
  96. #define GOPHER_DIRECTORY_MASK (GOPHER_TYPE_DIRECTORY)
  97. #define GOPHER_DOT_TERMINATED_TYPES (GOPHER_TYPE_TEXT_FILE \
  98. | GOPHER_TYPE_DIRECTORY \
  99. | GOPHER_TYPE_MAC_BINHEX \
  100. | GOPHER_TYPE_UNIX_UUENCODED \
  101. | GOPHER_TYPE_INDEX_SERVER \
  102. )
  103. //
  104. // gopher locator characters
  105. //
  106. #define GOPHER_CHAR_REDUNDANT '+'
  107. #define GOPHER_CHAR_TEXT_FILE '0'
  108. #define GOPHER_CHAR_DIRECTORY '1'
  109. #define GOPHER_CHAR_CSO '2'
  110. #define GOPHER_CHAR_ERROR '3'
  111. #define GOPHER_CHAR_MAC_BINHEX '4'
  112. #define GOPHER_CHAR_DOS_ARCHIVE '5'
  113. #define GOPHER_CHAR_UNIX_UUENCODED '6'
  114. #define GOPHER_CHAR_INDEX_SERVER '7'
  115. #define GOPHER_CHAR_TELNET '8'
  116. #define GOPHER_CHAR_BINARY '9'
  117. #define GOPHER_CHAR_BITMAP ':'
  118. #define GOPHER_CHAR_MOVIE ';'
  119. #define GOPHER_CHAR_SOUND '<'
  120. #define GOPHER_CHAR_IMAGE 'I'
  121. //#define GOPHER_CHAR_BIG_M 'M'
  122. #define GOPHER_CHAR_PDF 'P'
  123. #define GOPHER_CHAR_TN3270 'T'
  124. #define GOPHER_CHAR_CALENDAR 'c'
  125. //#define GOPHER_CHAR_LITTLE_E 'e'
  126. #define GOPHER_CHAR_GIF 'g'
  127. #define GOPHER_CHAR_INLINE 'i'
  128. #define GOPHER_CHAR_HTML 'h'
  129. #define GOPHER_CHAR_SOUND_2 's'
  130. //
  131. // macros
  132. //
  133. #define IS_DOT_TERMINATED_REQUEST(request) \
  134. ((request & GOPHER_DOT_TERMINATED_TYPES) ? TRUE : FALSE)