From 37162209a3da8812203022de6b81e4f05015043a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 16 Nov 2018 07:14:58 +0100 Subject: New upstream version 0.9.0 --- doc/Mainpage.txt | 58 ++++++++++++++++---------------------------------------- 1 file changed, 16 insertions(+), 42 deletions(-) (limited to 'doc/Mainpage.txt') diff --git a/doc/Mainpage.txt b/doc/Mainpage.txt index 173511b..bb5723c 100644 --- a/doc/Mainpage.txt +++ b/doc/Mainpage.txt @@ -27,50 +27,24 @@ * Parsing a URI with uriparser looks like this: * * @code - * UriParserStateA state; * UriUriA uri; + * const char * const uriString = "file:///home/user/song.mp3"; + * const char * errorPos; * - * state.uri = &uri; - * if (uriParseUriA(&state, "file:///home/user/song.mp3") != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&uri); + * if (uriParseSingleUriA(&uri, uriString, &errorPos) != URI_SUCCESS) { + * /COMMENT_HACK* Failure (no need to call uriFreeUriMembersA) *COMMENT_HACK/ * ... + * return ...; * } + * + * /COMMENT_HACK* Success *COMMENT_HACK/ * ... * uriFreeUriMembersA(&uri); * @endcode * * While the URI object (::UriUriA) holds information about the recognized - * parts of the given URI string, the parser state object (::UriParserStateA) - * keeps error code and position. This information does not belong to - * the URI itself, which is why there are two separate objects. - * - * You can reuse parser state objects for parsing several URIs like this: - * - * @code - * UriParserStateA state; - * UriUriA uriOne; - * UriUriA uriTwo; - * - * state.uri = &uriOne; - * if (uriParseUriA(&state, "file:///home/user/one") != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&uriOne); - * ... - * } - * ... - * state.uri = &uriTwo; - * if (uriParseUriA(&state, "file:///home/user/two") != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&uriOne); - * uriFreeUriMembersA(&uriTwo); - * ... - * } - * ... - * uriFreeUriMembersA(&uriOne); - * uriFreeUriMembersA(&uriTwo); - * @endcode - * + * parts of the given URI string, in case of URI_ERROR_SYNTAX, + * errorPos points to the first character starting invalid syntax. * * @subsection recomposition Recomposing URIs (from object back to string) * According to RFC 3986 @@ -311,8 +285,8 @@ * uriparser comes with two versions of every structure and function: * one handling Ansi text (char *) and one working with Unicode text (wchar_t *), * for instance - * - uriParseUriA() for Ansi and - * - uriParseUriW() for Unicode. + * - uriParseSingleUriA() for Ansi and + * - uriParseSingleUriW() for Unicode. * * This tutorial only shows the usage of the Ansi editions but * their Unicode counterparts work in the very same way. @@ -322,18 +296,18 @@ * You can use the code below to make ./configure test for presence * of uriparser 0.6.4 or later. * - *
URIPARSER_MISSING="Please install uriparser 0.6.4 or later.
+ *
URIPARSER_MISSING="Please install uriparser 0.9.0 or later.
  *   On a Debian-based system enter 'sudo apt-get install liburiparser-dev'."
- *AC_CHECK_LIB(uriparser, uriParseUriA,, AC_MSG_ERROR(${URIPARSER_MISSING}))
+ *AC_CHECK_LIB(uriparser, uriParseSingleUriA,, AC_MSG_ERROR(${URIPARSER_MISSING}))
  *AC_CHECK_HEADER(uriparser/Uri.h,, AC_MSG_ERROR(${URIPARSER_MISSING}))
  *
- *URIPARSER_TOO_OLD="uriparser 0.6.4 or later is required, your copy is too old."
+ *URIPARSER_TOO_OLD="uriparser 0.9.0 or later is required, your copy is too old."
  *AC_COMPILE_IFELSE([
  *\#include 
  *\#if (defined(URI_VER_MAJOR) && defined(URI_VER_MINOR) && defined(URI_VER_RELEASE) \\
  *&& ((URI_VER_MAJOR > 0) \\
- *|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 6)) \\
- *|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 6) && (URI_VER_RELEASE >= 4)) \\
+ *|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR > 9)) \\
+ *|| ((URI_VER_MAJOR == 0) && (URI_VER_MINOR == 9) && (URI_VER_RELEASE >= 0)) \\
  *))
  */* FINE */
  *\#else
-- 
cgit v1.2.3