uri.h 2.5 KB

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