From 6d05f3e01a26fa416c9d0150163db20abac4b4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 21 Mar 2018 22:11:05 +0100 Subject: New upstream version 0.8.5 --- doc/Doxyfile.in | 4 +- doc/Mainpage | 343 ------------------------------------------------------ doc/Mainpage.txt | 343 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/Makefile.am | 4 +- doc/Makefile.in | 8 +- doc/release.sh.in | 1 - 6 files changed, 351 insertions(+), 352 deletions(-) delete mode 100644 doc/Mainpage create mode 100644 doc/Mainpage.txt (limited to 'doc') diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 0fe524f..dd0926f 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -2,7 +2,7 @@ # .qhp output GENERATE_QHP = yes -QHP_NAMESPACE = "net.sourceforge.uriparser" +QHP_NAMESPACE = "io.github.uriparser" QHP_VIRTUAL_FOLDER = "uriparser-@VERSION@" # .qch output @@ -280,7 +280,7 @@ WARN_FORMAT = "WARNING: $text ($line, $file)" ############################################################### -INPUT = @ac_abs_confdir@/include @ac_abs_confdir@/doc/Mainpage +INPUT = @ac_abs_confdir@/include @ac_abs_confdir@/doc/Mainpage.txt # The INPUT tag is used to specify the files and/or directories that contain documented source files. You may enter file names like myfile.cpp or directories like /usr/src/myproject. Separate the files or directories with spaces. # # Note: If this tag is empty the current directory is searched. diff --git a/doc/Mainpage b/doc/Mainpage deleted file mode 100644 index 3a80e30..0000000 --- a/doc/Mainpage +++ /dev/null @@ -1,343 +0,0 @@ -/** - * @mainpage - * - * @section SEC_TOC Table of Contents - * - Introduction - * - Algorithms and Examples - * - Parsing URIs (from string to object) - * - Recomposing URIs (from object back to string) - * - Resolving References - * - Creating References - * - Filenames and URIs - * - Normalizing URIs - * - Working with query strings - * - Ansi and Unicode - * - Autoconf Check - * - * - * @section intro Introduction - * Welcome to the short uriparser integration tutorial. - * It is intended to answer upcoming questions and to shed light - * where function prototypes alone are not enough. - * Please drop me a line if you need further assistance and I will - * see what I can do for you. Good luck with uriparser! - * - * - * @subsection parsing Parsing URIs (from string to object) - * Parsing a URI with uriparser looks like this: - * - * @code - * UriParserStateA state; - * UriUriA uri; - * - * state.uri = &uri; - * if (uriParseUriA(&state, "file:///home/user/song.mp3") != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&uri); - * ... - * } - * ... - * uriFreeUriMembersA(&uri); - * @endcode - * - * While the URI object (::UriUriA) holds information about the recogized - * 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 seperate 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 - * - * - * @subsection recomposition Recomposing URIs (from object back to string) - * According to RFC 3986 - * glueing parts of a URI together to form a string is called recomposition. - * Before we can recompose a URI object we have to know how much - * space the resulting string will take: - * - * @code - * UriUriA uri; - * char * uriString; - * int charsRequired; - * ... - * if (uriToStringCharsRequiredA(&uri, &charsRequired) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * charsRequired++; - * @endcode - * - * Now we can tell uriToStringA() to write the string to a given buffer: - * - * @code - * uriString = malloc(charsRequired * sizeof(char)); - * if (uriString == NULL) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * if (uriToStringA(uriString, &uri, charsRequired, NULL) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * @endcode - * - * @remarks - * Incrementing charsRequired by 1 is required since - * uriToStringCharsRequiredA() returns the length of the string - * as strlen() does, but uriToStringA() works with the number - * of maximum characters to be written including the - * zero-terminator. - * - * - * @subsection resolution Resolving References - * Reference Resolution - * is the process of turning a (relative) URI reference into an absolute URI by applying a base - * URI to it. In code it looks like this: - * - * @code - * UriUriA absoluteDest; - * UriUriA relativeSource; - * UriUriA absoluteBase; - * ... - * /COMMENT_HACK* relativeSource holds "../TWO" now *COMMENT_HACK/ - * /COMMENT_HACK* absoluteBase holds "file:///one/two/three" now *COMMENT_HACK/ - * if (uriAddBaseUriA(&absoluteDest, &relativeSource, &absoluteBase) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&absoluteDest); - * ... - * } - * /COMMENT_HACK* absoluteDest holds "file:///one/TWO" now *COMMENT_HACK/ - * ... - * uriFreeUriMembersA(&absoluteDest); - * @endcode - * - * @remarks - * uriAddBaseUriA() does not normalize the resulting URI. - * Usually you might want to pass it through uriNormalizeSyntaxA() after. - * - * - * @subsection shortening Creating References - * Reference Creation is the inverse process of Reference Resolution: A common base URI - * is "substracted" from an absolute URI to make a (relative) reference. - * If the base URI is not common the remaining URI will still be absolute, i.e. will - * carry a scheme - * - * @code - * UriUriA dest; - * UriUriA absoluteSource; - * UriUriA absoluteBase; - * ... - * /COMMENT_HACK* absoluteSource holds "file:///one/TWO" now *COMMENT_HACK/ - * /COMMENT_HACK* absoluteBase holds "file:///one/two/three" now *COMMENT_HACK/ - * if (uriRemoveBaseUriA(&dest, &absoluteSource, &absoluteBase, URI_FALSE) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * uriFreeUriMembersA(&dest); - * ... - * } - * /COMMENT_HACK* dest holds "../TWO" now *COMMENT_HACK/ - * ... - * uriFreeUriMembersA(&dest); - * @endcode - * - * The fourth parameter is the domain root mode. With URI_FALSE as above this will produce - * URIs relative to the base URI. With URI_TRUE the resulting URI will be relative to the - * domain root instead, e.g. "/one/TWO" in this case. - * - * - * @subsection filenames Filenames and URIs - * Converting filenames to and from URIs works on strings directly, - * i.e. without creating an URI object. - * - * @code - * const char * const absFilename = "E:\\Documents and Settings"; - * const int bytesNeeded = 8 + 3 * strlen(absFilename) + 1; - * char * absUri = malloc(bytesNeeded * sizeof(char)); - * if (uriWindowsFilenameToUriStringA(absFilename, absUri) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * free(absUri); - * ... - * } - * /COMMENT_HACK* absUri is "file:///E:/Documents%20and%20Settings" now *COMMENT_HACK/ - * ... - * free(absUri); - * @endcode - * - * Conversion works .. - * - for relative or absolute values, - * - in both directions (filenames <--> URIs) and - * - with Unix and Windows filenames. - * - * All you have to do is to choose the right function for the task and allocate - * the required space (in characters) for the target buffer. - * Let me present you an overview: - * - * - Filename --> URI - * - uriUnixFilenameToUriStringA()\n - * Space required: [7 +] 3 * len(filename) + 1 - * - uriWindowsFilenameToUriStringA()\n - * Space required: [8 +] 3 * len(filename) + 1 - * - URI --> filename - * - uriUriStringToUnixFilenameA()\n - * Space required: len(uriString) + 1 [- 7] - * - uriUriStringToWindowsFilenameA()\n - * Space required: len(uriString) + 1 [- 8] - * - * - * @subsection normalization Normalizing URIs - * Sometimes we come accross unnecessarily long URIs like "http://example.org/one/two/../../one". - * The algorithm we can use to shorten this URI down to "http://example.org/one" is called - * Syntax-Based Normalization. - * Note that normalizing a URI does more than just "stripping dot segments". Please have a look at - * Section 6.2.2 of RFC 3986 - * for the full description. - * - * As we asked uriToStringCharsRequiredA() for the required space when converting - * a URI object back to a sring, we can ask uriNormalizeSyntaxMaskRequiredA() for - * the parts of a URI that require normalization and then pass this normalization - * mask to uriNormalizeSyntaxExA(): - * - * @code - * const unsigned int dirtyParts = uriNormalizeSyntaxMaskRequiredA(&uri); - * if (uriNormalizeSyntaxExA(&uri, dirtyParts) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * @endcode - * - * If you don't want to normalize all parts of the URI you can pass a custom - * mask as well: - * - * @code - * const unsigned int normMask = URI_NORMALIZE_SCHEME | URI_NORMALIZE_USER_INFO; - * if (uriNormalizeSyntaxExA(&uri, normMask) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * @endcode - * - * Please see ::UriNormalizationMaskEnum for the complete set of flags. - * - * On the other hand calling plain uriNormalizeSyntaxA() (without the "Ex") - * saves you thinking about single parts, as it queries uriNormalizeSyntaxMaskRequiredA() - * internally: - * - * @code - * if (uriNormalizeSyntaxA(&uri) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * @endcode - * - * - * @section querystrings Working with query strings - * RFC 3986 - * itself does not understand the query part of a URI as a list of key/value pairs. - * But HTML 2.0 does and defines a media type application/x-www-form-urlencoded - * in in section 8.2.1 - * of RFC 1866. - * uriparser allows you to dissect (or parse) a query string into unescaped key/value pairs - * and back. - * - * To dissect the query part of a just-parsed URI you could write code like this: - * - * @code - * UriUriA uri; - * UriQueryListA * queryList; - * int itemCount; - * ... - * if (uriDissectQueryMallocA(&queryList, &itemCount, uri.query.first, - * uri.query.afterLast) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * ... - * uriFreeQueryListA(queryList); - * @endcode - * - * @remarks - * - NULL in the value member means there was no '=' in the item text as with "?abc&def". - * - An empty string in the value member means there was '=' in the item as with "?abc=&def". - * - * - * To compose a query string from a query list you could write code like this: - * - * @code - * int charsRequired; - * int charsWritten; - * char * queryString; - * ... - * if (uriComposeQueryCharsRequiredA(queryList, &charsRequired) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * queryString = malloc((charsRequired + 1) * sizeof(char)); - * if (queryString == NULL) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * if (uriComposeQueryA(queryString, queryList, charsRequired + 1, &charsWritten) != URI_SUCCESS) { - * /COMMENT_HACK* Failure *COMMENT_HACK/ - * ... - * } - * ... - * free(queryString); - * @endcode - * - * - * @section chartypes Ansi and Unicode - * 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. - * - * This tutorial only shows the usage of the Ansi editions but - * their Unicode counterparts work in the very same way. - * - * - * @section autoconf Autoconf Check - * 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.
- *   On a Debian-based system enter 'sudo apt-get install liburiparser-dev'."
- *AC_CHECK_LIB(uriparser, uriParseUriA,, 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."
- *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)) \\
- *))
- */* FINE */
- *\#else
- *\# error uriparser not recent enough
- *\#endif
- *],,AC_MSG_ERROR(${URIPARSER_TOO_OLD}))
- */ diff --git a/doc/Mainpage.txt b/doc/Mainpage.txt new file mode 100644 index 0000000..3a80e30 --- /dev/null +++ b/doc/Mainpage.txt @@ -0,0 +1,343 @@ +/** + * @mainpage + * + * @section SEC_TOC Table of Contents + * - Introduction + * - Algorithms and Examples + * - Parsing URIs (from string to object) + * - Recomposing URIs (from object back to string) + * - Resolving References + * - Creating References + * - Filenames and URIs + * - Normalizing URIs + * - Working with query strings + * - Ansi and Unicode + * - Autoconf Check + * + * + * @section intro Introduction + * Welcome to the short uriparser integration tutorial. + * It is intended to answer upcoming questions and to shed light + * where function prototypes alone are not enough. + * Please drop me a line if you need further assistance and I will + * see what I can do for you. Good luck with uriparser! + * + * + * @subsection parsing Parsing URIs (from string to object) + * Parsing a URI with uriparser looks like this: + * + * @code + * UriParserStateA state; + * UriUriA uri; + * + * state.uri = &uri; + * if (uriParseUriA(&state, "file:///home/user/song.mp3") != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * uriFreeUriMembersA(&uri); + * ... + * } + * ... + * uriFreeUriMembersA(&uri); + * @endcode + * + * While the URI object (::UriUriA) holds information about the recogized + * 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 seperate 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 + * + * + * @subsection recomposition Recomposing URIs (from object back to string) + * According to RFC 3986 + * glueing parts of a URI together to form a string is called recomposition. + * Before we can recompose a URI object we have to know how much + * space the resulting string will take: + * + * @code + * UriUriA uri; + * char * uriString; + * int charsRequired; + * ... + * if (uriToStringCharsRequiredA(&uri, &charsRequired) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * charsRequired++; + * @endcode + * + * Now we can tell uriToStringA() to write the string to a given buffer: + * + * @code + * uriString = malloc(charsRequired * sizeof(char)); + * if (uriString == NULL) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * if (uriToStringA(uriString, &uri, charsRequired, NULL) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * @endcode + * + * @remarks + * Incrementing charsRequired by 1 is required since + * uriToStringCharsRequiredA() returns the length of the string + * as strlen() does, but uriToStringA() works with the number + * of maximum characters to be written including the + * zero-terminator. + * + * + * @subsection resolution Resolving References + * Reference Resolution + * is the process of turning a (relative) URI reference into an absolute URI by applying a base + * URI to it. In code it looks like this: + * + * @code + * UriUriA absoluteDest; + * UriUriA relativeSource; + * UriUriA absoluteBase; + * ... + * /COMMENT_HACK* relativeSource holds "../TWO" now *COMMENT_HACK/ + * /COMMENT_HACK* absoluteBase holds "file:///one/two/three" now *COMMENT_HACK/ + * if (uriAddBaseUriA(&absoluteDest, &relativeSource, &absoluteBase) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * uriFreeUriMembersA(&absoluteDest); + * ... + * } + * /COMMENT_HACK* absoluteDest holds "file:///one/TWO" now *COMMENT_HACK/ + * ... + * uriFreeUriMembersA(&absoluteDest); + * @endcode + * + * @remarks + * uriAddBaseUriA() does not normalize the resulting URI. + * Usually you might want to pass it through uriNormalizeSyntaxA() after. + * + * + * @subsection shortening Creating References + * Reference Creation is the inverse process of Reference Resolution: A common base URI + * is "substracted" from an absolute URI to make a (relative) reference. + * If the base URI is not common the remaining URI will still be absolute, i.e. will + * carry a scheme + * + * @code + * UriUriA dest; + * UriUriA absoluteSource; + * UriUriA absoluteBase; + * ... + * /COMMENT_HACK* absoluteSource holds "file:///one/TWO" now *COMMENT_HACK/ + * /COMMENT_HACK* absoluteBase holds "file:///one/two/three" now *COMMENT_HACK/ + * if (uriRemoveBaseUriA(&dest, &absoluteSource, &absoluteBase, URI_FALSE) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * uriFreeUriMembersA(&dest); + * ... + * } + * /COMMENT_HACK* dest holds "../TWO" now *COMMENT_HACK/ + * ... + * uriFreeUriMembersA(&dest); + * @endcode + * + * The fourth parameter is the domain root mode. With URI_FALSE as above this will produce + * URIs relative to the base URI. With URI_TRUE the resulting URI will be relative to the + * domain root instead, e.g. "/one/TWO" in this case. + * + * + * @subsection filenames Filenames and URIs + * Converting filenames to and from URIs works on strings directly, + * i.e. without creating an URI object. + * + * @code + * const char * const absFilename = "E:\\Documents and Settings"; + * const int bytesNeeded = 8 + 3 * strlen(absFilename) + 1; + * char * absUri = malloc(bytesNeeded * sizeof(char)); + * if (uriWindowsFilenameToUriStringA(absFilename, absUri) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * free(absUri); + * ... + * } + * /COMMENT_HACK* absUri is "file:///E:/Documents%20and%20Settings" now *COMMENT_HACK/ + * ... + * free(absUri); + * @endcode + * + * Conversion works .. + * - for relative or absolute values, + * - in both directions (filenames <--> URIs) and + * - with Unix and Windows filenames. + * + * All you have to do is to choose the right function for the task and allocate + * the required space (in characters) for the target buffer. + * Let me present you an overview: + * + * - Filename --> URI + * - uriUnixFilenameToUriStringA()\n + * Space required: [7 +] 3 * len(filename) + 1 + * - uriWindowsFilenameToUriStringA()\n + * Space required: [8 +] 3 * len(filename) + 1 + * - URI --> filename + * - uriUriStringToUnixFilenameA()\n + * Space required: len(uriString) + 1 [- 7] + * - uriUriStringToWindowsFilenameA()\n + * Space required: len(uriString) + 1 [- 8] + * + * + * @subsection normalization Normalizing URIs + * Sometimes we come accross unnecessarily long URIs like "http://example.org/one/two/../../one". + * The algorithm we can use to shorten this URI down to "http://example.org/one" is called + * Syntax-Based Normalization. + * Note that normalizing a URI does more than just "stripping dot segments". Please have a look at + * Section 6.2.2 of RFC 3986 + * for the full description. + * + * As we asked uriToStringCharsRequiredA() for the required space when converting + * a URI object back to a sring, we can ask uriNormalizeSyntaxMaskRequiredA() for + * the parts of a URI that require normalization and then pass this normalization + * mask to uriNormalizeSyntaxExA(): + * + * @code + * const unsigned int dirtyParts = uriNormalizeSyntaxMaskRequiredA(&uri); + * if (uriNormalizeSyntaxExA(&uri, dirtyParts) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * @endcode + * + * If you don't want to normalize all parts of the URI you can pass a custom + * mask as well: + * + * @code + * const unsigned int normMask = URI_NORMALIZE_SCHEME | URI_NORMALIZE_USER_INFO; + * if (uriNormalizeSyntaxExA(&uri, normMask) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * @endcode + * + * Please see ::UriNormalizationMaskEnum for the complete set of flags. + * + * On the other hand calling plain uriNormalizeSyntaxA() (without the "Ex") + * saves you thinking about single parts, as it queries uriNormalizeSyntaxMaskRequiredA() + * internally: + * + * @code + * if (uriNormalizeSyntaxA(&uri) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * @endcode + * + * + * @section querystrings Working with query strings + * RFC 3986 + * itself does not understand the query part of a URI as a list of key/value pairs. + * But HTML 2.0 does and defines a media type application/x-www-form-urlencoded + * in in section 8.2.1 + * of RFC 1866. + * uriparser allows you to dissect (or parse) a query string into unescaped key/value pairs + * and back. + * + * To dissect the query part of a just-parsed URI you could write code like this: + * + * @code + * UriUriA uri; + * UriQueryListA * queryList; + * int itemCount; + * ... + * if (uriDissectQueryMallocA(&queryList, &itemCount, uri.query.first, + * uri.query.afterLast) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * ... + * uriFreeQueryListA(queryList); + * @endcode + * + * @remarks + * - NULL in the value member means there was no '=' in the item text as with "?abc&def". + * - An empty string in the value member means there was '=' in the item as with "?abc=&def". + * + * + * To compose a query string from a query list you could write code like this: + * + * @code + * int charsRequired; + * int charsWritten; + * char * queryString; + * ... + * if (uriComposeQueryCharsRequiredA(queryList, &charsRequired) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * queryString = malloc((charsRequired + 1) * sizeof(char)); + * if (queryString == NULL) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * if (uriComposeQueryA(queryString, queryList, charsRequired + 1, &charsWritten) != URI_SUCCESS) { + * /COMMENT_HACK* Failure *COMMENT_HACK/ + * ... + * } + * ... + * free(queryString); + * @endcode + * + * + * @section chartypes Ansi and Unicode + * 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. + * + * This tutorial only shows the usage of the Ansi editions but + * their Unicode counterparts work in the very same way. + * + * + * @section autoconf Autoconf Check + * 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.
+ *   On a Debian-based system enter 'sudo apt-get install liburiparser-dev'."
+ *AC_CHECK_LIB(uriparser, uriParseUriA,, 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."
+ *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)) \\
+ *))
+ */* FINE */
+ *\#else
+ *\# error uriparser not recent enough
+ *\#endif
+ *],,AC_MSG_ERROR(${URIPARSER_TOO_OLD}))
+ */ diff --git a/doc/Makefile.am b/doc/Makefile.am index fb9e035..012f0bc 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -4,7 +4,7 @@ all-local: html/index.html html/index.html: $(srcdir)/../include/uriparser/*.h \ $(srcdir)/../src/*.c \ $(srcdir)/../src/*.h \ - $(srcdir)/Mainpage + $(srcdir)/Mainpage.txt rm -Rf "$(builddir)/html" doxygen Doxyfile touch html/index.html @@ -24,7 +24,7 @@ distclean-local: ## Install doc files install-data-local: $(MKDIR_P) "$(DESTDIR)$(docdir)/html/search" ## Didn't work with installdirs-local - $(INSTALL_DATA) html/*.css html/*.html html/*.js html/*.map html/*.md5 html/*.png "$(DESTDIR)$(docdir)/html/" + $(INSTALL_DATA) html/*.css html/*.html html/*.js html/*.md5 html/*.png "$(DESTDIR)$(docdir)/html/" $(INSTALL_DATA) html/search/* "$(DESTDIR)$(docdir)/html/search/" -$(INSTALL_DATA) *.qch "$(DESTDIR)$(docdir)/" diff --git a/doc/Makefile.in b/doc/Makefile.in index d6c8bd7..b8bbff5 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. +# Makefile.in generated by automake 1.15.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2014 Free Software Foundation, Inc. +# Copyright (C) 1994-2017 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -454,7 +454,7 @@ all-local: html/index.html html/index.html: $(srcdir)/../include/uriparser/*.h \ $(srcdir)/../src/*.c \ $(srcdir)/../src/*.h \ - $(srcdir)/Mainpage + $(srcdir)/Mainpage.txt rm -Rf "$(builddir)/html" doxygen Doxyfile touch html/index.html @@ -468,7 +468,7 @@ distclean-local: install-data-local: $(MKDIR_P) "$(DESTDIR)$(docdir)/html/search" ## Didn't work with installdirs-local - $(INSTALL_DATA) html/*.css html/*.html html/*.js html/*.map html/*.md5 html/*.png "$(DESTDIR)$(docdir)/html/" + $(INSTALL_DATA) html/*.css html/*.html html/*.js html/*.md5 html/*.png "$(DESTDIR)$(docdir)/html/" $(INSTALL_DATA) html/search/* "$(DESTDIR)$(docdir)/html/search/" -$(INSTALL_DATA) *.qch "$(DESTDIR)$(docdir)/" diff --git a/doc/release.sh.in b/doc/release.sh.in index d970773..70a52b4 100755 --- a/doc/release.sh.in +++ b/doc/release.sh.in @@ -17,7 +17,6 @@ cp \ html/*.css \ html/*.html \ html/*.js \ - html/*.map \ html/*.md5 \ html/*.png \ \ -- cgit v1.2.3