"Fossies" - the Fresh Open Source Software Archive

Member "uriparser-0.9.5/include/uriparser/Uri.h" (18 Mar 2021, 38245 Bytes) of package /linux/www/uriparser-0.9.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Uri.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 0.9.4_vs_0.9.5.

    1 /* 6db8b5726a796167bb96b3d83ff9ac6792a01474dbe3778deb3c2a25d60b3693 (0.9.5+)
    2  *
    3  * uriparser - RFC 3986 URI parsing library
    4  *
    5  * Copyright (C) 2007, Weijia Song <songweijia@gmail.com>
    6  * Copyright (C) 2007, Sebastian Pipping <sebastian@pipping.org>
    7  * All rights reserved.
    8  *
    9  * Redistribution and use in source  and binary forms, with or without
   10  * modification, are permitted provided  that the following conditions
   11  * are met:
   12  *
   13  *     1. Redistributions  of  source  code   must  retain  the  above
   14  *        copyright notice, this list  of conditions and the following
   15  *        disclaimer.
   16  *
   17  *     2. Redistributions  in binary  form  must  reproduce the  above
   18  *        copyright notice, this list  of conditions and the following
   19  *        disclaimer  in  the  documentation  and/or  other  materials
   20  *        provided with the distribution.
   21  *
   22  *     3. Neither the  name of the  copyright holder nor the  names of
   23  *        its contributors may be used  to endorse or promote products
   24  *        derived from  this software  without specific  prior written
   25  *        permission.
   26  *
   27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   28  * "AS IS" AND  ANY EXPRESS OR IMPLIED WARRANTIES,  INCLUDING, BUT NOT
   29  * LIMITED TO,  THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS
   30  * FOR  A  PARTICULAR  PURPOSE  ARE  DISCLAIMED.  IN  NO  EVENT  SHALL
   31  * THE  COPYRIGHT HOLDER  OR CONTRIBUTORS  BE LIABLE  FOR ANY  DIRECT,
   32  * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   33  * (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE GOODS OR
   34  * SERVICES; LOSS OF USE, DATA,  OR PROFITS; OR BUSINESS INTERRUPTION)
   35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   36  * STRICT  LIABILITY,  OR  TORT (INCLUDING  NEGLIGENCE  OR  OTHERWISE)
   37  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   38  * OF THE POSSIBILITY OF SUCH DAMAGE.
   39  */
   40 
   41 /**
   42  * @file Uri.h
   43  * Holds the RFC 3986 %URI parser interface.
   44  * NOTE: This header includes itself twice.
   45  */
   46 
   47 #if (defined(URI_PASS_ANSI) && !defined(URI_H_ANSI)) \
   48     || (defined(URI_PASS_UNICODE) && !defined(URI_H_UNICODE)) \
   49     || (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
   50 /* What encodings are enabled? */
   51 #include "UriDefsConfig.h"
   52 #if (!defined(URI_PASS_ANSI) && !defined(URI_PASS_UNICODE))
   53 /* Include SELF twice */
   54 # ifdef URI_ENABLE_ANSI
   55 #  define URI_PASS_ANSI 1
   56 #  include "Uri.h"
   57 #  undef URI_PASS_ANSI
   58 # endif
   59 # ifdef URI_ENABLE_UNICODE
   60 #  define URI_PASS_UNICODE 1
   61 #  include "Uri.h"
   62 #  undef URI_PASS_UNICODE
   63 # endif
   64 /* Only one pass for each encoding */
   65 #elif (defined(URI_PASS_ANSI) && !defined(URI_H_ANSI) \
   66     && defined(URI_ENABLE_ANSI)) || (defined(URI_PASS_UNICODE) \
   67     && !defined(URI_H_UNICODE) && defined(URI_ENABLE_UNICODE))
   68 # ifdef URI_PASS_ANSI
   69 #  define URI_H_ANSI 1
   70 #  include "UriDefsAnsi.h"
   71 # else
   72 #  define URI_H_UNICODE 1
   73 #  include "UriDefsUnicode.h"
   74 # endif
   75 
   76 
   77 
   78 #ifdef __cplusplus
   79 extern "C" {
   80 #endif
   81 
   82 
   83 
   84 #ifndef URI_DOXYGEN
   85 # include "UriBase.h"
   86 #endif
   87 
   88 
   89 
   90 /**
   91  * Specifies a range of characters within a string.
   92  * The range includes all characters from <c>first</c>
   93  * to one before <c>afterLast</c>. So if both are
   94  * non-NULL the difference is the length of the text range.
   95  *
   96  * @see UriUriA
   97  * @see UriPathSegmentA
   98  * @see UriHostDataA
   99  * @since 0.3.0
  100  */
  101 typedef struct URI_TYPE(TextRangeStruct) {
  102     const URI_CHAR * first; /**< Pointer to first character */
  103     const URI_CHAR * afterLast; /**< Pointer to character after the last one still in */
  104 } URI_TYPE(TextRange); /**< @copydoc UriTextRangeStructA */
  105 
  106 
  107 
  108 /**
  109  * Represents a path segment within a %URI path.
  110  * More precisely it is a node in a linked
  111  * list of path segments.
  112  *
  113  * @see UriUriA
  114  * @since 0.3.0
  115  */
  116 typedef struct URI_TYPE(PathSegmentStruct) {
  117     URI_TYPE(TextRange) text; /**< Path segment name */
  118     struct URI_TYPE(PathSegmentStruct) * next; /**< Pointer to the next path segment in the list, can be NULL if last already */
  119 
  120     void * reserved; /**< Reserved to the parser */
  121 } URI_TYPE(PathSegment); /**< @copydoc UriPathSegmentStructA */
  122 
  123 
  124 
  125 /**
  126  * Holds structured host information.
  127  * This is either a IPv4, IPv6, plain
  128  * text for IPvFuture or all zero for
  129  * a registered name.
  130  *
  131  * @see UriUriA
  132  * @since 0.3.0
  133  */
  134 typedef struct URI_TYPE(HostDataStruct) {
  135     UriIp4 * ip4; /**< IPv4 address */
  136     UriIp6 * ip6; /**< IPv6 address */
  137     URI_TYPE(TextRange) ipFuture; /**< IPvFuture address */
  138 } URI_TYPE(HostData); /**< @copydoc UriHostDataStructA */
  139 
  140 
  141 
  142 /**
  143  * Represents an RFC 3986 %URI.
  144  * Missing components can be {NULL, NULL} ranges.
  145  *
  146  * @see uriFreeUriMembersA
  147  * @see uriFreeUriMembersMmA
  148  * @see UriParserStateA
  149  * @since 0.3.0
  150  */
  151 typedef struct URI_TYPE(UriStruct) {
  152     URI_TYPE(TextRange) scheme; /**< Scheme (e.g. "http") */
  153     URI_TYPE(TextRange) userInfo; /**< User info (e.g. "user:pass") */
  154     URI_TYPE(TextRange) hostText; /**< Host text (set for all hosts, excluding square brackets) */
  155     URI_TYPE(HostData) hostData; /**< Structured host type specific data */
  156     URI_TYPE(TextRange) portText; /**< Port (e.g. "80") */
  157     URI_TYPE(PathSegment) * pathHead; /**< Head of a linked list of path segments */
  158     URI_TYPE(PathSegment) * pathTail; /**< Tail of the list behind pathHead */
  159     URI_TYPE(TextRange) query; /**< Query without leading "?" */
  160     URI_TYPE(TextRange) fragment; /**< Query without leading "#" */
  161     UriBool absolutePath; /**< Absolute path flag, distincting "a" and "/a";
  162                                 always <c>URI_FALSE</c> for URIs with host */
  163     UriBool owner; /**< Memory owner flag */
  164 
  165     void * reserved; /**< Reserved to the parser */
  166 } URI_TYPE(Uri); /**< @copydoc UriUriStructA */
  167 
  168 
  169 
  170 /**
  171  * Represents a state of the %URI parser.
  172  * Missing components can be NULL to reflect
  173  * a components absence.
  174  *
  175  * @see uriFreeUriMembersA
  176  * @see uriFreeUriMembersMmA
  177  * @since 0.3.0
  178  */
  179 typedef struct URI_TYPE(ParserStateStruct) {
  180     URI_TYPE(Uri) * uri; /**< Plug in the %URI structure to be filled while parsing here */
  181     int errorCode; /**< Code identifying the error which occurred */
  182     const URI_CHAR * errorPos; /**< Pointer to position in case of a syntax error */
  183 
  184     void * reserved; /**< Reserved to the parser */
  185 } URI_TYPE(ParserState); /**< @copydoc UriParserStateStructA */
  186 
  187 
  188 
  189 /**
  190  * Represents a query element.
  191  * More precisely it is a node in a linked
  192  * list of query elements.
  193  *
  194  * @since 0.7.0
  195  */
  196 typedef struct URI_TYPE(QueryListStruct) {
  197     const URI_CHAR * key; /**< Key of the query element */
  198     const URI_CHAR * value; /**< Value of the query element, can be NULL */
  199 
  200     struct URI_TYPE(QueryListStruct) * next; /**< Pointer to the next key/value pair in the list, can be NULL if last already */
  201 } URI_TYPE(QueryList); /**< @copydoc UriQueryListStructA */
  202 
  203 
  204 
  205 /**
  206  * Parses a RFC 3986 %URI.
  207  * Uses default libc-based memory manager.
  208  *
  209  * @param state       <b>INOUT</b>: Parser state with set output %URI, must not be NULL
  210  * @param first       <b>IN</b>: Pointer to the first character to parse, must not be NULL
  211  * @param afterLast   <b>IN</b>: Pointer to the character after the last to parse, must not be NULL
  212  * @return            0 on success, error code otherwise
  213  *
  214  * @see uriParseUriA
  215  * @see uriParseSingleUriA
  216  * @see uriParseSingleUriExA
  217  * @see uriToStringA
  218  * @since 0.3.0
  219  * @deprecated Deprecated since 0.9.0, please migrate to uriParseSingleUriExA (with "Single").
  220  */
  221 URI_PUBLIC int URI_FUNC(ParseUriEx)(URI_TYPE(ParserState) * state,
  222         const URI_CHAR * first, const URI_CHAR * afterLast);
  223 
  224 
  225 
  226 /**
  227  * Parses a RFC 3986 %URI.
  228  * Uses default libc-based memory manager.
  229  *
  230  * @param state   <b>INOUT</b>: Parser state with set output %URI, must not be NULL
  231  * @param text    <b>IN</b>: Text to parse, must not be NULL
  232  * @return        0 on success, error code otherwise
  233  *
  234  * @see uriParseUriExA
  235  * @see uriParseSingleUriA
  236  * @see uriParseSingleUriExA
  237  * @see uriToStringA
  238  * @since 0.3.0
  239  * @deprecated Deprecated since 0.9.0, please migrate to uriParseSingleUriA (with "Single").
  240  */
  241 URI_PUBLIC int URI_FUNC(ParseUri)(URI_TYPE(ParserState) * state,
  242         const URI_CHAR * text);
  243 
  244 
  245 
  246 /**
  247  * Parses a single RFC 3986 %URI.
  248  * Uses default libc-based memory manager.
  249  *
  250  * @param uri         <b>OUT</b>: Output %URI, must not be NULL
  251  * @param text        <b>IN</b>: Pointer to the first character to parse,
  252  *                               must not be NULL
  253  * @param errorPos    <b>OUT</b>: Pointer to a pointer to the first character
  254  *                                causing a syntax error, can be NULL;
  255  *                                only set when URI_ERROR_SYNTAX was returned
  256  * @return            0 on success, error code otherwise
  257  *
  258  * @see uriParseSingleUriExA
  259  * @see uriParseSingleUriExMmA
  260  * @see uriToStringA
  261  * @since 0.9.0
  262  */
  263 URI_PUBLIC int URI_FUNC(ParseSingleUri)(URI_TYPE(Uri) * uri,
  264         const URI_CHAR * text, const URI_CHAR ** errorPos);
  265 
  266 
  267 
  268 /**
  269  * Parses a single RFC 3986 %URI.
  270  * Uses default libc-based memory manager.
  271  *
  272  * @param uri         <b>OUT</b>: Output %URI, must not be NULL
  273  * @param first       <b>IN</b>: Pointer to the first character to parse,
  274  *                               must not be NULL
  275  * @param afterLast   <b>IN</b>: Pointer to the character after the last to
  276  *                               parse, can be NULL
  277  *                               (to use first + strlen(first))
  278  * @param errorPos    <b>OUT</b>: Pointer to a pointer to the first character
  279  *                                causing a syntax error, can be NULL;
  280  *                                only set when URI_ERROR_SYNTAX was returned
  281  * @return            0 on success, error code otherwise
  282  *
  283  * @see uriParseSingleUriA
  284  * @see uriParseSingleUriExMmA
  285  * @see uriToStringA
  286  * @since 0.9.0
  287  */
  288 URI_PUBLIC int URI_FUNC(ParseSingleUriEx)(URI_TYPE(Uri) * uri,
  289         const URI_CHAR * first, const URI_CHAR * afterLast,
  290         const URI_CHAR ** errorPos);
  291 
  292 
  293 
  294 /**
  295  * Parses a single RFC 3986 %URI.
  296  *
  297  * @param uri         <b>OUT</b>: Output %URI, must not be NULL
  298  * @param first       <b>IN</b>: Pointer to the first character to parse,
  299  *                               must not be NULL
  300  * @param afterLast   <b>IN</b>: Pointer to the character after the last to
  301  *                               parse, can be NULL
  302  *                               (to use first + strlen(first))
  303  * @param errorPos    <b>OUT</b>: Pointer to a pointer to the first character
  304  *                                causing a syntax error, can be NULL;
  305  *                                only set when URI_ERROR_SYNTAX was returned
  306  * @param memory      <b>IN</b>: Memory manager to use, NULL for default libc
  307  * @return            0 on success, error code otherwise
  308  *
  309  * @see uriParseSingleUriA
  310  * @see uriParseSingleUriExA
  311  * @see uriToStringA
  312  * @since 0.9.0
  313  */
  314 URI_PUBLIC int URI_FUNC(ParseSingleUriExMm)(URI_TYPE(Uri) * uri,
  315         const URI_CHAR * first, const URI_CHAR * afterLast,
  316         const URI_CHAR ** errorPos, UriMemoryManager * memory);
  317 
  318 
  319 
  320 /**
  321  * Frees all memory associated with the members
  322  * of the %URI structure. Note that the structure
  323  * itself is not freed, only its members.
  324  * Uses default libc-based memory manager.
  325  *
  326  * @param uri   <b>INOUT</b>: %URI structure whose members should be freed
  327  *
  328  * @see uriFreeUriMembersMmA
  329  * @since 0.3.0
  330  */
  331 URI_PUBLIC void URI_FUNC(FreeUriMembers)(URI_TYPE(Uri) * uri);
  332 
  333 
  334 
  335 /**
  336  * Frees all memory associated with the members
  337  * of the %URI structure. Note that the structure
  338  * itself is not freed, only its members.
  339  *
  340  * @param uri     <b>INOUT</b>: %URI structure whose members should be freed
  341  * @param memory  <b>IN</b>: Memory manager to use, NULL for default libc
  342  * @return        0 on success, error code otherwise
  343  *
  344  * @see uriFreeUriMembersA
  345  * @since 0.9.0
  346  */
  347 URI_PUBLIC int URI_FUNC(FreeUriMembersMm)(URI_TYPE(Uri) * uri,
  348         UriMemoryManager * memory);
  349 
  350 
  351 
  352 /**
  353  * Percent-encodes all unreserved characters from the input string and
  354  * writes the encoded version to the output string.
  355  * Be sure to allocate <b>3 times</b> the space of the input buffer for
  356  * the output buffer for <c>normalizeBreaks == URI_FALSE</c> and <b>6 times</b>
  357  * the space for <c>normalizeBreaks == URI_TRUE</c>
  358  * (since e.g. "\x0d" becomes "%0D%0A" in that case)
  359  *
  360  * @param inFirst           <b>IN</b>: Pointer to first character of the input text
  361  * @param inAfterLast       <b>IN</b>: Pointer after the last character of the input text
  362  * @param out               <b>OUT</b>: Encoded text destination
  363  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  364  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  365  * @return                  Position of terminator in output string
  366  *
  367  * @see uriEscapeA
  368  * @see uriUnescapeInPlaceExA
  369  * @since 0.5.2
  370  */
  371 URI_PUBLIC URI_CHAR * URI_FUNC(EscapeEx)(const URI_CHAR * inFirst,
  372         const URI_CHAR * inAfterLast, URI_CHAR * out,
  373         UriBool spaceToPlus, UriBool normalizeBreaks);
  374 
  375 
  376 
  377 /**
  378  * Percent-encodes all unreserved characters from the input string and
  379  * writes the encoded version to the output string.
  380  * Be sure to allocate <b>3 times</b> the space of the input buffer for
  381  * the output buffer for <c>normalizeBreaks == URI_FALSE</c> and <b>6 times</b>
  382  * the space for <c>normalizeBreaks == URI_TRUE</c>
  383  * (since e.g. "\x0d" becomes "%0D%0A" in that case)
  384  *
  385  * @param in                <b>IN</b>: Text source
  386  * @param out               <b>OUT</b>: Encoded text destination
  387  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  388  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  389  * @return                  Position of terminator in output string
  390  *
  391  * @see uriEscapeExA
  392  * @see uriUnescapeInPlaceA
  393  * @since 0.5.0
  394  */
  395 URI_PUBLIC URI_CHAR * URI_FUNC(Escape)(const URI_CHAR * in, URI_CHAR * out,
  396         UriBool spaceToPlus, UriBool normalizeBreaks);
  397 
  398 
  399 
  400 /**
  401  * Unescapes percent-encoded groups in a given string.
  402  * E.g. "%20" will become " ". Unescaping is done in place.
  403  * The return value will be point to the new position
  404  * of the terminating zero. Use this value to get the new
  405  * length of the string. NULL is only returned if <c>inout</c>
  406  * is NULL.
  407  *
  408  * @param inout             <b>INOUT</b>: Text to unescape/decode
  409  * @param plusToSpace       <b>IN</b>: Whether to convert '+' to ' ' or not
  410  * @param breakConversion   <b>IN</b>: Line break conversion mode
  411  * @return                  Pointer to new position of the terminating zero
  412  *
  413  * @see uriUnescapeInPlaceA
  414  * @see uriEscapeExA
  415  * @since 0.5.0
  416  */
  417 URI_PUBLIC const URI_CHAR * URI_FUNC(UnescapeInPlaceEx)(URI_CHAR * inout,
  418         UriBool plusToSpace, UriBreakConversion breakConversion);
  419 
  420 
  421 
  422 /**
  423  * Unescapes percent-encoded groups in a given string.
  424  * E.g. "%20" will become " ". Unescaping is done in place.
  425  * The return value will be point to the new position
  426  * of the terminating zero. Use this value to get the new
  427  * length of the string. NULL is only returned if <c>inout</c>
  428  * is NULL.
  429  *
  430  * NOTE: '+' is not decoded to ' ' and line breaks are not converted.
  431  * Use the more advanced UnescapeInPlaceEx for that features instead.
  432  *
  433  * @param inout   <b>INOUT</b>: Text to unescape/decode
  434  * @return        Pointer to new position of the terminating zero
  435  *
  436  * @see uriUnescapeInPlaceExA
  437  * @see uriEscapeA
  438  * @since 0.3.0
  439  */
  440 URI_PUBLIC const URI_CHAR * URI_FUNC(UnescapeInPlace)(URI_CHAR * inout);
  441 
  442 
  443 
  444 /**
  445  * Performs reference resolution as described in
  446  * <a href="http://tools.ietf.org/html/rfc3986#section-5.2.2">section 5.2.2 of RFC 3986</a>.
  447  * Uses default libc-based memory manager.
  448  * NOTE: On success you have to call uriFreeUriMembersA on \p absoluteDest manually later.
  449  *
  450  * @param absoluteDest     <b>OUT</b>: Result %URI
  451  * @param relativeSource   <b>IN</b>: Reference to resolve
  452  * @param absoluteBase     <b>IN</b>: Base %URI to apply
  453  * @return                 Error code or 0 on success
  454  *
  455  * @see uriRemoveBaseUriA
  456  * @see uriRemoveBaseUriMmA
  457  * @see uriAddBaseUriExA
  458  * @see uriAddBaseUriExMmA
  459  * @since 0.4.0
  460  */
  461 URI_PUBLIC int URI_FUNC(AddBaseUri)(URI_TYPE(Uri) * absoluteDest,
  462         const URI_TYPE(Uri) * relativeSource,
  463         const URI_TYPE(Uri) * absoluteBase);
  464 
  465 
  466 
  467 /**
  468  * Performs reference resolution as described in
  469  * <a href="http://tools.ietf.org/html/rfc3986#section-5.2.2">section 5.2.2 of RFC 3986</a>.
  470  * Uses default libc-based memory manager.
  471  * NOTE: On success you have to call uriFreeUriMembersA on \p absoluteDest manually later.
  472  *
  473  * @param absoluteDest     <b>OUT</b>: Result %URI
  474  * @param relativeSource   <b>IN</b>: Reference to resolve
  475  * @param absoluteBase     <b>IN</b>: Base %URI to apply
  476  * @param options          <b>IN</b>: Configuration to apply
  477  * @return                 Error code or 0 on success
  478  *
  479  * @see uriRemoveBaseUriA
  480  * @see uriAddBaseUriA
  481  * @see uriAddBaseUriExMmA
  482  * @since 0.8.1
  483  */
  484 URI_PUBLIC int URI_FUNC(AddBaseUriEx)(URI_TYPE(Uri) * absoluteDest,
  485         const URI_TYPE(Uri) * relativeSource,
  486         const URI_TYPE(Uri) * absoluteBase,
  487         UriResolutionOptions options);
  488 
  489 
  490 
  491 /**
  492  * Performs reference resolution as described in
  493  * <a href="http://tools.ietf.org/html/rfc3986#section-5.2.2">section 5.2.2 of RFC 3986</a>.
  494  * NOTE: On success you have to call uriFreeUriMembersMmA on \p absoluteDest manually later.
  495  *
  496  * @param absoluteDest     <b>OUT</b>: Result %URI
  497  * @param relativeSource   <b>IN</b>: Reference to resolve
  498  * @param absoluteBase     <b>IN</b>: Base %URI to apply
  499  * @param options          <b>IN</b>: Configuration to apply
  500  * @param memory           <b>IN</b>: Memory manager to use, NULL for default libc
  501  * @return                 Error code or 0 on success
  502  *
  503  * @see uriRemoveBaseUriA
  504  * @see uriRemoveBaseUriMmA
  505  * @see uriAddBaseUriA
  506  * @see uriAddBaseUriExA
  507  * @since 0.9.0
  508  */
  509 URI_PUBLIC int URI_FUNC(AddBaseUriExMm)(URI_TYPE(Uri) * absoluteDest,
  510         const URI_TYPE(Uri) * relativeSource,
  511         const URI_TYPE(Uri) * absoluteBase,
  512         UriResolutionOptions options, UriMemoryManager * memory);
  513 
  514 
  515 
  516 /**
  517  * Tries to make a relative %URI (a reference) from an
  518  * absolute %URI and a given base %URI. The resulting %URI is going to be
  519  * relative if the absolute %URI and base %UI share both scheme and authority.
  520  * If that is not the case, the result will still be
  521  * an absolute URI (with scheme part if necessary).
  522  * Uses default libc-based memory manager.
  523  * NOTE: On success you have to call uriFreeUriMembersA on
  524  * \p dest manually later.
  525  *
  526  * @param dest             <b>OUT</b>: Result %URI
  527  * @param absoluteSource   <b>IN</b>: Absolute %URI to make relative
  528  * @param absoluteBase     <b>IN</b>: Base %URI
  529  * @param domainRootMode   <b>IN</b>: Create %URI with path relative to domain root
  530  * @return                 Error code or 0 on success
  531  *
  532  * @see uriRemoveBaseUriMmA
  533  * @see uriAddBaseUriA
  534  * @see uriAddBaseUriExA
  535  * @see uriAddBaseUriExMmA
  536  * @since 0.5.2
  537  */
  538 URI_PUBLIC int URI_FUNC(RemoveBaseUri)(URI_TYPE(Uri) * dest,
  539         const URI_TYPE(Uri) * absoluteSource,
  540         const URI_TYPE(Uri) * absoluteBase,
  541         UriBool domainRootMode);
  542 
  543 
  544 
  545 /**
  546  * Tries to make a relative %URI (a reference) from an
  547  * absolute %URI and a given base %URI. The resulting %URI is going to be
  548  * relative if the absolute %URI and base %UI share both scheme and authority.
  549  * If that is not the case, the result will still be
  550  * an absolute URI (with scheme part if necessary).
  551  * NOTE: On success you have to call uriFreeUriMembersMmA on
  552  * \p dest manually later.
  553  *
  554  * @param dest             <b>OUT</b>: Result %URI
  555  * @param absoluteSource   <b>IN</b>: Absolute %URI to make relative
  556  * @param absoluteBase     <b>IN</b>: Base %URI
  557  * @param domainRootMode   <b>IN</b>: Create %URI with path relative to domain root
  558  * @param memory           <b>IN</b>: Memory manager to use, NULL for default libc
  559  * @return                 Error code or 0 on success
  560  *
  561  * @see uriRemoveBaseUriA
  562  * @see uriAddBaseUriA
  563  * @see uriAddBaseUriExA
  564  * @see uriAddBaseUriExMmA
  565  * @since 0.9.0
  566  */
  567 URI_PUBLIC int URI_FUNC(RemoveBaseUriMm)(URI_TYPE(Uri) * dest,
  568         const URI_TYPE(Uri) * absoluteSource,
  569         const URI_TYPE(Uri) * absoluteBase,
  570         UriBool domainRootMode, UriMemoryManager * memory);
  571 
  572 
  573 
  574 /**
  575  * Checks two URIs for equivalence. Comparison is done
  576  * the naive way, without prior normalization.
  577  * NOTE: Two <c>NULL</c> URIs are equal as well.
  578  *
  579  * @param a   <b>IN</b>: First %URI
  580  * @param b   <b>IN</b>: Second %URI
  581  * @return    <c>URI_TRUE</c> when equal, <c>URI_FAlSE</c> else
  582  *
  583  * @since 0.4.0
  584  */
  585 URI_PUBLIC UriBool URI_FUNC(EqualsUri)(const URI_TYPE(Uri) * a,
  586         const URI_TYPE(Uri) * b);
  587 
  588 
  589 
  590 /**
  591  * Calculates the number of characters needed to store the
  592  * string representation of the given %URI excluding the
  593  * terminator.
  594  *
  595  * @param uri             <b>IN</b>: %URI to measure
  596  * @param charsRequired   <b>OUT</b>: Length of the string representation in characters <b>excluding</b> terminator
  597  * @return                Error code or 0 on success
  598  *
  599  * @see uriToStringA
  600  * @since 0.5.0
  601  */
  602 URI_PUBLIC int URI_FUNC(ToStringCharsRequired)(const URI_TYPE(Uri) * uri,
  603         int * charsRequired);
  604 
  605 
  606 
  607 /**
  608  * Converts a %URI structure back to text as described in
  609  * <a href="http://tools.ietf.org/html/rfc3986#section-5.3">section 5.3 of RFC 3986</a>.
  610  *
  611  * @param dest           <b>OUT</b>: Output destination
  612  * @param uri            <b>IN</b>: %URI to convert
  613  * @param maxChars       <b>IN</b>: Maximum number of characters to copy <b>including</b> terminator
  614  * @param charsWritten   <b>OUT</b>: Number of characters written, can be lower than maxChars even if the %URI is too long!
  615  * @return               Error code or 0 on success
  616  *
  617  * @see uriToStringCharsRequiredA
  618  * @since 0.4.0
  619  */
  620 URI_PUBLIC int URI_FUNC(ToString)(URI_CHAR * dest, const URI_TYPE(Uri) * uri,
  621         int maxChars, int * charsWritten);
  622 
  623 
  624 
  625 /**
  626  * Determines the components of a %URI that are not normalized.
  627  *
  628  * @param uri   <b>IN</b>: %URI to check
  629  * @return      Normalization job mask
  630  *
  631  * @see uriNormalizeSyntaxA
  632  * @see uriNormalizeSyntaxExA
  633  * @see uriNormalizeSyntaxExMmA
  634  * @see uriNormalizeSyntaxMaskRequiredExA
  635  * @since 0.5.0
  636  * @deprecated Deprecated since 0.9.0, please migrate to uriNormalizeSyntaxMaskRequiredExA (with "Ex").
  637  */
  638 URI_PUBLIC unsigned int URI_FUNC(NormalizeSyntaxMaskRequired)(
  639         const URI_TYPE(Uri) * uri);
  640 
  641 
  642 
  643 /**
  644  * Determines the components of a %URI that are not normalized.
  645  *
  646  * @param uri      <b>IN</b>: %URI to check
  647  * @param outMask  <b>OUT</b>: Normalization job mask
  648  * @return         Error code or 0 on success
  649  *
  650  * @see uriNormalizeSyntaxA
  651  * @see uriNormalizeSyntaxExA
  652  * @see uriNormalizeSyntaxExMmA
  653  * @see uriNormalizeSyntaxMaskRequiredA
  654  * @since 0.9.0
  655  */
  656 URI_PUBLIC int URI_FUNC(NormalizeSyntaxMaskRequiredEx)(
  657         const URI_TYPE(Uri) * uri, unsigned int * outMask);
  658 
  659 
  660 
  661 /**
  662  * Normalizes a %URI using a normalization mask.
  663  * The normalization mask decides what components are normalized.
  664  *
  665  * NOTE: If necessary the %URI becomes owner of all memory
  666  * behind the text pointed to. Text is duplicated in that case.
  667  * Uses default libc-based memory manager.
  668  *
  669  * @param uri    <b>INOUT</b>: %URI to normalize
  670  * @param mask   <b>IN</b>: Normalization mask
  671  * @return       Error code or 0 on success
  672  *
  673  * @see uriNormalizeSyntaxA
  674  * @see uriNormalizeSyntaxExMmA
  675  * @see uriNormalizeSyntaxMaskRequiredA
  676  * @since 0.5.0
  677  */
  678 URI_PUBLIC int URI_FUNC(NormalizeSyntaxEx)(URI_TYPE(Uri) * uri,
  679         unsigned int mask);
  680 
  681 
  682 
  683 /**
  684  * Normalizes a %URI using a normalization mask.
  685  * The normalization mask decides what components are normalized.
  686  *
  687  * NOTE: If necessary the %URI becomes owner of all memory
  688  * behind the text pointed to. Text is duplicated in that case.
  689  *
  690  * @param uri    <b>INOUT</b>: %URI to normalize
  691  * @param mask   <b>IN</b>: Normalization mask
  692  * @param memory <b>IN</b>: Memory manager to use, NULL for default libc
  693  * @return       Error code or 0 on success
  694  *
  695  * @see uriNormalizeSyntaxA
  696  * @see uriNormalizeSyntaxExA
  697  * @see uriNormalizeSyntaxMaskRequiredA
  698  * @since 0.9.0
  699  */
  700 URI_PUBLIC int URI_FUNC(NormalizeSyntaxExMm)(URI_TYPE(Uri) * uri,
  701         unsigned int mask, UriMemoryManager * memory);
  702 
  703 
  704 
  705 /**
  706  * Normalizes all components of a %URI.
  707  *
  708  * NOTE: If necessary the %URI becomes owner of all memory
  709  * behind the text pointed to. Text is duplicated in that case.
  710  * Uses default libc-based memory manager.
  711  *
  712  * @param uri   <b>INOUT</b>: %URI to normalize
  713  * @return      Error code or 0 on success
  714  *
  715  * @see uriNormalizeSyntaxExA
  716  * @see uriNormalizeSyntaxExMmA
  717  * @see uriNormalizeSyntaxMaskRequiredA
  718  * @since 0.5.0
  719  */
  720 URI_PUBLIC int URI_FUNC(NormalizeSyntax)(URI_TYPE(Uri) * uri);
  721 
  722 
  723 
  724 /**
  725  * Converts a Unix filename to a %URI string.
  726  * The destination buffer must be large enough to hold 7 + 3 * len(filename) + 1
  727  * characters in case of an absolute filename or 3 * len(filename) + 1 in case
  728  * of a relative filename.
  729  *
  730  * EXAMPLE
  731  *   Input:  "/bin/bash"
  732  *   Output: "file:///bin/bash"
  733  *
  734  * @param filename     <b>IN</b>: Unix filename to convert
  735  * @param uriString    <b>OUT</b>: Destination to write %URI string to
  736  * @return             Error code or 0 on success
  737  *
  738  * @see uriUriStringToUnixFilenameA
  739  * @see uriWindowsFilenameToUriStringA
  740  * @since 0.5.2
  741  */
  742 URI_PUBLIC int URI_FUNC(UnixFilenameToUriString)(const URI_CHAR * filename,
  743         URI_CHAR * uriString);
  744 
  745 
  746 
  747 /**
  748  * Converts a Windows filename to a %URI string.
  749  * The destination buffer must be large enough to hold 8 + 3 * len(filename) + 1
  750  * characters in case of an absolute filename or 3 * len(filename) + 1 in case
  751  * of a relative filename.
  752  *
  753  * EXAMPLE
  754  *   Input:  "E:\\Documents and Settings"
  755  *   Output: "file:///E:/Documents%20and%20Settings"
  756  *
  757  * @param filename     <b>IN</b>: Windows filename to convert
  758  * @param uriString    <b>OUT</b>: Destination to write %URI string to
  759  * @return             Error code or 0 on success
  760  *
  761  * @see uriUriStringToWindowsFilenameA
  762  * @see uriUnixFilenameToUriStringA
  763  * @since 0.5.2
  764  */
  765 URI_PUBLIC int URI_FUNC(WindowsFilenameToUriString)(const URI_CHAR * filename,
  766         URI_CHAR * uriString);
  767 
  768 
  769 
  770 /**
  771  * Extracts a Unix filename from a %URI string.
  772  * The destination buffer must be large enough to hold len(uriString) + 1 - 7
  773  * characters in case of an absolute %URI or len(uriString) + 1 in case
  774  * of a relative %URI.
  775  *
  776  * @param uriString    <b>IN</b>: %URI string to convert
  777  * @param filename     <b>OUT</b>: Destination to write filename to
  778  * @return             Error code or 0 on success
  779  *
  780  * @see uriUnixFilenameToUriStringA
  781  * @see uriUriStringToWindowsFilenameA
  782  * @since 0.5.2
  783  */
  784 URI_PUBLIC int URI_FUNC(UriStringToUnixFilename)(const URI_CHAR * uriString,
  785         URI_CHAR * filename);
  786 
  787 
  788 
  789 /**
  790  * Extracts a Windows filename from a %URI string.
  791  * The destination buffer must be large enough to hold len(uriString) + 1 - 5
  792  * characters in case of an absolute %URI or len(uriString) + 1 in case
  793  * of a relative %URI.
  794  *
  795  * @param uriString    <b>IN</b>: %URI string to convert
  796  * @param filename     <b>OUT</b>: Destination to write filename to
  797  * @return             Error code or 0 on success
  798  *
  799  * @see uriWindowsFilenameToUriStringA
  800  * @see uriUriStringToUnixFilenameA
  801  * @since 0.5.2
  802  */
  803 URI_PUBLIC int URI_FUNC(UriStringToWindowsFilename)(const URI_CHAR * uriString,
  804         URI_CHAR * filename);
  805 
  806 
  807 
  808 /**
  809  * Calculates the number of characters needed to store the
  810  * string representation of the given query list excluding the
  811  * terminator. It is assumed that line breaks are will be
  812  * normalized to "%0D%0A".
  813  *
  814  * @param queryList         <b>IN</b>: Query list to measure
  815  * @param charsRequired     <b>OUT</b>: Length of the string representation in characters <b>excluding</b> terminator
  816  * @return                  Error code or 0 on success
  817  *
  818  * @see uriComposeQueryCharsRequiredExA
  819  * @see uriComposeQueryA
  820  * @since 0.7.0
  821  */
  822 URI_PUBLIC int URI_FUNC(ComposeQueryCharsRequired)(
  823         const URI_TYPE(QueryList) * queryList, int * charsRequired);
  824 
  825 
  826 
  827 /**
  828  * Calculates the number of characters needed to store the
  829  * string representation of the given query list excluding the
  830  * terminator.
  831  *
  832  * @param queryList         <b>IN</b>: Query list to measure
  833  * @param charsRequired     <b>OUT</b>: Length of the string representation in characters <b>excluding</b> terminator
  834  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  835  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  836  * @return                  Error code or 0 on success
  837  *
  838  * @see uriComposeQueryCharsRequiredA
  839  * @see uriComposeQueryExA
  840  * @since 0.7.0
  841  */
  842 URI_PUBLIC  int URI_FUNC(ComposeQueryCharsRequiredEx)(
  843         const URI_TYPE(QueryList) * queryList,
  844         int * charsRequired, UriBool spaceToPlus, UriBool normalizeBreaks);
  845 
  846 
  847 
  848 /**
  849  * Converts a query list structure back to a query string.
  850  * The composed string does not start with '?',
  851  * on the way ' ' is converted to '+' and line breaks are
  852  * normalized to "%0D%0A".
  853  *
  854  * @param dest              <b>OUT</b>: Output destination
  855  * @param queryList         <b>IN</b>: Query list to convert
  856  * @param maxChars          <b>IN</b>: Maximum number of characters to copy <b>including</b> terminator
  857  * @param charsWritten      <b>OUT</b>: Number of characters written, can be lower than maxChars even if the query list is too long!
  858  * @return                  Error code or 0 on success
  859  *
  860  * @see uriComposeQueryExA
  861  * @see uriComposeQueryMallocA
  862  * @see uriComposeQueryMallocExA
  863  * @see uriComposeQueryMallocExMmA
  864  * @see uriComposeQueryCharsRequiredA
  865  * @see uriDissectQueryMallocA
  866  * @see uriDissectQueryMallocExA
  867  * @see uriDissectQueryMallocExMmA
  868  * @since 0.7.0
  869  */
  870 URI_PUBLIC int URI_FUNC(ComposeQuery)(URI_CHAR * dest,
  871         const URI_TYPE(QueryList) * queryList, int maxChars, int * charsWritten);
  872 
  873 
  874 
  875 /**
  876  * Converts a query list structure back to a query string.
  877  * The composed string does not start with '?'.
  878  *
  879  * @param dest              <b>OUT</b>: Output destination
  880  * @param queryList         <b>IN</b>: Query list to convert
  881  * @param maxChars          <b>IN</b>: Maximum number of characters to copy <b>including</b> terminator
  882  * @param charsWritten      <b>OUT</b>: Number of characters written, can be lower than maxChars even if the query list is too long!
  883  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  884  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  885  * @return                  Error code or 0 on success
  886  *
  887  * @see uriComposeQueryA
  888  * @see uriComposeQueryMallocA
  889  * @see uriComposeQueryMallocExA
  890  * @see uriComposeQueryMallocExMmA
  891  * @see uriComposeQueryCharsRequiredExA
  892  * @see uriDissectQueryMallocA
  893  * @see uriDissectQueryMallocExA
  894  * @see uriDissectQueryMallocExMmA
  895  * @since 0.7.0
  896  */
  897 URI_PUBLIC int URI_FUNC(ComposeQueryEx)(URI_CHAR * dest,
  898         const URI_TYPE(QueryList) * queryList, int maxChars, int * charsWritten,
  899         UriBool spaceToPlus, UriBool normalizeBreaks);
  900 
  901 
  902 
  903 /**
  904  * Converts a query list structure back to a query string.
  905  * Memory for this string is allocated internally.
  906  * The composed string does not start with '?',
  907  * on the way ' ' is converted to '+' and line breaks are
  908  * normalized to "%0D%0A".
  909  * Uses default libc-based memory manager.
  910  *
  911  * @param dest              <b>OUT</b>: Output destination
  912  * @param queryList         <b>IN</b>: Query list to convert
  913  * @return                  Error code or 0 on success
  914  *
  915  * @see uriComposeQueryMallocExA
  916  * @see uriComposeQueryMallocExMmA
  917  * @see uriComposeQueryA
  918  * @see uriDissectQueryMallocA
  919  * @see uriDissectQueryMallocExA
  920  * @see uriDissectQueryMallocExMmA
  921  * @since 0.7.0
  922  */
  923 URI_PUBLIC int URI_FUNC(ComposeQueryMalloc)(URI_CHAR ** dest,
  924         const URI_TYPE(QueryList) * queryList);
  925 
  926 
  927 
  928 /**
  929  * Converts a query list structure back to a query string.
  930  * Memory for this string is allocated internally.
  931  * The composed string does not start with '?'.
  932  * Uses default libc-based memory manager.
  933  *
  934  * @param dest              <b>OUT</b>: Output destination
  935  * @param queryList         <b>IN</b>: Query list to convert
  936  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  937  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  938  * @return                  Error code or 0 on success
  939  *
  940  * @see uriComposeQueryMallocA
  941  * @see uriComposeQueryMallocExMmA
  942  * @see uriComposeQueryExA
  943  * @see uriDissectQueryMallocA
  944  * @see uriDissectQueryMallocExA
  945  * @see uriDissectQueryMallocExMmA
  946  * @since 0.7.0
  947  */
  948 URI_PUBLIC int URI_FUNC(ComposeQueryMallocEx)(URI_CHAR ** dest,
  949         const URI_TYPE(QueryList) * queryList,
  950         UriBool spaceToPlus, UriBool normalizeBreaks);
  951 
  952 
  953 
  954 /**
  955  * Converts a query list structure back to a query string.
  956  * Memory for this string is allocated internally.
  957  * The composed string does not start with '?'.
  958  *
  959  * @param dest              <b>OUT</b>: Output destination
  960  * @param queryList         <b>IN</b>: Query list to convert
  961  * @param spaceToPlus       <b>IN</b>: Whether to convert ' ' to '+' or not
  962  * @param normalizeBreaks   <b>IN</b>: Whether to convert CR and LF to CR-LF or not.
  963  * @param memory            <b>IN</b>: Memory manager to use, NULL for default libc
  964  * @return                  Error code or 0 on success
  965  *
  966  * @see uriComposeQueryMallocA
  967  * @see uriComposeQueryMallocExA
  968  * @see uriComposeQueryExA
  969  * @see uriDissectQueryMallocA
  970  * @see uriDissectQueryMallocExA
  971  * @see uriDissectQueryMallocExMmA
  972  * @since 0.9.0
  973  */
  974 URI_PUBLIC int URI_FUNC(ComposeQueryMallocExMm)(URI_CHAR ** dest,
  975         const URI_TYPE(QueryList) * queryList,
  976         UriBool spaceToPlus, UriBool normalizeBreaks,
  977         UriMemoryManager * memory);
  978 
  979 
  980 
  981 /**
  982  * Constructs a query list from the raw query string of a given URI.
  983  * On the way '+' is converted back to ' ', line breaks are not modified.
  984  * Uses default libc-based memory manager.
  985  *
  986  * @param dest              <b>OUT</b>: Output destination
  987  * @param itemCount         <b>OUT</b>: Number of items found, can be NULL
  988  * @param first             <b>IN</b>: Pointer to first character <b>after</b> '?'
  989  * @param afterLast         <b>IN</b>: Pointer to character after the last one still in
  990  * @return                  Error code or 0 on success
  991  *
  992  * @see uriDissectQueryMallocExA
  993  * @see uriDissectQueryMallocExMmA
  994  * @see uriComposeQueryA
  995  * @see uriFreeQueryListA
  996  * @see uriFreeQueryListMmA
  997  * @since 0.7.0
  998  */
  999 URI_PUBLIC int URI_FUNC(DissectQueryMalloc)(URI_TYPE(QueryList) ** dest,
 1000         int * itemCount, const URI_CHAR * first, const URI_CHAR * afterLast);
 1001 
 1002 
 1003 
 1004 /**
 1005  * Constructs a query list from the raw query string of a given URI.
 1006  * Uses default libc-based memory manager.
 1007  *
 1008  * @param dest              <b>OUT</b>: Output destination
 1009  * @param itemCount         <b>OUT</b>: Number of items found, can be NULL
 1010  * @param first             <b>IN</b>: Pointer to first character <b>after</b> '?'
 1011  * @param afterLast         <b>IN</b>: Pointer to character after the last one still in
 1012  * @param plusToSpace       <b>IN</b>: Whether to convert '+' to ' ' or not
 1013  * @param breakConversion   <b>IN</b>: Line break conversion mode
 1014  * @return                  Error code or 0 on success
 1015  *
 1016  * @see uriDissectQueryMallocA
 1017  * @see uriDissectQueryMallocExMmA
 1018  * @see uriComposeQueryExA
 1019  * @see uriFreeQueryListA
 1020  * @since 0.7.0
 1021  */
 1022 URI_PUBLIC int URI_FUNC(DissectQueryMallocEx)(URI_TYPE(QueryList) ** dest,
 1023         int * itemCount, const URI_CHAR * first, const URI_CHAR * afterLast,
 1024         UriBool plusToSpace, UriBreakConversion breakConversion);
 1025 
 1026 
 1027 
 1028 /**
 1029  * Constructs a query list from the raw query string of a given URI.
 1030  *
 1031  * @param dest              <b>OUT</b>: Output destination
 1032  * @param itemCount         <b>OUT</b>: Number of items found, can be NULL
 1033  * @param first             <b>IN</b>: Pointer to first character <b>after</b> '?'
 1034  * @param afterLast         <b>IN</b>: Pointer to character after the last one still in
 1035  * @param plusToSpace       <b>IN</b>: Whether to convert '+' to ' ' or not
 1036  * @param breakConversion   <b>IN</b>: Line break conversion mode
 1037  * @param memory            <b>IN</b>: Memory manager to use, NULL for default libc
 1038  * @return                  Error code or 0 on success
 1039  *
 1040  * @see uriDissectQueryMallocA
 1041  * @see uriDissectQueryMallocExA
 1042  * @see uriComposeQueryExA
 1043  * @see uriFreeQueryListA
 1044  * @see uriFreeQueryListMmA
 1045  * @since 0.9.0
 1046  */
 1047 URI_PUBLIC int URI_FUNC(DissectQueryMallocExMm)(URI_TYPE(QueryList) ** dest,
 1048         int * itemCount, const URI_CHAR * first, const URI_CHAR * afterLast,
 1049         UriBool plusToSpace, UriBreakConversion breakConversion,
 1050         UriMemoryManager * memory);
 1051 
 1052 
 1053 
 1054 /**
 1055  * Frees all memory associated with the given query list.
 1056  * The structure itself is freed as well.
 1057  *
 1058  * @param queryList   <b>INOUT</b>: Query list to free
 1059  *
 1060  * @see uriFreeQueryListMmA
 1061  * @since 0.7.0
 1062  */
 1063 URI_PUBLIC void URI_FUNC(FreeQueryList)(URI_TYPE(QueryList) * queryList);
 1064 
 1065 
 1066 
 1067 /**
 1068  * Frees all memory associated with the given query list.
 1069  * The structure itself is freed as well.
 1070  *
 1071  * @param queryList  <b>INOUT</b>: Query list to free
 1072  * @param memory     <b>IN</b>: Memory manager to use, NULL for default libc
 1073  * @return           Error code or 0 on success
 1074  *
 1075  * @see uriFreeQueryListA
 1076  * @since 0.9.0
 1077  */
 1078 URI_PUBLIC int URI_FUNC(FreeQueryListMm)(URI_TYPE(QueryList) * queryList,
 1079         UriMemoryManager * memory);
 1080 
 1081 
 1082 
 1083 /**
 1084  * Makes the %URI hold copies of strings so that it no longer depends
 1085  * on the original %URI string.  If the %URI is already owner of copies,
 1086  * this function returns <c>URI_TRUE</c> and does not modify the %URI further.
 1087  *
 1088  * Uses default libc-based memory manager.
 1089  *
 1090  * @param uri    <b>INOUT</b>: %URI to make independent
 1091  * @return       Error code or 0 on success
 1092  *
 1093  * @see uriMakeOwnerMmA
 1094  * @since 0.9.4
 1095  */
 1096 URI_PUBLIC int URI_FUNC(MakeOwner)(URI_TYPE(Uri) * uri);
 1097 
 1098 
 1099 
 1100 /**
 1101  * Makes the %URI hold copies of strings so that it no longer depends
 1102  * on the original %URI string.  If the %URI is already owner of copies,
 1103  * this function returns <c>URI_TRUE</c> and does not modify the %URI further.
 1104  *
 1105  * @param uri     <b>INOUT</b>: %URI to make independent
 1106  * @param memory  <b>IN</b>: Memory manager to use, NULL for default libc
 1107  * @return        Error code or 0 on success
 1108  *
 1109  * @see uriMakeOwnerA
 1110  * @since 0.9.4
 1111  */
 1112 URI_PUBLIC int URI_FUNC(MakeOwnerMm)(URI_TYPE(Uri) * uri,
 1113                                      UriMemoryManager * memory);
 1114 
 1115 
 1116 
 1117 #ifdef __cplusplus
 1118 }
 1119 #endif
 1120 
 1121 
 1122 
 1123 #endif
 1124 #endif