#line 8 "uri.c-nw"
#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;