You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.6 KiB

4 years ago
  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. #ifndef __XML_URI_H__
  11. #define __XML_URI_H__
  12. #include <libxml/xmlversion.h>
  13. #include <libxml/tree.h>
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /**
  18. * xmlURI:
  19. *
  20. * A parsed URI reference. This is a struct containing the various fields
  21. * as described in RFC 2396 but separated for further processing.
  22. *
  23. * Note: query is a deprecated field which is incorrectly unescaped.
  24. * query_raw takes precedence over query if the former is set.
  25. * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
  26. */
  27. typedef struct _xmlURI xmlURI;
  28. typedef xmlURI *xmlURIPtr;
  29. struct _xmlURI {
  30. char *scheme; /* the URI scheme */
  31. char *opaque; /* opaque part */
  32. char *authority; /* the authority part */
  33. char *server; /* the server part */
  34. char *user; /* the user part */
  35. int port; /* the port number */
  36. char *path; /* the path string */
  37. char *query; /* the query string (deprecated - use with caution) */
  38. char *fragment; /* the fragment identifier */
  39. int cleanup; /* parsing potentially unclean URI */
  40. char *query_raw; /* the query string (as it appears in the URI) */
  41. };
  42. /*
  43. * This function is in tree.h:
  44. * xmlChar * xmlNodeGetBase (xmlDocPtr doc,
  45. * xmlNodePtr cur);
  46. */
  47. XMLPUBFUN xmlURIPtr XMLCALL
  48. xmlCreateURI (void);
  49. XMLPUBFUN xmlChar * XMLCALL
  50. xmlBuildURI (const xmlChar *URI,
  51. const xmlChar *base);
  52. XMLPUBFUN xmlChar * XMLCALL
  53. xmlBuildRelativeURI (const xmlChar *URI,
  54. const xmlChar *base);
  55. XMLPUBFUN xmlURIPtr XMLCALL
  56. xmlParseURI (const char *str);
  57. XMLPUBFUN xmlURIPtr XMLCALL
  58. xmlParseURIRaw (const char *str,
  59. int raw);
  60. XMLPUBFUN int XMLCALL
  61. xmlParseURIReference (xmlURIPtr uri,
  62. const char *str);
  63. XMLPUBFUN xmlChar * XMLCALL
  64. xmlSaveUri (xmlURIPtr uri);
  65. XMLPUBFUN void XMLCALL
  66. xmlPrintURI (FILE *stream,
  67. xmlURIPtr uri);
  68. XMLPUBFUN xmlChar * XMLCALL
  69. xmlURIEscapeStr (const xmlChar *str,
  70. const xmlChar *list);
  71. XMLPUBFUN char * XMLCALL
  72. xmlURIUnescapeString (const char *str,
  73. int len,
  74. char *target);
  75. XMLPUBFUN int XMLCALL
  76. xmlNormalizeURIPath (char *path);
  77. XMLPUBFUN xmlChar * XMLCALL
  78. xmlURIEscape (const xmlChar *str);
  79. XMLPUBFUN void XMLCALL
  80. xmlFreeURI (xmlURIPtr uri);
  81. XMLPUBFUN xmlChar* XMLCALL
  82. xmlCanonicPath (const xmlChar *path);
  83. XMLPUBFUN xmlChar* XMLCALL
  84. xmlPathToURI (const xmlChar *path);
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88. #endif /* __XML_URI_H__ */