• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* libxml2 - Library for parsing XML documents
2  * Copyright (C) 2006-2019 Free Software Foundation, Inc.
3  *
4  * This file is not part of the GNU gettext program, but is used with
5  * GNU gettext.
6  *
7  * The original copyright notice is as follows:
8  */
9 
10 /*
11  * Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a copy
14  * of this software and associated documentation files (the "Software"), to deal
15  * in the Software without restriction, including without limitation the rights
16  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17  * copies of the Software, and to permit persons to whom the Software is fur-
18  * nished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included in
21  * all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
25  * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
26  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29  * THE SOFTWARE.
30  *
31  * Author: Daniel Veillard
32  */
33 
34 /**
35  * Summary: library of generic URI related routines
36  * Description: library of generic URI related routines
37  *              Implements RFC 2396
38  */
39 
40 #ifndef __XML_URI_H__
41 #define __XML_URI_H__
42 
43 #include <libxml/xmlversion.h>
44 #include <libxml/tree.h>
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /**
51  * xmlURI:
52  *
53  * A parsed URI reference. This is a struct containing the various fields
54  * as described in RFC 2396 but separated for further processing.
55  *
56  * Note: query is a deprecated field which is incorrectly unescaped.
57  * query_raw takes precedence over query if the former is set.
58  * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
59  */
60 typedef struct _xmlURI xmlURI;
61 typedef xmlURI *xmlURIPtr;
62 struct _xmlURI {
63     char *scheme;	/* the URI scheme */
64     char *opaque;	/* opaque part */
65     char *authority;	/* the authority part */
66     char *server;	/* the server part */
67     char *user;		/* the user part */
68     int port;		/* the port number */
69     char *path;		/* the path string */
70     char *query;	/* the query string (deprecated - use with caution) */
71     char *fragment;	/* the fragment identifier */
72     int  cleanup;	/* parsing potentially unclean URI */
73     char *query_raw;	/* the query string (as it appears in the URI) */
74 };
75 
76 /*
77  * This function is in tree.h:
78  * xmlChar *	xmlNodeGetBase	(xmlDocPtr doc,
79  *                               xmlNodePtr cur);
80  */
81 XMLPUBFUN xmlURIPtr XMLCALL
82 		xmlCreateURI		(void);
83 XMLPUBFUN xmlChar * XMLCALL
84 		xmlBuildURI		(const xmlChar *URI,
85 					 const xmlChar *base);
86 XMLPUBFUN xmlChar * XMLCALL
87 		xmlBuildRelativeURI	(const xmlChar *URI,
88 					 const xmlChar *base);
89 XMLPUBFUN xmlURIPtr XMLCALL
90 		xmlParseURI		(const char *str);
91 XMLPUBFUN xmlURIPtr XMLCALL
92 		xmlParseURIRaw		(const char *str,
93 					 int raw);
94 XMLPUBFUN int XMLCALL
95 		xmlParseURIReference	(xmlURIPtr uri,
96 					 const char *str);
97 XMLPUBFUN xmlChar * XMLCALL
98 		xmlSaveUri		(xmlURIPtr uri);
99 XMLPUBFUN void XMLCALL
100 		xmlPrintURI		(FILE *stream,
101 					 xmlURIPtr uri);
102 XMLPUBFUN xmlChar * XMLCALL
103 		xmlURIEscapeStr         (const xmlChar *str,
104 					 const xmlChar *list);
105 XMLPUBFUN char * XMLCALL
106 		xmlURIUnescapeString	(const char *str,
107 					 int len,
108 					 char *target);
109 XMLPUBFUN int XMLCALL
110 		xmlNormalizeURIPath	(char *path);
111 XMLPUBFUN xmlChar * XMLCALL
112 		xmlURIEscape		(const xmlChar *str);
113 XMLPUBFUN void XMLCALL
114 		xmlFreeURI		(xmlURIPtr uri);
115 XMLPUBFUN xmlChar* XMLCALL
116 		xmlCanonicPath		(const xmlChar *path);
117 XMLPUBFUN xmlChar* XMLCALL
118 		xmlPathToURI		(const xmlChar *path);
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 #endif /* __XML_URI_H__ */
124