/ libxml2 / include / libxml / uri.h
uri.h
 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 <libxml/xmlversion.h>
15  #include <libxml/tree.h>
16  
17  #ifdef __cplusplus
18  extern "C" {
19  #endif
20  
21  /**
22   * xmlURI:
23   *
24   * A parsed URI reference. This is a struct containing the various fields
25   * as described in RFC 2396 but separated for further processing.
26   *
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
30   */
31  typedef struct _xmlURI xmlURI;
32  typedef xmlURI *xmlURIPtr;
33  struct _xmlURI {
34      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 */
41      char *query;	/* the query string (deprecated - use with caution) */
42      char *fragment;	/* the fragment identifier */
43      int  cleanup;	/* parsing potentially unclean URI */
44      char *query_raw;	/* the query string (as it appears in the URI) */
45  };
46  
47  /*
48   * This function is in tree.h:
49   * xmlChar *	xmlNodeGetBase	(xmlDocPtr doc,
50   *                               xmlNodePtr cur);
51   */
52  XMLPUBFUN xmlURIPtr XMLCALL
53  		xmlCreateURI		(void);
54  XMLPUBFUN xmlChar * XMLCALL
55  		xmlBuildURI		(const xmlChar *URI,
56  					 const xmlChar *base);
57  XMLPUBFUN xmlChar * XMLCALL
58  		xmlBuildRelativeURI	(const xmlChar *URI,
59  					 const xmlChar *base);
60  XMLPUBFUN xmlURIPtr XMLCALL
61  		xmlParseURI		(const char *str);
62  XMLPUBFUN xmlURIPtr XMLCALL
63  		xmlParseURIRaw		(const char *str,
64  					 int raw);
65  XMLPUBFUN int XMLCALL
66  		xmlParseURIReference	(xmlURIPtr uri,
67  					 const char *str);
68  XMLPUBFUN xmlChar * XMLCALL
69  		xmlSaveUri		(xmlURIPtr uri);
70  XMLPUBFUN void XMLCALL
71  		xmlPrintURI		(FILE *stream,
72  					 xmlURIPtr uri);
73  XMLPUBFUN xmlChar * XMLCALL
74  		xmlURIEscapeStr         (const xmlChar *str,
75  					 const xmlChar *list);
76  XMLPUBFUN char * XMLCALL
77  		xmlURIUnescapeString	(const char *str,
78  					 int len,
79  					 char *target);
80  XMLPUBFUN int XMLCALL
81  		xmlNormalizeURIPath	(char *path);
82  XMLPUBFUN xmlChar * XMLCALL
83  		xmlURIEscape		(const xmlChar *str);
84  XMLPUBFUN void XMLCALL
85  		xmlFreeURI		(xmlURIPtr uri);
86  XMLPUBFUN xmlChar* XMLCALL
87  		xmlCanonicPath		(const xmlChar *path);
88  XMLPUBFUN xmlChar* XMLCALL
89  		xmlPathToURI		(const xmlChar *path);
90  
91  #ifdef __cplusplus
92  }
93  #endif
94  #endif /* __XML_URI_H__ */