	Type definitions for URIs

	The fields of the [[URI]] struct may still contain URL
	escapes in the [[path]] and [[search]] fields. The other
	fields are unescaped.

<<*>>=
#include <config.h>
#include <str.h>

EXPORT typedef enum {
    URI_none,					/* Unrecognized */
    URI_URL,					/* Full URL */
    URI_URN,					/* URN? */
    URI_Rel					/* Relative URL */
} URIType;

EXPORT typedef struct {
    URIType tp;					/* URL, URN, or Relative */
    Strip scheme;				/* E.g., http, ftp, etc */
    Strip user;
    Strip passw;
    Strip host;					/* E.g., www.cern.ch */
    Strip port;					/* E.g., 80 */
    Strip path;					/* E.g., /dir/sub/text.txt */
    Strip anchor;				/* Target anchor */
    Strip search;				/* E.g., ?hl=156 */
    Bool is_dir;				/* If path ends in '/' */
} URI;
