HTParse

/*
**	(c) COPYRIGHT CERN 1994.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
This module contains code to parse URIs and various related things such as: This module is implemented by HTParse.c, and it is a part of the Library of Common Code.
#ifndef HTPARSE_H
#define HTPARSE_H

#include "RoverEscape.h"

HTParse: Parse a URI relative to another URI

This returns those parts of a name which are given (and requested) substituting bits from the related name where necessary.

Control Flags for 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
#define PARSE_PATH		 4
#define PARSE_ANCHOR		 2
#define PARSE_PUNCTUATION	 1
#define PARSE_ALL		31

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((	const char * aName,
				const char * relatedName,
				int wanted));

HTRelative: Make Relative (Partial) URI

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.
extern char * HTRelative PARAMS((const char * aName, const char *relatedName));
#endif	/* HTPARSE_H */
End of HTParse Module