blob: 874151c416a9f54dfb1f37c6af798261058546d1 [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/**
2 * uri.c: library of generic URI related routines
3 *
4 * Reference: RFC 2396
5 *
6 * See Copyright for the status of this software.
7 *
8 * Daniel.Veillard@w3.org
9 */
10
11#ifndef __XML_URI_H__
12#define __XML_URI_H__
13
14#include <libxml/tree.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/**
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000021 * xmlURI:
Owen Taylor3473f882001-02-23 17:55:21 +000022 *
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000023 * A parsed URI reference. This is a struct containing the various fields
24 * as described in RFC 2396 but separated for further processing
Owen Taylor3473f882001-02-23 17:55:21 +000025 */
26typedef struct _xmlURI xmlURI;
27typedef xmlURI *xmlURIPtr;
28struct _xmlURI {
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000029 char *scheme; /* the URI scheme */
30 char *opaque; /* opaque part */
31 char *authority; /* the authority part */
32 char *server; /* the server part */
33 char *user; /* the user part */
34 int port; /* the port number */
35 char *path; /* the path string */
36 char *query; /* the query string */
37 char *fragment; /* the fragment identifier */
Owen Taylor3473f882001-02-23 17:55:21 +000038};
39
40/*
41 * This function is in tree.h:
42 * xmlChar * xmlNodeGetBase (xmlDocPtr doc,
43 * xmlNodePtr cur);
44 */
45xmlURIPtr xmlCreateURI (void);
46xmlChar * xmlBuildURI (const xmlChar *URI,
47 const xmlChar *base);
48xmlURIPtr xmlParseURI (const char *URI);
49int xmlParseURIReference (xmlURIPtr uri,
50 const char *str);
51xmlChar * xmlSaveUri (xmlURIPtr uri);
52void xmlPrintURI (FILE *stream,
53 xmlURIPtr uri);
Daniel Veillard8514c672001-05-23 10:29:12 +000054xmlChar * xmlURIEscapeStr (const xmlChar *str,
55 const xmlChar *list);
Owen Taylor3473f882001-02-23 17:55:21 +000056char * xmlURIUnescapeString (const char *str,
57 int len,
58 char *target);
59int xmlNormalizeURIPath (char *path);
60xmlChar * xmlURIEscape (const xmlChar *str);
61void xmlFreeURI (xmlURIPtr uri);
62
63#ifdef __cplusplus
64}
65#endif
66#endif /* __XML_URI_H__ */