HTVMSUtils.h
Upload User: zlh9724
Upload Date: 2007-01-04
Package Size: 1991k
Code Size: 5k
Category:

Browser Client

Development Platform:

Unix_Linux

  1. /*             VMS specific routines
  2.                                              
  3.  */
  4. #ifndef HTVMSUTIL_H
  5. #define HTVMSUTIL_H
  6. /* define some masks as given in Unix stat.h file... */
  7. #define S_IFLNK 0120000
  8. #define S_IFSOCK 0140000
  9. #define S_IFIFO 0010000
  10. #define S_IRWXU         0000700 /* rwx, owner */
  11. #define         S_IRUSR 0000400 /* read permission, owner */
  12. #define         S_IWUSR 0000200 /* write permission, owner */
  13. #define         S_IXUSR 0000100 /* execute/search permission, owner */
  14. #define S_IRWXG         0000070 /* rwx, group */
  15. #define         S_IRGRP 0000040 /* read permission, group */
  16. #define         S_IWGRP 0000020 /* write permission, grougroup */
  17. #define         S_IXGRP 0000010 /* execute/search permission, group */
  18. #define S_IRWXO         0000007 /* rwx, other */
  19. #define         S_IROTH 0000004 /* read permission, other */
  20. #define         S_IWOTH 0000002 /* write permission, other */
  21. #define         S_IXOTH 0000001 /* execute/search permission, other */
  22. /* PUBLIC HTVMS_authSysPrv()
  23. ** CHECKS IF THIS PROCESS IS AUTHORIZED TO ENABLE SYSPRV
  24. ** ON ENTRY:
  25. ** No arguments.
  26. **
  27. ** ON EXIT:
  28. ** returns YES if SYSPRV is authorized
  29. */
  30. PUBLIC BOOL HTVMS_authSysPrv NOPARAMS;
  31. /* PUBLIC HTVMS_enableSysPrv()
  32. ** ENABLES SYSPRV
  33. ** ON ENTRY:
  34. ** No arguments.
  35. **
  36. ** ON EXIT:
  37. **
  38. */
  39. PUBLIC void HTVMS_enableSysPrv NOPARAMS;
  40. /* PUBLIC HTVMS_disableSysPrv()
  41. ** DISABLES SYSPRV
  42. ** ON ENTRY:
  43. ** No arguments.
  44. **
  45. ** ON EXIT:
  46. **
  47. */
  48. PUBLIC void HTVMS_disableSysPrv NOPARAMS;
  49. /* PUBLIC HTVMS_checkAccess()
  50. ** CHECKS ACCESS TO FILE FOR CERTAIN USER
  51. ** ON ENTRY:
  52. ** FileName The file to be accessed
  53. ** UserName Name of the user to check access for
  54. **
  55. ** ON EXIT:
  56. ** returns YES if access is allowed
  57. **
  58. */
  59. PUBLIC BOOL HTVMS_checkAccess PARAMS((
  60. CONST char * FileName,
  61. CONST char * UserName,
  62. HTMethod Method));
  63. /* PUBLIC HTVMS_wwwName()
  64. ** CONVERTS VMS Name into WWW Name 
  65. ** ON ENTRY:
  66. ** vmsname VMS file specification (NO NODE)
  67. **
  68. ** ON EXIT:
  69. ** returns  www file specification
  70. **
  71. ** EXAMPLES:
  72. ** vmsname wwwname
  73. ** DISK$USER  disk$user
  74. ** DISK$USER:  /disk$user/
  75. ** DISK$USER:[DUNS]  /disk$user/duns
  76. ** DISK$USER:[DUNS.ECHO]  /disk$user/duns/echo
  77. ** [DUNS]  duns
  78. ** [DUNS.ECHO]  duns/echo
  79. ** [DUNS.ECHO.-.TRANS]  duns/echo/../trans
  80. ** [DUNS.ECHO.--.TRANS]  duns/echo/../../trans
  81. ** [.DUNS]  duns
  82. ** [.DUNS.ECHO]  duns/echo
  83. ** [.DUNS.ECHO]TEST.COM  duns/echo/test.com 
  84. ** TEST.COM  test.com
  85. **
  86. **
  87. */
  88. PUBLIC char * HTVMS_wwwName PARAMS((
  89. char * vmsname));
  90. /* PUBLIC HTVMS_name()
  91. ** CONVERTS WWW name into a VMS name
  92. ** ON ENTRY:
  93. ** nn Node Name (optional)
  94. ** fn WWW file name
  95. **
  96. ** ON EXIT:
  97. ** returns  vms file specification
  98. **
  99. ** Bug: Returns pointer to static -- non-reentrant
  100. */
  101. PUBLIC char * HTVMS_name PARAMS((
  102. CONST char * nn, 
  103. CONST char * fn));
  104. /* PUBLIC HTVMS_putenv()
  105. ** Create logical name
  106. ** ON ENTRY:
  107. ** string name value pair separated by equal sign. 
  108. ** "name=value"
  109. **
  110. **
  111. ** ON EXIT:
  112. **
  113. */
  114. PUBLIC int HTVMS_putenv PARAMS((
  115. CONST char * string));
  116. /* PUBLIC HTVMS_start_timer()
  117. ** Starts a timer
  118. ** ON ENTRY:
  119. ** n A number to recognise the timer. 0 may be used to 
  120. ** say that recognision is not needed
  121. ** fun ptr to a function to be called asynchronously
  122. ** sec number of seconds to wait before firing.
  123. **
  124. **
  125. ** ON EXIT:
  126. **
  127. */
  128. PUBLIC void HTVMS_start_timer PARAMS((
  129. CONST int n,
  130. CONST (*fun)(),
  131. CONST int sec));
  132. /* PUBLIC HTVMS_cancel_timer()
  133. ** Cancel a specific or all timers
  134. ** ON ENTRY:
  135. ** n timer number (0 to cancel all timers)
  136. **
  137. **
  138. ** ON EXIT:
  139. **
  140. */
  141. PUBLIC void HTVMS_cancel_timer PARAMS((
  142. CONST int n));
  143. #define getpwnam HTVMS_getpwnam
  144. struct passwd
  145. {
  146.    char *pw_dir; /* Home Directory */
  147. };
  148. /* PUBLIC HTVMS_getpwnam()
  149. ** getpwnam routine
  150. ** ON ENTRY:
  151. ** username Username specification
  152. **
  153. **
  154. ** ON EXIT:
  155. ** NULL error
  156. **
  157. */
  158. PUBLIC struct passwd *HTVMS_getpwnam PARAMS((
  159. CONST char *, username));
  160. PUBLIC int HTStat PARAMS((
  161. CONST char *, filename,
  162.         stat_t *, info));
  163. PUBLIC int HTVMS_checkDecnet PARAMS((
  164. CONST char *, filename));
  165. /* PUBLIC HTVMS_getUIC()
  166. ** getUIC routine
  167. ** ON ENTRY:
  168. ** username Username specification
  169. **
  170. **
  171. ** ON EXIT:
  172. ** 0 error
  173. ** UIC VMS User Identification Code for username
  174. **
  175. */
  176. PUBLIC unsigned int HTVMS_getUIC PARAMS((
  177. CONST char *, username));
  178. /* PUBLIC HTVMS_isOwner()
  179. ** CHECKS OWNERSHIP OF FILE FOR CERTAIN USER
  180. ** ON ENTRY:
  181. ** FileName The file or directory to be checked
  182. ** UserName Name of the user to check ownership for.
  183. ** User nobody, represented by "" is given NO for an answer
  184. **
  185. ** ON EXIT:
  186. ** returns YES if FileName is owned by UserName
  187. **
  188. */
  189. PUBLIC BOOL HTVMS_isOwner PARAMS((
  190. CONST char *, FileName,
  191. CONST char *, UserName));
  192. #endif /* not HTVMSUTIL_H */
  193. /* End of file HTVMSUtil.h.  */