blob: db48262b136f3c8895832a43cc5cad4c6b5edb9f [file] [log] [blame]
Owen Taylor3473f882001-02-23 17:55:21 +00001/**
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: library of generic URI related routines
3 * Description: library of generic URI related routines
4 * Implements RFC 2396
Owen Taylor3473f882001-02-23 17:55:21 +00005 *
Daniel Veillardbe586972003-11-18 20:56:51 +00006 * Copy: See Copyright for the status of this software.
Owen Taylor3473f882001-02-23 17:55:21 +00007 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * Author: Daniel Veillard
Owen Taylor3473f882001-02-23 17:55:21 +00009 */
10
11#ifndef __XML_URI_H__
12#define __XML_URI_H__
13
Igor Zlatkovic76874e42003-08-25 09:05:12 +000014#include <libxml/xmlversion.h>
Owen Taylor3473f882001-02-23 17:55:21 +000015#include <libxml/tree.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21/**
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000022 * xmlURI:
Owen Taylor3473f882001-02-23 17:55:21 +000023 *
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000024 * A parsed URI reference. This is a struct containing the various fields
Daniel Veillard61f26172002-03-12 18:46:39 +000025 * as described in RFC 2396 but separated for further processing.
Daniel Veillarda1413b82007-04-26 08:33:28 +000026 *
27 * Note: query is a deprecated field which is incorrectly unescaped.
28 * query_raw takes precedence over query if the former is set.
29 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
Owen Taylor3473f882001-02-23 17:55:21 +000030 */
31typedef struct _xmlURI xmlURI;
32typedef xmlURI *xmlURIPtr;
33struct _xmlURI {
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000034 char *scheme; /* the URI scheme */
35 char *opaque; /* opaque part */
36 char *authority; /* the authority part */
37 char *server; /* the server part */
38 char *user; /* the user part */
39 int port; /* the port number */
40 char *path; /* the path string */
Daniel Veillarda1413b82007-04-26 08:33:28 +000041 char *query; /* the query string (deprecated - use with caution) */
Daniel Veillardf69bb4b2001-05-19 13:24:56 +000042 char *fragment; /* the fragment identifier */
Daniel Veillardbb6808e2001-10-29 23:59:27 +000043 int cleanup; /* parsing potentially unclean URI */
Daniel Veillarda1413b82007-04-26 08:33:28 +000044 char *query_raw; /* the query string (as it appears in the URI) */
Owen Taylor3473f882001-02-23 17:55:21 +000045};
46
47/*
48 * This function is in tree.h:
49 * xmlChar * xmlNodeGetBase (xmlDocPtr doc,
50 * xmlNodePtr cur);
51 */
Daniel Veillardd7af5552008-08-04 15:29:44 +000052XMLPUBFUN xmlURIPtr XMLCALL
Igor Zlatkovic76874e42003-08-25 09:05:12 +000053 xmlCreateURI (void);
Daniel Veillardd7af5552008-08-04 15:29:44 +000054XMLPUBFUN xmlChar * XMLCALL
Daniel Veillard336a8e12005-08-07 10:46:19 +000055 xmlBuildURI (const xmlChar *URI,
Daniel Veillardd7af5552008-08-04 15:29:44 +000056 const xmlChar *base);
57XMLPUBFUN xmlChar * XMLCALL
William M. Brackf7789b12004-06-07 08:57:27 +000058 xmlBuildRelativeURI (const xmlChar *URI,
Daniel Veillardd7af5552008-08-04 15:29:44 +000059 const xmlChar *base);
60XMLPUBFUN xmlURIPtr XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000061 xmlParseURI (const char *str);
Daniel Veillardd7af5552008-08-04 15:29:44 +000062XMLPUBFUN xmlURIPtr XMLCALL
Daniel Veillard336a8e12005-08-07 10:46:19 +000063 xmlParseURIRaw (const char *str,
64 int raw);
Daniel Veillardd7af5552008-08-04 15:29:44 +000065XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000066 xmlParseURIReference (xmlURIPtr uri,
Owen Taylor3473f882001-02-23 17:55:21 +000067 const char *str);
Daniel Veillardd7af5552008-08-04 15:29:44 +000068XMLPUBFUN xmlChar * XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000069 xmlSaveUri (xmlURIPtr uri);
Daniel Veillardd7af5552008-08-04 15:29:44 +000070XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000071 xmlPrintURI (FILE *stream,
Owen Taylor3473f882001-02-23 17:55:21 +000072 xmlURIPtr uri);
Daniel Veillardd7af5552008-08-04 15:29:44 +000073XMLPUBFUN xmlChar * XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000074 xmlURIEscapeStr (const xmlChar *str,
Daniel Veillardd7af5552008-08-04 15:29:44 +000075 const xmlChar *list);
76XMLPUBFUN char * XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000077 xmlURIUnescapeString (const char *str,
Owen Taylor3473f882001-02-23 17:55:21 +000078 int len,
79 char *target);
Daniel Veillardd7af5552008-08-04 15:29:44 +000080XMLPUBFUN int XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000081 xmlNormalizeURIPath (char *path);
Daniel Veillardd7af5552008-08-04 15:29:44 +000082XMLPUBFUN xmlChar * XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000083 xmlURIEscape (const xmlChar *str);
Daniel Veillardd7af5552008-08-04 15:29:44 +000084XMLPUBFUN void XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000085 xmlFreeURI (xmlURIPtr uri);
Daniel Veillardd7af5552008-08-04 15:29:44 +000086XMLPUBFUN xmlChar* XMLCALL
Igor Zlatkovicaa3cfbd2003-08-27 08:59:58 +000087 xmlCanonicPath (const xmlChar *path);
Daniel Veillardd7af5552008-08-04 15:29:44 +000088XMLPUBFUN xmlChar* XMLCALL
Daniel Veillardb8efdda2006-10-10 12:37:14 +000089 xmlPathToURI (const xmlChar *path);
Owen Taylor3473f882001-02-23 17:55:21 +000090
91#ifdef __cplusplus
92}
93#endif
94#endif /* __XML_URI_H__ */