Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 1 | /** |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 2 | * Summary: library of generic URI related routines |
| 3 | * Description: library of generic URI related routines |
| 4 | * Implements RFC 2396 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 5 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 6 | * Copy: See Copyright for the status of this software. |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 7 | * |
Daniel Veillard | be58697 | 2003-11-18 20:56:51 +0000 | [diff] [blame] | 8 | * Author: Daniel Veillard |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef __XML_URI_H__ |
| 12 | #define __XML_URI_H__ |
| 13 | |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 14 | #include <libxml/xmlversion.h> |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 15 | #include <libxml/tree.h> |
| 16 | |
| 17 | #ifdef __cplusplus |
| 18 | extern "C" { |
| 19 | #endif |
| 20 | |
| 21 | /** |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 22 | * xmlURI: |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 23 | * |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 24 | * A parsed URI reference. This is a struct containing the various fields |
Daniel Veillard | 61f2617 | 2002-03-12 18:46:39 +0000 | [diff] [blame] | 25 | * as described in RFC 2396 but separated for further processing. |
Daniel Veillard | a1413b8 | 2007-04-26 08:33:28 +0000 | [diff] [blame] | 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 |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 30 | */ |
| 31 | typedef struct _xmlURI xmlURI; |
| 32 | typedef xmlURI *xmlURIPtr; |
| 33 | struct _xmlURI { |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 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 */ |
Daniel Veillard | a1413b8 | 2007-04-26 08:33:28 +0000 | [diff] [blame] | 41 | char *query; /* the query string (deprecated - use with caution) */ |
Daniel Veillard | f69bb4b | 2001-05-19 13:24:56 +0000 | [diff] [blame] | 42 | char *fragment; /* the fragment identifier */ |
Daniel Veillard | bb6808e | 2001-10-29 23:59:27 +0000 | [diff] [blame] | 43 | int cleanup; /* parsing potentially unclean URI */ |
Daniel Veillard | a1413b8 | 2007-04-26 08:33:28 +0000 | [diff] [blame] | 44 | char *query_raw; /* the query string (as it appears in the URI) */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | /* |
| 48 | * This function is in tree.h: |
| 49 | * xmlChar * xmlNodeGetBase (xmlDocPtr doc, |
| 50 | * xmlNodePtr cur); |
| 51 | */ |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 52 | XMLPUBFUN xmlURIPtr XMLCALL |
Igor Zlatkovic | 76874e4 | 2003-08-25 09:05:12 +0000 | [diff] [blame] | 53 | xmlCreateURI (void); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 54 | XMLPUBFUN xmlChar * XMLCALL |
Daniel Veillard | 336a8e1 | 2005-08-07 10:46:19 +0000 | [diff] [blame] | 55 | xmlBuildURI (const xmlChar *URI, |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 56 | const xmlChar *base); |
| 57 | XMLPUBFUN xmlChar * XMLCALL |
William M. Brack | f7789b1 | 2004-06-07 08:57:27 +0000 | [diff] [blame] | 58 | xmlBuildRelativeURI (const xmlChar *URI, |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 59 | const xmlChar *base); |
| 60 | XMLPUBFUN xmlURIPtr XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 61 | xmlParseURI (const char *str); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 62 | XMLPUBFUN xmlURIPtr XMLCALL |
Daniel Veillard | 336a8e1 | 2005-08-07 10:46:19 +0000 | [diff] [blame] | 63 | xmlParseURIRaw (const char *str, |
| 64 | int raw); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 65 | XMLPUBFUN int XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 66 | xmlParseURIReference (xmlURIPtr uri, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 67 | const char *str); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 68 | XMLPUBFUN xmlChar * XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 69 | xmlSaveUri (xmlURIPtr uri); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 70 | XMLPUBFUN void XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 71 | xmlPrintURI (FILE *stream, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 72 | xmlURIPtr uri); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 73 | XMLPUBFUN xmlChar * XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 74 | xmlURIEscapeStr (const xmlChar *str, |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 75 | const xmlChar *list); |
| 76 | XMLPUBFUN char * XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 77 | xmlURIUnescapeString (const char *str, |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 78 | int len, |
| 79 | char *target); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 80 | XMLPUBFUN int XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 81 | xmlNormalizeURIPath (char *path); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 82 | XMLPUBFUN xmlChar * XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 83 | xmlURIEscape (const xmlChar *str); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 84 | XMLPUBFUN void XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 85 | xmlFreeURI (xmlURIPtr uri); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 86 | XMLPUBFUN xmlChar* XMLCALL |
Igor Zlatkovic | aa3cfbd | 2003-08-27 08:59:58 +0000 | [diff] [blame] | 87 | xmlCanonicPath (const xmlChar *path); |
Daniel Veillard | d7af555 | 2008-08-04 15:29:44 +0000 | [diff] [blame] | 88 | XMLPUBFUN xmlChar* XMLCALL |
Daniel Veillard | b8efdda | 2006-10-10 12:37:14 +0000 | [diff] [blame] | 89 | xmlPathToURI (const xmlChar *path); |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 90 | |
| 91 | #ifdef __cplusplus |
| 92 | } |
| 93 | #endif |
| 94 | #endif /* __XML_URI_H__ */ |