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

浏览器

开发平台:

Unix_Linux

  1. /*                                                                            String Handling
  2.                               WWW RELATED STRING 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 is like the generic string utility module but it contains more Web related
  11.    string utility functions. This module is implemented by HTWWWStr.c, and it is a part of
  12.    the  W3C Reference Library.
  13.    
  14.  */
  15. #ifndef HTWWWSTR_H
  16. #define HTWWWSTR_H
  17. /*
  18. Next word or quoted string
  19.    This function returns a RFC822 word separated by space, comma, or semi-colons. pstr
  20.    points to a string containing a word separated by white white space "," ";" or "=". The
  21.    word can optionally be quoted using  or "" Comments surrrounded by '(' ')' are filtered
  22.    out. On exit, pstr has been moved to the first delimiter past the field THE STRING HAS
  23.    BEEN MUTILATED by a 0 terminator.  The function returns a pointer to the first word or
  24.    NULL on error
  25.    
  26.  */
  27. extern char * HTNextField (char** pstr);
  28. /*
  29. RFC1123 Date/Time Stamp String
  30.    Returns a pointer to a static area!
  31.    
  32.  */
  33. extern CONST char *HTDateTimeStr (time_t *calendar, BOOL local);
  34. /*
  35. Date used for directory listings
  36.  */
  37. extern BOOL HTDateDirStr (time_t * time, char * str, int len);
  38. /*
  39. Timezone Offset
  40.    Calculates the offset from GMT in seconds. This is called from HTLibInit().
  41.    
  42.  */
  43. extern long HTGetTimeZoneOffset (void);
  44. /*
  45. Parse a Date/Time String
  46.    Converts a string representation in GMT to a local representation of localtime time_t.
  47.    
  48.  */
  49. extern time_t HTParseTime (CONST char * str);
  50. /*
  51. Unique Message-ID String
  52.  */
  53. extern CONST char *HTMessageIdStr (void);
  54. /*
  55. Converts an Integer to a String using Prefix
  56.    In computer-world 1K is 1024 bytes and 1M is 1024K -- however, sprintf() still formats
  57.    in base-10.  Therefore I output only until 999, and then start using the next unit.
  58.    This doesn't work wrong, it's just a feature.  The conversion is done in "str" which
  59.    must be large enough to contain the result.
  60.    
  61.  */
  62. extern void HTNumToStr (unsigned long n, char *str, int len);
  63. /*
  64. Conversion between URLs and Local File Names
  65.    These are two functions that separate the URL naming syntax from platform dependent
  66.    file naming schemes. If you are porting the code to a new platform, you probably have
  67.    to do some translation here.
  68.    
  69.   CONVERT FILE URLS INTO A LOCAL REPRESENTATION
  70.   
  71.    The URL has already been translated through the rules in get_physical in HTAccess.c and
  72.    all we need to do now is to map the path to a local representation, for example if must
  73.    translate '/' to the ones that turn the wrong way ;-) Returns local file (that must be
  74.    freed by caller) if OK, else NULL.
  75.    
  76.  */
  77. extern char * HTWWWToLocal (CONST char * url, CONST char * base);
  78. /*
  79.   CONVERT A LOCAL FILE NAME INTO A URL
  80.   
  81.    Generates a WWW URL name from a local file name or NULL if error. Returns URL (that
  82.    must be freed by caller) if OK, else NULL.
  83.    
  84.  */
  85. extern char * HTLocalToWWW (CONST char * local);
  86. /*
  87.  */
  88. #endif
  89. /*
  90.    End of declaration module  */