Debian Codegraph @

include/libxml/uri.h

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