HTMethod.h
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:2k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. /*                                                                          Method Management
  2.                                     METHOD MANAGEMENT
  3.                                              
  4.  */
  5. /*
  6. **      (c) COPYRIGHT MIT 1995.
  7. **      Please first read the full copyright statement in the file COPYRIGH.
  8. */
  9. /*
  10.    This module keeps a list of valid methods to be used on a request obejct. It used to be
  11.    in HTAccess module but for future extensions, it is now in its own module.
  12.    
  13.    This module is implemented by HTmethod.c, and it is a part of the  W3C Reference
  14.    Library.
  15.    
  16.  */
  17. #ifndef HTMETHOD_H
  18. #define HTMETHOD_H
  19. /*
  20.    These are the valid methods, see HTTP Methods.
  21.    
  22.    NOTE: the anchor list of allowed methods is now a bitflag, not at list.
  23.    
  24.  */
  25. typedef enum {
  26.     METHOD_INVALID      = 0x0,
  27.     METHOD_GET          = 0x1,
  28.     METHOD_HEAD         = 0x2,
  29.     METHOD_POST         = 0x4,
  30.     METHOD_PUT          = 0x8,
  31.     METHOD_DELETE       = 0x10,
  32.     METHOD_LINK         = 0x20,
  33.     METHOD_UNLINK       = 0x40
  34. } HTMethod;
  35. /*
  36.   GET METHOD ENUMERATION
  37.   
  38.    Gives the enumeration value of the method as a function of the (char *) name.
  39.    
  40.  */
  41. extern HTMethod HTMethod_enum (CONST char * name);
  42. /*
  43.   GET METHOD STRING
  44.   
  45.    The reverse of HTMethod_enum()
  46.    
  47.  */
  48. extern CONST char * HTMethod_name (HTMethod method);
  49. /*
  50.   IS METHOD "SAFE"
  51.   
  52.    If a method a safe, it doesn't produce any side effects on the server
  53.    
  54.  */
  55. #define HTMethod_isSafe(me)     ((me) & (METHOD_GET|METHOD_HEAD))
  56. /*
  57.   DOES A METHOD INCLUDE ENTITY
  58.   
  59.    Does a method include an entity to be sent from the client to the server?
  60.    
  61.  */
  62. #define HTMethod_hasEntity(me)  ((me) & (METHOD_PUT | METHOD_POST))
  63. /*
  64.  */
  65. #endif /* HTMETHOD_H */
  66. /*
  67.    End of Declaration module  */