xref: /aosp_15_r20/external/libxml2/include/libxml/uri.h (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1 /**
2  * Summary: library of generic URI related routines
3  * Description: library of generic URI related routines
4  *              Implements RFC 2396
5  *
6  * Copy: See Copyright for the status of this software.
7  *
8  * Author: Daniel Veillard
9  */
10 
11 #ifndef __XML_URI_H__
12 #define __XML_URI_H__
13 
14 #include <stdio.h>
15 #include <libxml/xmlversion.h>
16 #include <libxml/xmlstring.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 /**
23  * xmlURI:
24  *
25  * A parsed URI reference. This is a struct containing the various fields
26  * as described in RFC 2396 but separated for further processing.
27  *
28  * Note: query is a deprecated field which is incorrectly unescaped.
29  * query_raw takes precedence over query if the former is set.
30  * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
31  */
32 typedef struct _xmlURI xmlURI;
33 typedef xmlURI *xmlURIPtr;
34 struct _xmlURI {
35     char *scheme;	/* the URI scheme */
36     char *opaque;	/* opaque part */
37     char *authority;	/* the authority part */
38     char *server;	/* the server part */
39     char *user;		/* the user part */
40     int port;		/* the port number */
41     char *path;		/* the path string */
42     char *query;	/* the query string (deprecated - use with caution) */
43     char *fragment;	/* the fragment identifier */
44     int  cleanup;	/* parsing potentially unclean URI */
45     char *query_raw;	/* the query string (as it appears in the URI) */
46 };
47 
48 /*
49  * This function is in tree.h:
50  * xmlChar *	xmlNodeGetBase	(xmlDocPtr doc,
51  *                               xmlNodePtr cur);
52  */
53 XMLPUBFUN xmlURIPtr
54 		xmlCreateURI		(void);
55 XMLPUBFUN int
56 		xmlBuildURISafe		(const xmlChar *URI,
57 					 const xmlChar *base,
58 					 xmlChar **out);
59 XMLPUBFUN xmlChar *
60 		xmlBuildURI		(const xmlChar *URI,
61 					 const xmlChar *base);
62 XMLPUBFUN int
63 		xmlBuildRelativeURISafe	(const xmlChar *URI,
64 					 const xmlChar *base,
65 					 xmlChar **out);
66 XMLPUBFUN xmlChar *
67 		xmlBuildRelativeURI	(const xmlChar *URI,
68 					 const xmlChar *base);
69 XMLPUBFUN xmlURIPtr
70 		xmlParseURI		(const char *str);
71 XMLPUBFUN int
72 		xmlParseURISafe		(const char *str,
73 					 xmlURIPtr *uri);
74 XMLPUBFUN xmlURIPtr
75 		xmlParseURIRaw		(const char *str,
76 					 int raw);
77 XMLPUBFUN int
78 		xmlParseURIReference	(xmlURIPtr uri,
79 					 const char *str);
80 XMLPUBFUN xmlChar *
81 		xmlSaveUri		(xmlURIPtr uri);
82 XMLPUBFUN void
83 		xmlPrintURI		(FILE *stream,
84 					 xmlURIPtr uri);
85 XMLPUBFUN xmlChar *
86 		xmlURIEscapeStr         (const xmlChar *str,
87 					 const xmlChar *list);
88 XMLPUBFUN char *
89 		xmlURIUnescapeString	(const char *str,
90 					 int len,
91 					 char *target);
92 XMLPUBFUN int
93 		xmlNormalizeURIPath	(char *path);
94 XMLPUBFUN xmlChar *
95 		xmlURIEscape		(const xmlChar *str);
96 XMLPUBFUN void
97 		xmlFreeURI		(xmlURIPtr uri);
98 XMLPUBFUN xmlChar*
99 		xmlCanonicPath		(const xmlChar *path);
100 XMLPUBFUN xmlChar*
101 		xmlPathToURI		(const xmlChar *path);
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 #endif /* __XML_URI_H__ */
107