diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 1996-11-30 10:18:30 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 1996-11-30 10:18:30 -0500 |
commit | 6bd78b38830217fa268e678d9637116ec516bf0e (patch) | |
tree | ff28371a110a8035413ef3ded834a5e76ebb7fd0 /WWW/Library/Implementation/HTParse.h | |
parent | e087f6d44e87f489fcb3056e86319ebba4218156 (diff) | |
download | lynx-snapshots-6bd78b38830217fa268e678d9637116ec516bf0e.tar.gz |
snapshot of project "lynx", label v2_6_961130
Diffstat (limited to 'WWW/Library/Implementation/HTParse.h')
-rw-r--r-- | WWW/Library/Implementation/HTParse.h | 110 |
1 files changed, 65 insertions, 45 deletions
diff --git a/WWW/Library/Implementation/HTParse.h b/WWW/Library/Implementation/HTParse.h index 669837c2..30cb74f5 100644 --- a/WWW/Library/Implementation/HTParse.h +++ b/WWW/Library/Implementation/HTParse.h @@ -1,9 +1,10 @@ -/* HTParse: URL parsing in the WWW Library - HTPARSE - - This module of the WWW library contains code to parse URLs and various related things. +/* HTParse: URL parsing in the WWW Library + HTPARSE + + This module of the WWW library contains code to parse URLs and various + related things. Implemented by HTParse.c . - + */ #ifndef HTPARSE_H #define HTPARSE_H @@ -14,9 +15,9 @@ /* - The following are flag bits which may be ORed together to form a number to give the - 'wanted' argument to HTParse. - + The following are flag bits which may be ORed together to form a number to + give the 'wanted' argument to HTParse. + */ #define PARSE_ACCESS 16 #define PARSE_HOST 8 @@ -30,21 +31,21 @@ HTParse: Parse a URL relative to another URL - This returns those parts of a name which are given (and requested) substituting bits - from the related name where necessary. - + This returns those parts of a name which are given (and requested) + substituting bits from the related name where necessary. + ON ENTRY - + aName A filename given - + relatedName A name relative to which aName is to be parsed - + wanted A mask for the bits which are wanted. - + ON EXIT, - + returns A pointer to a malloc'd string which MUST BE FREED - + */ extern char * HTParse PARAMS(( @@ -58,11 +59,11 @@ extern char * HTParse PARAMS(( HTStrip: Strip white space off a string ON EXIT - + Return value points to first non-white character, or to 0 if none. - + All trailing white space is OVERWRITTEN with zero. - + */ extern char * HTStrip PARAMS(( char * s)); @@ -71,11 +72,11 @@ extern char * HTStrip PARAMS(( HTSimplify: Simplify a UTL - A URL is allowed to contain the seqeunce xxx/../ which may be replaced by "" , and the - seqeunce "/./" which may be replaced by "/". Simplification helps us recognize - duplicate filenames. It doesn't deal with soft links, though. The new (shorter) - filename overwrites the old. - + A URL is allowed to contain the seqeunce xxx/../ which may be replaced by + "" , and the seqeunce "/./" which may be replaced by "/". Simplification + helps us recognize duplicate filenames. It doesn't deal with soft links, + though. The new (shorter) filename overwrites the old. + */ /* ** Thus, /etc/junk/../fred becomes /etc/fred @@ -89,19 +90,20 @@ extern void HTSimplify PARAMS(( HTRelative: Make Relative (Partial) URL - This function creates and returns a string which gives an expression of one address as - related to another. Where there is no relation, an absolute address is retured. - + This function creates and returns a string which gives an expression of one + address as related to another. Where there is no relation, an absolute + address is retured. + ON ENTRY, - + Both names must be absolute, fully qualified names of nodes (no anchor bits) - + ON EXIT, - - The return result points to a newly allocated name which, if parsed by HTParse relative - to relatedName, will yield aName. The caller is responsible for freeing the resulting - name later. - + + The return result points to a newly allocated name which, if parsed by + HTParse relative to relatedName, will yield aName. The caller is + responsible for freeing the resulting name later. + */ extern char * HTRelative PARAMS(( CONST char * aName, @@ -112,10 +114,11 @@ extern char * HTRelative PARAMS(( HTEscape: Encode unacceptable characters in string - This funtion takes a string containing any sequence of ASCII characters, and returns a - malloced string containing the same infromation but with all "unacceptable" characters - represented in the form %xy where X and Y are two hex digits. - + This function takes a string containing any sequence of ASCII characters, + and returns a malloced string containing the same infromation but with all + "unacceptable" characters represented in the form %xy where X and Y are two + hex digits. + */ extern char * HTEscape PARAMS(( CONST char * str, @@ -128,8 +131,9 @@ extern char * HTEscapeSP PARAMS(( /* - The following are valid mask values. The terms are the BNF names in the URL document. - + The following are valid mask values. The terms are the BNF names in the URL + document. + */ #define URL_XALPHAS (unsigned char) 1 #define URL_XPALPHAS (unsigned char) 2 @@ -140,15 +144,31 @@ extern char * HTEscapeSP PARAMS(( HTUnEscape: Decode %xx escaped characters - This function takes a pointer to a string in which character smay have been encoded in - %xy form, where xy is the acsii hex code for character 16x+y. The string is converted - in place, as it will never grow. - + This function takes a pointer to a string in which character smay have been + encoded in %xy form, where xy is the acsii hex code for character 16x+y. + The string is converted in place, as it will never grow. + */ extern char * HTUnEscape PARAMS(( char * str)); +/* + +HTUnEscapeSome: Decode some %xx escaped characters - KW + + This function takes a pointer to a string in which some characters may have + been encoded in %xy form, where xy is the acsii hex code for character + 16x+y, and a pointer to a second string containing one or more characters + which should be unescaped if escaped in the first string. + The first string is converted in place, as it will never grow. + + */ +extern char * HTUnEscapeSome PARAMS(( + char * str, + CONST char * do_trans)); + + #endif /* HTPARSE_H */ |