codekingpro/portable-devtools
114k
1/**2 * Summary: library of generic URI related routines3 * Description: library of generic URI related routines4 * Implements RFC 23965 *6 * Copy: See Copyright for the status of this software.7 *8 * Author: Daniel Veillard9 */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 __cplusplus18extern "C" {19#endif20 21/**22 * xmlURI:23 *24 * A parsed URI reference. This is a struct containing the various fields25 * 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#0012730 */31typedef struct _xmlURI xmlURI;32typedef xmlURI *xmlURIPtr;33struct _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 */52XMLPUBFUN xmlURIPtr53 xmlCreateURI (void);54XMLPUBFUN xmlChar *55 xmlBuildURI (const xmlChar *URI,56 const xmlChar *base);57XMLPUBFUN xmlChar *58 xmlBuildRelativeURI (const xmlChar *URI,59 const xmlChar *base);60XMLPUBFUN xmlURIPtr61 xmlParseURI (const char *str);62XMLPUBFUN xmlURIPtr63 xmlParseURIRaw (const char *str,64 int raw);65XMLPUBFUN int66 xmlParseURIReference (xmlURIPtr uri,67 const char *str);68XMLPUBFUN xmlChar *69 xmlSaveUri (xmlURIPtr uri);70XMLPUBFUN void71 xmlPrintURI (FILE *stream,72 xmlURIPtr uri);73XMLPUBFUN xmlChar *74 xmlURIEscapeStr (const xmlChar *str,75 const xmlChar *list);76XMLPUBFUN char *77 xmlURIUnescapeString (const char *str,78 int len,79 char *target);80XMLPUBFUN int81 xmlNormalizeURIPath (char *path);82XMLPUBFUN xmlChar *83 xmlURIEscape (const xmlChar *str);84XMLPUBFUN void85 xmlFreeURI (xmlURIPtr uri);86XMLPUBFUN xmlChar*87 xmlCanonicPath (const xmlChar *path);88XMLPUBFUN xmlChar*89 xmlPathToURI (const xmlChar *path);90 91#ifdef __cplusplus92}93#endif94#endif /* __XML_URI_H__ */95 