1 /* Parse HyperText Document Address HTParse.h
2 ** ================================
4 /* These are flag bits which may be ORed together to form a number to give
5 ** the 'wanted' argument to HTParse.
7 #define PARSE_ACCESS 16
10 #define PARSE_ANCHOR 2
11 #define PARSE_PUNCTUATION 1
14 /* Parse a Name relative to another name
15 ** -------------------------------------
17 ** This returns those parts of a name which are given (and requested)
18 ** substituting bits from the related name where necessary.
21 ** aName A filename given
22 ** relatedName A name relative to ehich aName is to be parsed
23 ** wanted A mask for the bits which are wanted.
26 ** returns A pointer to a malloc'd string which MUST BE FREED
29 extern char * HTParse(const char * aName, const char * relatedName, int wanted);
31 extern char * HTParse();
34 /* Strip white space off a string
35 ** ------------------------------
38 ** Return value points to first non-white character, or to 0 if none.
39 ** All trailing white space is OVERWRITTEN with zero.
42 extern char * HTStrip(char * s);
44 extern char * HTStrip();
47 /* Simplify a filename
48 ** -------------------
50 ** A unix-style file is allowed to contain the seqeunce xxx/../ which
51 ** may be replaced by "" , and the seqeunce "/./" which may be replaced
53 ** Simplification helps us recognize duplicate filenames. It doesn't deal
54 ** with soft links, though.
55 ** The new (shorter) filename overwrites the old.
57 ** Thus, /etc/junk/../fred becomes /etc/fred
58 ** /etc/junk/./fred becomes /etc/junk/fred
61 extern void HTSimplify(char * filename);
63 extern void HTSimplify();
69 ** This function creates and returns a string which gives an expression of
70 ** one address as related to another. Where there is no relation, an
71 ** absolute address is retured.
74 ** Both names must be absolute, fully qualified names of nodes
78 ** The return result points to a newly allocated name which, if parsed
79 ** by HTParse relative to relatedName, will yield aName. The caller is
80 ** responsible for freeing the resulting name later.
84 extern char * HTRelative(const char * aName, const char *relatedName);
86 extern char * HTRelative();