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.

269 lines
6.9 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name :
  4. gdspace.h
  5. Abstract:
  6. Defines the APIs used for gopher space administration.
  7. Author:
  8. Murali R. Krishnan ( MuraliK ) 06-Dec-1994
  9. Project:
  10. Gopher Space Admin DLL
  11. Revision History:
  12. --*/
  13. # ifndef _GDSPACE_H_
  14. # define _GDSPACE_H_
  15. # ifdef __cplusplus
  16. extern "C" {
  17. # endif // __cplusplus
  18. /************************************************************
  19. * Include Headers
  20. ************************************************************/
  21. //
  22. // Make sure you include all standard windows.h files for predefined types
  23. //
  24. /***************************************************
  25. * NOTE: ( Dec 6, 1994)
  26. * Present implementation only allows ASCII information
  27. * in the tag file.
  28. * The Gopher protocol does not support UNICODE as of now.
  29. * hence the tag file information will live to be ASCII.
  30. *
  31. * Gs_ prefix is used to mean Gopher Space.
  32. ***************************************************/
  33. /************************************************************
  34. * Symbolic Constants
  35. ************************************************************/
  36. //
  37. // Symbolic Constants (single character) used to identify gopher object types
  38. // Included here for common use by server, adminUI, and gopher space admin
  39. // GOBJ_ Prefix used to identify Gopher OBJect
  40. //
  41. # define GOBJ_TEXT '0' // Text Object
  42. # define GOBJ_DIRECTORY '1' // Directory listing
  43. # define GOBJ_ERROR '3' // Error object
  44. # define GOBJ_SEARCH '7' // Content Search Item
  45. # define GOBJ_BINARY '9' // Binary information
  46. # define GOBJ_IMAGES ':' // Bit Images
  47. # define GOBJ_MOVIES ';' // Movie Information
  48. # define GOBJ_SOUND '<' // Sound information
  49. # define GOBJ_HTML 'h' // HTML docs
  50. # define GOBJ_PC_ITEM '5' // this is a pc file
  51. # define GOBJ_GIF 'g' // this is a gif item
  52. # define GOBJ_MAC_BINHEX_ITEM '4' // BinHex'ed Macintosh File
  53. # define GOBJ_TELNET '8' // TelNet Link
  54. typedef char GOBJ_TYPE; // Type for "gopher object type"
  55. typedef GOBJ_TYPE * LPGOBJ_TYPE;
  56. /*++
  57. Following are a few unsupported Gopher Object Types:
  58. Type Explanation
  59. > 2 A CSO phone-book server
  60. > 6 A Unix uuencoded file
  61. > c A calendar or calendar of events
  62. > i An in-line text that is not an item
  63. > m A BSD format mbox file
  64. > P A PDF document
  65. > T A tn3270 mainframe session
  66. > + A redundant server.
  67. >And have seen occasional (or conflicting) references for:
  68. > e ????
  69. > I Another kind of image file????
  70. # define GOBJ_TELNET '8' // Telnet session
  71. --*/
  72. # include "fsconst.h"
  73. # define INVALID_PORT_NUMBER ( 0)
  74. # ifndef COMPILE_GOPHER_SERVER_DLL
  75. //
  76. // include following APIs only when we deal with
  77. // compilation of dlls that are not part of the main gopher server dll.
  78. //
  79. //
  80. // Define an opaque handle for Gopher Tag file information
  81. //
  82. typedef PVOID HGDTAG;
  83. # define INVALID_HGDTAG_VALUE ( NULL)
  84. //
  85. // Define an opaque handle for iterating thru
  86. // the attributes for Gopher+ Tag file
  87. //
  88. typedef PVOID HGD_ATTRIB_ITERATOR;
  89. typedef HGD_ATTRIB_ITERATOR * LPHGD_ATTRIB_ITERATOR;
  90. # define INVALID_HGD_ATTRIB_ITERATOR_VALUE ( NULL)
  91. HGDTAG
  92. GsOpenTagInformation(
  93. IN LPCTSTR lpszDirectory, // directory of the file
  94. IN LPCTSTR lpszFileName, // name of the file
  95. IN BOOL fDirectory,
  96. IN BOOL fCreate, // TRUE if new file to be created
  97. IN DWORD dwFileSystem
  98. );
  99. DWORD
  100. GsWriteTagInformation(
  101. IN OUT HGDTAG hgdTag // Gopher Tag handle
  102. );
  103. DWORD
  104. GsCloseTagInformation(
  105. IN OUT HGDTAG * hgdTag // Gopher Tag handle
  106. );
  107. DWORD
  108. GsSetGopherInformation(
  109. IN OUT HGDTAG hgdTag, // Gopher Tag handle
  110. IN GOBJ_TYPE gobjType, // Type of gopher object
  111. IN LPCSTR lpszFriendlyName // friendly name of the gopher object
  112. );
  113. DWORD
  114. GsSetLinkInformation(
  115. IN OUT HGDTAG hgdTag, // Gopher Tag handle,
  116. IN LPCSTR lpszSelector, // Gopher selector or Search expression
  117. IN LPCSTR lpszHostName, // == NULL ==> current host
  118. IN DWORD dwPortNumber // == 0 ==> current server port
  119. );
  120. DWORD
  121. GsSetAdminAttribute(
  122. IN OUT HGDTAG hgdTag, // Gopher Tag handle
  123. IN LPCSTR lpszAdminName, // == NULL ==> current administrator
  124. IN LPCSTR lpszAdminEmail // == NULL ==> current admin's email
  125. );
  126. //
  127. // Call following API GsSetAttribute()
  128. // for all Gopher+ attributes, except "VIEWS" and "ADMIN"
  129. //
  130. DWORD
  131. GsSetAttribute(
  132. IN OUT HGDTAG hgdTag,
  133. IN LPCSTR lpszAttributeName,
  134. IN LPCSTR lpszAttributeValue
  135. );
  136. BOOL
  137. IsValidGopherType( IN GOBJ_TYPE gobjType);
  138. DWORD
  139. GsGetGopherInformation(
  140. IN HGDTAG hgdTag, // Gopher Tag handle
  141. OUT LPGOBJ_TYPE lpGobjType, // pointer to contain GOBJ_TYPE
  142. OUT LPSTR lpszBuffer, // ptr to buffer to contain friendly name
  143. IN OUT LPDWORD lpcbBuffer, // ptr to location containing no. of bytes
  144. OUT LPBOOL lpfLink // return TRUE if link or search file.
  145. );
  146. DWORD
  147. GsGetLinkInformation(
  148. IN OUT HGDTAG hgdTag, // Gopher Tag handle,
  149. OUT LPSTR lpszSelectorBuffer,// pointer to buffer to contain selector
  150. IN OUT LPDWORD lpcbSelector, // count of bytes for selector
  151. OUT LPSTR lpszHostName, // pointer to buffer containing hostname
  152. IN OUT LPDWORD lpcbHostName, // count of bytes for host name
  153. OUT LPDWORD lpdwPortNumber // server port number
  154. );
  155. DWORD
  156. GsGetAdminAttribute(
  157. IN OUT HGDTAG hgdTag, // Gopher Tag handle
  158. OUT LPSTR lpszAdminName, // == NULL ==> current administrator
  159. IN OUT LPDWORD lpcbAdminName, // count of bytes for admin name
  160. OUT LPSTR lpszAdminEmail, // == NULL ==> current admin's email
  161. IN OUT LPDWORD lpcbAdminEmail // count of bytes for admin email
  162. );
  163. //
  164. // Call following API GsSetAttribute()
  165. // for all Gopher+ attributes, except "VIEWS" and "ADMIN"
  166. //
  167. DWORD
  168. GsStartFindAttribute(
  169. IN OUT HGDTAG hgdTag,
  170. OUT LPHGD_ATTRIB_ITERATOR lphgdAttribIter
  171. );
  172. DWORD
  173. GsFindNextAttribute(
  174. IN OUT HGD_ATTRIB_ITERATOR hgdAttribIter,
  175. OUT LPSTR lpszAttributeName,
  176. IN OUT LPDWORD lpcbAttributeName,
  177. OUT LPSTR lpszAttributeValue,
  178. IN OUT LPDWORD lpcbAttributeValue
  179. );
  180. DWORD
  181. GsFindCloseAttribute(
  182. IN OUT LPHGD_ATTRIB_ITERATOR lphgdAttribIter
  183. );
  184. # endif // COMPILE_GOPHER_SERVER_DLL
  185. # ifdef __cplusplus
  186. };
  187. # endif // __cplusplus
  188. # endif // _GDSPACE_H_
  189. /************************ End of File ***********************/