Loading...
Searching...
No Matches
Uri.h File Reference

## Data Structures

struct | UriTextRangeStructA
struct | UriPathSegmentStructA
struct | UriHostDataStructA
struct | UriUriStructA
struct | UriParserStateStructA
struct | UriQueryListStructA

## Typedefs

typedef struct UriTextRangeStructA | UriTextRangeA
typedef struct UriPathSegmentStructA | UriPathSegmentA
typedef struct UriHostDataStructA | UriHostDataA
typedef struct UriUriStructA | UriUriA
typedef struct UriParserStateStructA | UriParserStateA
typedef struct UriQueryListStructA | UriQueryListA

## Functions

UriBool | uriHasHostA (const UriUriA *uri)
int | uriParseIpSixAddressA (UriIp6 *output, const char *first, const char *afterLast)
int | uriParseIpSixAddressMmA (UriIp6 *output, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriParseUriExA (UriParserStateA *state, const char *first, const char *afterLast)
int | uriParseUriA (UriParserStateA *state, const char *text)
int | uriParseSingleUriA (UriUriA *uri, const char *text, const char **errorPos)
int | uriParseSingleUriExA (UriUriA *uri, const char *first, const char *afterLast, const char **errorPos)
int | uriParseSingleUriExMmA (UriUriA *uri, const char *first, const char *afterLast, const char **errorPos, UriMemoryManager *memory)
void | uriFreeUriMembersA (UriUriA *uri)
int | uriFreeUriMembersMmA (UriUriA *uri, UriMemoryManager *memory)
char * | uriEscapeExA (const char *inFirst, const char *inAfterLast, char *out, UriBool spaceToPlus, UriBool normalizeBreaks)
char * | uriEscapeA (const char *in, char *out, UriBool spaceToPlus, UriBool normalizeBreaks)
const char * | uriUnescapeInPlaceExA (char *inout, UriBool plusToSpace, UriBreakConversion breakConversion)
const char * | uriUnescapeInPlaceA (char *inout)
int | uriAddBaseUriA (UriUriA *absoluteDest, const UriUriA *relativeSource, const UriUriA *absoluteBase)
int | uriAddBaseUriExA (UriUriA *absoluteDest, const UriUriA *relativeSource, const UriUriA *absoluteBase, UriResolutionOptions options)
int | uriAddBaseUriExMmA (UriUriA *absoluteDest, const UriUriA *relativeSource, const UriUriA *absoluteBase, UriResolutionOptions options, UriMemoryManager *memory)
int | uriRemoveBaseUriA (UriUriA *dest, const UriUriA *absoluteSource, const UriUriA *absoluteBase, UriBool domainRootMode)
int | uriRemoveBaseUriMmA (UriUriA *dest, const UriUriA *absoluteSource, const UriUriA *absoluteBase, UriBool domainRootMode, UriMemoryManager *memory)
UriBool | uriEqualsUriA (const UriUriA *a, const UriUriA *b)
int | uriToStringCharsRequiredA (const UriUriA *uri, int *charsRequired)
int | uriToStringA (char *dest, const UriUriA *uri, int maxChars, int *charsWritten)
int | uriCopyUriMmA (UriUriA *destUri, const UriUriA *sourceUri, UriMemoryManager *memory)
int | uriCopyUriA (UriUriA *destUri, const UriUriA *sourceUri)
unsigned int | uriNormalizeSyntaxMaskRequiredA (const UriUriA *uri)
int | uriNormalizeSyntaxMaskRequiredExA (const UriUriA *uri, unsigned int *outMask)
int | uriNormalizeSyntaxExA (UriUriA *uri, unsigned int mask)
int | uriNormalizeSyntaxExMmA (UriUriA *uri, unsigned int mask, UriMemoryManager *memory)
int | uriNormalizeSyntaxA (UriUriA *uri)
int | uriUnixFilenameToUriStringA (const char *filename, char *uriString)
int | uriWindowsFilenameToUriStringA (const char *filename, char *uriString)
int | uriUriStringToUnixFilenameA (const char *uriString, char *filename)
int | uriUriStringToWindowsFilenameA (const char *uriString, char *filename)
int | uriComposeQueryCharsRequiredA (const UriQueryListA *queryList, int *charsRequired)
int | uriComposeQueryCharsRequiredExA (const UriQueryListA *queryList, int *charsRequired, UriBool spaceToPlus, UriBool normalizeBreaks)
int | uriComposeQueryA (char *dest, const UriQueryListA *queryList, int maxChars, int *charsWritten)
int | uriComposeQueryExA (char *dest, const UriQueryListA *queryList, int maxChars, int *charsWritten, UriBool spaceToPlus, UriBool normalizeBreaks)
int | uriComposeQueryMallocA (char **dest, const UriQueryListA *queryList)
int | uriComposeQueryMallocExA (char **dest, const UriQueryListA *queryList, UriBool spaceToPlus, UriBool normalizeBreaks)
int | uriComposeQueryMallocExMmA (char **dest, const UriQueryListA *queryList, UriBool spaceToPlus, UriBool normalizeBreaks, UriMemoryManager *memory)
int | uriDissectQueryMallocA (UriQueryListA **dest, int *itemCount, const char *first, const char *afterLast)
int | uriDissectQueryMallocExA (UriQueryListA **dest, int *itemCount, const char *first, const char *afterLast, UriBool plusToSpace, UriBreakConversion breakConversion)
int | uriDissectQueryMallocExMmA (UriQueryListA **dest, int *itemCount, const char *first, const char *afterLast, UriBool plusToSpace, UriBreakConversion breakConversion, UriMemoryManager *memory)
void | uriFreeQueryListA (UriQueryListA *queryList)
int | uriFreeQueryListMmA (UriQueryListA *queryList, UriMemoryManager *memory)
int | uriMakeOwnerA (UriUriA *uri)
int | uriMakeOwnerMmA (UriUriA *uri, UriMemoryManager *memory)
UriBool | uriIsWellFormedFragmentA (const char *first, const char *afterLast)
UriBool | uriIsWellFormedHostIp4A (const char *first, const char *afterLast)
int | uriIsWellFormedHostIp6A (const char *first, const char *afterLast)
int | uriIsWellFormedHostIp6MmA (const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriIsWellFormedHostIpFutureA (const char *first, const char *afterLast)
int | uriIsWellFormedHostIpFutureMmA (const char *first, const char *afterLast, UriMemoryManager *memory)
UriBool | uriIsWellFormedHostRegNameA (const char *first, const char *afterLast)
UriBool | uriIsWellFormedPathA (const char *first, const char *afterLast, UriBool hasHost)
UriBool | uriIsWellFormedPortA (const char *first, const char *afterLast)
UriBool | uriIsWellFormedQueryA (const char *first, const char *afterLast)
UriBool | uriIsWellFormedSchemeA (const char *first, const char *afterLast)
UriBool | uriIsWellFormedUserInfoA (const char *first, const char *afterLast)
int | uriSetFragmentA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetFragmentMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetHostAutoA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetHostAutoMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetHostRegNameA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetHostRegNameMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetHostIp4A (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetHostIp4MmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetHostIp6A (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetHostIp6MmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetHostIpFutureA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetHostIpFutureMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetPathA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetPathMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetPortTextA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetPortTextMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetQueryA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetQueryMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetSchemeA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetSchemeMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
int | uriSetUserInfoA (UriUriA *uri, const char *first, const char *afterLast)
int | uriSetUserInfoMmA (UriUriA *uri, const char *first, const char *afterLast, UriMemoryManager *memory)
const char * | uriBaseRuntimeVersionA (void)

## Detailed Description

Holds the RFC 3986 URI parser interface. NOTE: This header includes itself twice.

## Typedef Documentation

## UriHostDataA

typedef struct UriHostDataStructA UriHostDataA

Holds structured host information. This is either a IPv4, IPv6, plain text for IPvFuture or all zero for a registered name.

See also
  UriUriA

Since
  0.3.0

Holds structured host information. This is either a IPv4, IPv6, plain text for IPvFuture or all zero for a registered name.

See also
  UriUriA

Since
  0.3.0

## UriParserStateA

typedef struct UriParserStateStructA UriParserStateA

Represents a state of the URI parser. Missing components can be NULL to reflect a components absence.

See also
  uriFreeUriMembersA
  uriFreeUriMembersMmA

Since
  0.3.0

Represents a state of the URI parser. Missing components can be NULL to reflect a components absence.

See also
  uriFreeUriMembersA
  uriFreeUriMembersMmA

Since
  0.3.0

## UriPathSegmentA

typedef struct UriPathSegmentStructA UriPathSegmentA

Represents a path segment within a URI path. More precisely it is a node in a linked list of path segments.

See also
  UriUriA

Since
  0.3.0

Represents a path segment within a URI path. More precisely it is a node in a linked list of path segments.

See also
  UriUriA

Since
  0.3.0

## UriQueryListA

typedef struct UriQueryListStructA UriQueryListA

Represents a query element. More precisely it is a node in a linked list of query elements.

Since
  0.7.0

Represents a query element. More precisely it is a node in a linked list of query elements.

Since
  0.7.0

## UriTextRangeA

typedef struct UriTextRangeStructA UriTextRangeA

Specifies a range of characters within a string. The range includes all characters from `first` to one before `afterLast`. So if both are non-NULL the difference is the length of the text range.

See also
  UriUriA
  UriPathSegmentA
  UriHostDataA

Since
  0.3.0

Specifies a range of characters within a string. The range includes all characters from `first` to one before `afterLast`. So if both are non-NULL the difference is the length of the text range.

See also
  UriUriA
  UriPathSegmentA
  UriHostDataA

Since
  0.3.0

## UriUriA

typedef struct UriUriStructA UriUriA

Represents an RFC 3986 URI. Missing components can be {NULL, NULL} ranges.

See also
  uriFreeUriMembersA
  uriFreeUriMembersMmA
  UriParserStateA

Since
  0.3.0

Represents an RFC 3986 URI. Missing components can be {NULL, NULL} ranges.

See also
  uriFreeUriMembersA
  uriFreeUriMembersMmA
  UriParserStateA

Since
  0.3.0

## Function Documentation

## uriAddBaseUriA()

int uriAddBaseUriA | ( | UriUriA * | absoluteDest,
|  | const UriUriA * | relativeSource,
|  | const UriUriA * | absoluteBase )

Performs reference resolution as described in section 5.2.2 of RFC 3986. Uses default libc-based memory manager. NOTE: On success you have to call uriFreeUriMembersA on `absoluteDest` manually later.

Parameters

  absoluteDest | OUT: Result URI
  relativeSource | IN: Reference to resolve
  absoluteBase | IN: Base URI to apply

Returns
  Error code or 0 on success

See also
  uriRemoveBaseUriA
  uriRemoveBaseUriMmA
  uriAddBaseUriExA
  uriAddBaseUriExMmA

Since
  0.4.0

## uriAddBaseUriExA()

int uriAddBaseUriExA | ( | UriUriA * | absoluteDest,
|  | const UriUriA * | relativeSource,
|  | const UriUriA * | absoluteBase,
|  | UriResolutionOptions | options )

Performs reference resolution as described in section 5.2.2 of RFC 3986. Uses default libc-based memory manager. NOTE: On success you have to call uriFreeUriMembersA on `absoluteDest` manually later.

Parameters

  absoluteDest | OUT: Result URI
  relativeSource | IN: Reference to resolve
  absoluteBase | IN: Base URI to apply
  options | IN: Configuration to apply

Returns
  Error code or 0 on success

See also
  uriRemoveBaseUriA
  uriAddBaseUriA
  uriAddBaseUriExMmA

Since
  0.8.1

## uriAddBaseUriExMmA()

int uriAddBaseUriExMmA | ( | UriUriA * | absoluteDest,
|  | const UriUriA * | relativeSource,
|  | const UriUriA * | absoluteBase,
|  | UriResolutionOptions | options,
|  | UriMemoryManager * | memory )

Performs reference resolution as described in section 5.2.2 of RFC 3986. NOTE: On success you have to call uriFreeUriMembersMmA on `absoluteDest` manually later.

Parameters

  absoluteDest | OUT: Result URI
  relativeSource | IN: Reference to resolve
  absoluteBase | IN: Base URI to apply
  options | IN: Configuration to apply
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriRemoveBaseUriA
  uriRemoveBaseUriMmA
  uriAddBaseUriA
  uriAddBaseUriExA

Since
  0.9.0

## uriBaseRuntimeVersionA()

const char * uriBaseRuntimeVersionA | ( | void |  | ) |

Obtain the base runtime version of uriparser.

The string returned is based on the compile time version of uriparser.

Note
  Distributors may have applied backports of security fixes (potentially with adjusting packaging version but often without adjusting runtime version) or even fully custom patches. As a result, the version string returned serves as nothing more than "based on that version", it does not guarantee equivalence to vanilla upstream releases or absence of additional downstream patches. It is nothing more than "a hint" and MUST NEVER be used to make decisions on in application code at runtime.

Returns
  Pointer to a read-only zero terminated version string

Since
  0.9.9

## uriComposeQueryA()

int uriComposeQueryA | ( | char * | dest,
|  | const UriQueryListA * | queryList,
|  | int | maxChars,
|  | int * | charsWritten )

Converts a query list structure back to a query string. The composed string does not start with '?', on the way ' ' is converted to '+' and line breaks are normalized to "%0D%0A".

Parameters

  dest | OUT: Output destination
  queryList | IN: Query list to convert
  maxChars | IN: Maximum number of characters to copy including terminator
  charsWritten | OUT: Number of characters written, can be lower than maxChars even if the query list is too long!

Returns
  Error code or 0 on success

See also
  uriComposeQueryExA
  uriComposeQueryMallocA
  uriComposeQueryMallocExA
  uriComposeQueryMallocExMmA
  uriComposeQueryCharsRequiredA
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA

Since
  0.7.0

## uriComposeQueryCharsRequiredA()

int uriComposeQueryCharsRequiredA | ( | const UriQueryListA * | queryList,
|  | int * | charsRequired )

Calculates the number of characters needed to store the string representation of the given query list excluding the terminator. It is assumed that line breaks are will be normalized to "%0D%0A".

Parameters

  queryList | IN: Query list to measure
  charsRequired | OUT: Length of the string representation in characters excluding terminator

Returns
  Error code or 0 on success

See also
  uriComposeQueryCharsRequiredExA
  uriComposeQueryA

Since
  0.7.0

## uriComposeQueryCharsRequiredExA()

int uriComposeQueryCharsRequiredExA | ( | const UriQueryListA * | queryList,
|  | int * | charsRequired,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks )

Calculates the number of characters needed to store the string representation of the given query list excluding the terminator.

Parameters

  queryList | IN: Query list to measure
  charsRequired | OUT: Length of the string representation in characters excluding terminator
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.

Returns
  Error code or 0 on success

See also
  uriComposeQueryCharsRequiredA
  uriComposeQueryExA

Since
  0.7.0

## uriComposeQueryExA()

int uriComposeQueryExA | ( | char * | dest,
|  | const UriQueryListA * | queryList,
|  | int | maxChars,
|  | int * | charsWritten,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks )

Converts a query list structure back to a query string. The composed string does not start with '?'.

Parameters

  dest | OUT: Output destination
  queryList | IN: Query list to convert
  maxChars | IN: Maximum number of characters to copy including terminator
  charsWritten | OUT: Number of characters written, can be lower than maxChars even if the query list is too long!
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.

Returns
  Error code or 0 on success

See also
  uriComposeQueryA
  uriComposeQueryMallocA
  uriComposeQueryMallocExA
  uriComposeQueryMallocExMmA
  uriComposeQueryCharsRequiredExA
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA

Since
  0.7.0

## uriComposeQueryMallocA()

int uriComposeQueryMallocA | ( | char ** | dest,
|  | const UriQueryListA * | queryList )

Converts a query list structure back to a query string. Memory for this string is allocated internally. The composed string does not start with '?', on the way ' ' is converted to '+' and line breaks are normalized to "%0D%0A". Uses default libc-based memory manager.

Parameters

  dest | OUT: Output destination
  queryList | IN: Query list to convert

Returns
  Error code or 0 on success

See also
  uriComposeQueryMallocExA
  uriComposeQueryMallocExMmA
  uriComposeQueryA
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA

Since
  0.7.0

## uriComposeQueryMallocExA()

int uriComposeQueryMallocExA | ( | char ** | dest,
|  | const UriQueryListA * | queryList,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks )

Converts a query list structure back to a query string. Memory for this string is allocated internally. The composed string does not start with '?'. Uses default libc-based memory manager.

Parameters

  dest | OUT: Output destination
  queryList | IN: Query list to convert
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.

Returns
  Error code or 0 on success

See also
  uriComposeQueryMallocA
  uriComposeQueryMallocExMmA
  uriComposeQueryExA
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA

Since
  0.7.0

## uriComposeQueryMallocExMmA()

int uriComposeQueryMallocExMmA | ( | char ** | dest,
|  | const UriQueryListA * | queryList,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks,
|  | UriMemoryManager * | memory )

Converts a query list structure back to a query string. Memory for this string is allocated internally. The composed string does not start with '?'.

Parameters

  dest | OUT: Output destination
  queryList | IN: Query list to convert
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriComposeQueryMallocA
  uriComposeQueryMallocExA
  uriComposeQueryExA
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA

Since
  0.9.0

## uriCopyUriA()

int uriCopyUriA | ( | UriUriA * | destUri,
|  | const UriUriA * | sourceUri )

Copies a URI structure.

Parameters

  destUri | OUT: Output destination
  sourceUri | IN: URI to copy

Returns
  Error code or 0 on success

See also
  uriCopyUriMmA

Since
  0.9.9

## uriCopyUriMmA()

int uriCopyUriMmA | ( | UriUriA * | destUri,
|  | const UriUriA * | sourceUri,
|  | UriMemoryManager * | memory )

Copies a URI structure.

Parameters

  destUri | OUT: Output destination
  sourceUri | IN: URI to copy
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriCopyUriA

Since
  0.9.9

## uriDissectQueryMallocA()

int uriDissectQueryMallocA | ( | UriQueryListA ** | dest,
|  | int * | itemCount,
|  | const char * | first,
|  | const char * | afterLast )

Constructs a query list from the raw query string of a given URI. On the way '+' is converted back to ' ', line breaks are not modified. Uses default libc-based memory manager.

Parameters

  dest | OUT: Output destination
  itemCount | OUT: Number of items found, can be NULL
  first | IN: Pointer to first character after '?'
  afterLast | IN: Pointer to character after the last one still in

Returns
  Error code or 0 on success

See also
  uriDissectQueryMallocExA
  uriDissectQueryMallocExMmA
  uriComposeQueryA
  uriFreeQueryListA
  uriFreeQueryListMmA

Since
  0.7.0

## uriDissectQueryMallocExA()

int uriDissectQueryMallocExA | ( | UriQueryListA ** | dest,
|  | int * | itemCount,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriBool | plusToSpace,
|  | UriBreakConversion | breakConversion )

Constructs a query list from the raw query string of a given URI. Uses default libc-based memory manager.

Parameters

  dest | OUT: Output destination
  itemCount | OUT: Number of items found, can be NULL
  first | IN: Pointer to first character after '?'
  afterLast | IN: Pointer to character after the last one still in
  plusToSpace | IN: Whether to convert '+' to ' ' or not
  breakConversion | IN: Line break conversion mode

Returns
  Error code or 0 on success

See also
  uriDissectQueryMallocA
  uriDissectQueryMallocExMmA
  uriComposeQueryExA
  uriFreeQueryListA

Since
  0.7.0

## uriDissectQueryMallocExMmA()

int uriDissectQueryMallocExMmA | ( | UriQueryListA ** | dest,
|  | int * | itemCount,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriBool | plusToSpace,
|  | UriBreakConversion | breakConversion,
|  | UriMemoryManager * | memory )

Constructs a query list from the raw query string of a given URI.

Parameters

  dest | OUT: Output destination
  itemCount | OUT: Number of items found, can be NULL
  first | IN: Pointer to first character after '?'
  afterLast | IN: Pointer to character after the last one still in
  plusToSpace | IN: Whether to convert '+' to ' ' or not
  breakConversion | IN: Line break conversion mode
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriDissectQueryMallocA
  uriDissectQueryMallocExA
  uriComposeQueryExA
  uriFreeQueryListA
  uriFreeQueryListMmA

Since
  0.9.0

## uriEqualsUriA()

UriBool uriEqualsUriA | ( | const UriUriA * | a,
|  | const UriUriA * | b )

Checks two URIs for equivalence. Comparison is done the naive way, without prior normalization. NOTE: Two `NULL` URIs are equal as well.

Parameters

  a | IN: First URI
  b | IN: Second URI

Returns
  `URI_TRUE` when equal, `URI_FAlSE` else

Since
  0.4.0

## uriEscapeA()

char * uriEscapeA | ( | const char * | in,
|  | char * | out,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks )

Percent-encodes all but unreserved characters from the input string and writes the encoded version to the output string.

NOTE: Be sure to allocate 3 times the space of the input buffer for the output buffer for `normalizeBreaks == URI_FALSE` and 6 times the space for `normalizeBreaks == URI_TRUE` (since e.g. "\x0d" becomes "%0D%0A" in that case).

NOTE: The implementation treats (both `char` and) `wchar_t` units as code point integers, which works well for code points `U+0001` to `U+00ff` in host-native endianness but nothing more; in particular, using `uriEscapeW` with arbitrary Unicode input will not produce healthy results. Passing UTF-8 input to `uriEscapeA` may be useful in some scenarios. Keep in mind that uriparser is about URI (RFC 3986) not IRI (RFC 3987).

Parameters

  in | IN: Text source
  out | OUT: Encoded text destination
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.

Returns
  Position of terminator in output string

See also
  uriEscapeExA
  uriUnescapeInPlaceA

Since
  0.5.0

## uriEscapeExA()

char * uriEscapeExA | ( | const char * | inFirst,
|  | const char * | inAfterLast,
|  | char * | out,
|  | UriBool | spaceToPlus,
|  | UriBool | normalizeBreaks )

Percent-encodes all but unreserved characters from the input string and writes the encoded version to the output string.

NOTE: Be sure to allocate 3 times the space of the input buffer for the output buffer for `normalizeBreaks == URI_FALSE` and 6 times the space for `normalizeBreaks == URI_TRUE` (since e.g. "\x0d" becomes "%0D%0A" in that case).

NOTE: The implementation treats (both `char` and) `wchar_t` units as code point integers, which works well for code points `U+0001` to `U+00ff` in host-native endianness but nothing more; in particular, using `uriEscapeExW` with arbitrary Unicode input will not produce healthy results. Passing UTF-8 input to `uriEscapeExA` may be useful in some scenarios. Keep in mind that uriparser is about URI (RFC 3986) not IRI (RFC 3987).

Parameters

  inFirst | IN: Pointer to first character of the input text
  inAfterLast | IN: Pointer after the last character of the input text
  out | OUT: Encoded text destination
  spaceToPlus | IN: Whether to convert ' ' to '+' or not
  normalizeBreaks | IN: Whether to convert CR and LF to CR-LF or not.

Returns
  Position of terminator in output string

See also
  uriEscapeA
  uriUnescapeInPlaceExA

Since
  0.5.2

## uriFreeQueryListA()

void uriFreeQueryListA | ( | UriQueryListA * | queryList | ) |

Frees all memory associated with the given query list. The structure itself is freed as well.

Parameters

  queryList | INOUT: Query list to free

See also
  uriFreeQueryListMmA

Since
  0.7.0

## uriFreeQueryListMmA()

int uriFreeQueryListMmA | ( | UriQueryListA * | queryList,
|  | UriMemoryManager * | memory )

Frees all memory associated with the given query list. The structure itself is freed as well.

Parameters

  queryList | INOUT: Query list to free
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriFreeQueryListA

Since
  0.9.0

## uriFreeUriMembersA()

void uriFreeUriMembersA | ( | UriUriA * | uri | ) |

Frees all memory associated with the members of the URI structure. Note that the structure itself is not freed, only its members. Uses default libc-based memory manager.

Remarks
  Calling on an all-zeros structure (e.g. through `memset` or `calloc`) is safe.
  Calling on an uninitialized structure is not safe.

Parameters

  uri | INOUT: URI structure whose members should be freed

See also
  uriFreeUriMembersMmA

Since
  0.3.0

## uriFreeUriMembersMmA()

int uriFreeUriMembersMmA | ( | UriUriA * | uri,
|  | UriMemoryManager * | memory )

Frees all memory associated with the members of the URI structure. Note that the structure itself is not freed, only its members.

Remarks
  Calling on an all-zeros structure (e.g. through `memset` or `calloc`) is safe.
  Calling on an uninitialized structure is not safe.

Parameters

  uri | INOUT: URI structure whose members should be freed
  memory | IN: Memory manager to use, NULL for default libc

Returns
  0 on success, error code otherwise

See also
  uriFreeUriMembersA

Since
  0.9.0

## uriHasHostA()

UriBool uriHasHostA | ( | const UriUriA * | uri | ) |

Checks if a URI has the host component set.

Parameters

  uri | IN: URI to check

Returns
  `URI_TRUE` when host is set, `URI_FALSE` otherwise

Since
  0.9.9

## uriIsWellFormedFragmentA()

UriBool uriIsWellFormedFragmentA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed fragment according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetFragmentA
  uriSetFragmentMmA

Since
  0.9.9

## uriIsWellFormedHostIp4A()

UriBool uriIsWellFormedHostIp4A | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed IPv4 address according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetHostIp4A
  uriSetHostIp4MmA

Since
  0.9.9

## uriIsWellFormedHostIp6A()

int uriIsWellFormedHostIp6A | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed IPv6 address according to RFC 3986 or not.

Uses default libc-based memory manager.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_SUCCESS` if non-`NULL` and well-formed, else an error code

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6MmA
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriParseIpSixAddressA
  uriParseIpSixAddressMmA

Since
  0.9.9

## uriIsWellFormedHostIp6MmA()

int uriIsWellFormedHostIp6MmA | ( | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Determines if the given text range contains a well-formed IPv6 address according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  `URI_SUCCESS` if non-`NULL` and well-formed, else an error code

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureMmA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA

Since
  0.9.9

## uriIsWellFormedHostIpFutureA()

int uriIsWellFormedHostIpFutureA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed IPvFuture address according to RFC 3986 or not.

Uses default libc-based memory manager.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_SUCCESS` if non-`NULL` and well-formed, else an error code

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureMmA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetHostIpFutureA
  uriSetHostIpFutureMmA

Since
  0.9.9

## uriIsWellFormedHostIpFutureMmA()

int uriIsWellFormedHostIpFutureMmA | ( | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Determines if the given text range contains a well-formed IPvFuture address according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  `URI_SUCCESS` if non-`NULL` and well-formed, else an error code

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetHostIpFutureA
  uriSetHostIpFutureMmA

Since
  0.9.9

## uriIsWellFormedHostRegNameA()

UriBool uriIsWellFormedHostRegNameA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed registered host name according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetHostRegNameA
  uriSetHostRegNameMmA

Since
  0.9.9

## uriIsWellFormedPathA()

UriBool uriIsWellFormedPathA | ( | const char * | first,
|  | const char * | afterLast,
|  | UriBool | hasHost )

Determines if the given text range contains a well-formed path according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in
  hasHost | IN: Whether the target URI has a non-`NULL` host set or not

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetPathA
  uriSetPathMmA

Since
  0.9.9

## uriIsWellFormedPortA()

UriBool uriIsWellFormedPortA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed port text according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetPortTextA
  uriSetPortTextMmA

Since
  0.9.9

## uriIsWellFormedQueryA()

UriBool uriIsWellFormedQueryA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed query according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetQueryA
  uriSetQueryMmA

Since
  0.9.9

## uriIsWellFormedSchemeA()

UriBool uriIsWellFormedSchemeA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed scheme according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriIsWellFormedUserInfoA
  uriSetSchemeA
  uriSetSchemeMmA

Since
  0.9.9

## uriIsWellFormedUserInfoA()

UriBool uriIsWellFormedUserInfoA | ( | const char * | first,
|  | const char * | afterLast )

Determines if the given text range contains a well-formed user info according to RFC 3986 or not.

Parameters

  first | IN: Pointer to first character
  afterLast | IN: Pointer to character after the last one still in

Returns
  `URI_TRUE` if non-`NULL` and well-formed, else `URI_FALSE`

See also
  uriIsWellFormedFragmentA
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostRegNameA
  uriIsWellFormedPathA
  uriIsWellFormedPortA
  uriIsWellFormedQueryA
  uriIsWellFormedSchemeA
  uriSetUserInfoA
  uriSetUserInfoMmA

Since
  0.9.9

## uriMakeOwnerA()

int uriMakeOwnerA | ( | UriUriA * | uri | ) |

Makes the URI hold copies of strings so that it no longer depends on the original URI string. If the URI is already owner of copies, this function returns `URI_TRUE` and does not modify the URI further.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to make independent

Returns
  Error code or 0 on success

See also
  uriMakeOwnerMmA

Since
  0.9.4

## uriMakeOwnerMmA()

int uriMakeOwnerMmA | ( | UriUriA * | uri,
|  | UriMemoryManager * | memory )

Makes the URI hold copies of strings so that it no longer depends on the original URI string. If the URI is already owner of copies, this function returns `URI_TRUE` and does not modify the URI further.

Parameters

  uri | INOUT: URI to make independent
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriMakeOwnerA

Since
  0.9.4

## uriNormalizeSyntaxA()

int uriNormalizeSyntaxA | ( | UriUriA * | uri | ) |

Normalizes all components of a URI.

NOTE: If necessary the URI becomes owner of all memory behind the text pointed to. Text is duplicated in that case. Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to normalize

Returns
  Error code or 0 on success

See also
  uriNormalizeSyntaxExA
  uriNormalizeSyntaxExMmA
  uriNormalizeSyntaxMaskRequiredA

Since
  0.5.0

## uriNormalizeSyntaxExA()

int uriNormalizeSyntaxExA | ( | UriUriA * | uri,
|  | unsigned int | mask )

Normalizes a URI using a normalization mask. The normalization mask decides what components are normalized.

NOTE: If necessary the URI becomes owner of all memory behind the text pointed to. Text is duplicated in that case. Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to normalize
  mask | IN: Normalization mask

Returns
  Error code or 0 on success

See also
  uriNormalizeSyntaxA
  uriNormalizeSyntaxExMmA
  uriNormalizeSyntaxMaskRequiredA

Since
  0.5.0

## uriNormalizeSyntaxExMmA()

int uriNormalizeSyntaxExMmA | ( | UriUriA * | uri,
|  | unsigned int | mask,
|  | UriMemoryManager * | memory )

Normalizes a URI using a normalization mask. The normalization mask decides what components are normalized.

NOTE: If necessary the URI becomes owner of all memory behind the text pointed to. Text is duplicated in that case.

Parameters

  uri | INOUT: URI to normalize
  mask | IN: Normalization mask
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriNormalizeSyntaxA
  uriNormalizeSyntaxExA
  uriNormalizeSyntaxMaskRequiredA

Since
  0.9.0

## uriNormalizeSyntaxMaskRequiredA()

unsigned int uriNormalizeSyntaxMaskRequiredA | ( | const UriUriA * | uri | ) |

Determines the components of a URI that are not normalized.

Parameters

  uri | IN: URI to check

Returns
  Normalization job mask

See also
  uriNormalizeSyntaxA
  uriNormalizeSyntaxExA
  uriNormalizeSyntaxExMmA
  uriNormalizeSyntaxMaskRequiredExA

Since
  0.5.0

Deprecated
  Deprecated since 0.9.0, please migrate to uriNormalizeSyntaxMaskRequiredExA (with "Ex").

## uriNormalizeSyntaxMaskRequiredExA()

int uriNormalizeSyntaxMaskRequiredExA | ( | const UriUriA * | uri,
|  | unsigned int * | outMask )

Determines the components of a URI that are not normalized.

Parameters

  uri | IN: URI to check
  outMask | OUT: Normalization job mask

Returns
  Error code or 0 on success

See also
  uriNormalizeSyntaxA
  uriNormalizeSyntaxExA
  uriNormalizeSyntaxExMmA
  uriNormalizeSyntaxMaskRequiredA

Since
  0.9.0

## uriParseIpSixAddressA()

int uriParseIpSixAddressA | ( | UriIp6 * | output,
|  | const char * | first,
|  | const char * | afterLast )

Converts an IPv6 text representation into 16 bytes.

Uses default libc-based memory manager.

Parameters

  output | OUT: Output destination, can be `NULL`
  first | IN: First character of IPv6 text to parse
  afterLast | IN: Position to stop parsing at

Returns
  Error code or `URI_SUCCESS` on success

See also
  uriParseIpFourAddressA
  uriParseIpSixAddressMmA
  uriIsWellFormedHostIp6A

Since
  0.9.9

## uriParseIpSixAddressMmA()

int uriParseIpSixAddressMmA | ( | UriIp6 * | output,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Converts an IPv6 text representation into 16 bytes.

Parameters

  output | OUT: Output destination, can be `NULL`
  first | IN: First character of IPv6 text to parse
  afterLast | IN: Position to stop parsing at
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or `URI_SUCCESS` on success

See also
  uriParseIpFourAddressA
  uriParseIpSixAddressA
  uriIsWellFormedHostIp6MmA

Since
  0.9.9

## uriParseSingleUriA()

int uriParseSingleUriA | ( | UriUriA * | uri,
|  | const char * | text,
|  | const char ** | errorPos )

Parses a single RFC 3986 URI. Uses default libc-based memory manager.

Parameters

  uri | OUT: Output URI, must not be NULL
  text | IN: Pointer to the first character to parse, must not be NULL
  errorPos | OUT: Pointer to a pointer to the first character causing a syntax error, can be NULL; only set when URI_ERROR_SYNTAX was returned

Returns
  0 on success, error code otherwise

See also
  uriParseSingleUriExA
  uriParseSingleUriExMmA
  uriToStringA

Since
  0.9.0

## uriParseSingleUriExA()

int uriParseSingleUriExA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | const char ** | errorPos )

Parses a single RFC 3986 URI. Uses default libc-based memory manager.

Parameters

  uri | OUT: Output URI, must not be NULL
  first | IN: Pointer to the first character to parse, must not be NULL
  afterLast | IN: Pointer to the character after the last to parse, can be NULL (to use first + strlen(first))
  errorPos | OUT: Pointer to a pointer to the first character causing a syntax error, can be NULL; only set when URI_ERROR_SYNTAX was returned

Returns
  0 on success, error code otherwise

See also
  uriParseSingleUriA
  uriParseSingleUriExMmA
  uriToStringA

Since
  0.9.0

## uriParseSingleUriExMmA()

int uriParseSingleUriExMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | const char ** | errorPos,
|  | UriMemoryManager * | memory )

Parses a single RFC 3986 URI.

Parameters

  uri | OUT: Output URI, must not be NULL
  first | IN: Pointer to the first character to parse, must not be NULL
  afterLast | IN: Pointer to the character after the last to parse, can be NULL (to use first + strlen(first))
  errorPos | OUT: Pointer to a pointer to the first character causing a syntax error, can be NULL; only set when URI_ERROR_SYNTAX was returned
  memory | IN: Memory manager to use, NULL for default libc

Returns
  0 on success, error code otherwise

See also
  uriParseSingleUriA
  uriParseSingleUriExA
  uriToStringA

Since
  0.9.0

## uriParseUriA()

int uriParseUriA | ( | UriParserStateA * | state,
|  | const char * | text )

Parses a RFC 3986 URI. Uses default libc-based memory manager.

Parameters

  state | INOUT: Parser state with set output URI, must not be NULL
  text | IN: Text to parse, must not be NULL

Returns
  0 on success, error code otherwise

See also
  uriParseUriExA
  uriParseSingleUriA
  uriParseSingleUriExA
  uriToStringA

Since
  0.3.0

Deprecated
  Deprecated since 0.9.0, please migrate to uriParseSingleUriA (with "Single").

## uriParseUriExA()

int uriParseUriExA | ( | UriParserStateA * | state,
|  | const char * | first,
|  | const char * | afterLast )

Parses a RFC 3986 URI. Uses default libc-based memory manager.

Parameters

  state | INOUT: Parser state with set output URI, must not be NULL
  first | IN: Pointer to the first character to parse, must not be NULL
  afterLast | IN: Pointer to the character after the last to parse, must not be NULL

Returns
  0 on success, error code otherwise

See also
  uriParseUriA
  uriParseSingleUriA
  uriParseSingleUriExA
  uriToStringA

Since
  0.3.0

Deprecated
  Deprecated since 0.9.0, please migrate to uriParseSingleUriExA (with "Single").

## uriRemoveBaseUriA()

int uriRemoveBaseUriA | ( | UriUriA * | dest,
|  | const UriUriA * | absoluteSource,
|  | const UriUriA * | absoluteBase,
|  | UriBool | domainRootMode )

Tries to make a relative URI (a reference) from an absolute URI and a given base URI. The resulting URI is going to be relative if the absolute URI and base UI share both scheme and authority. If that is not the case, the result will still be an absolute URI (with scheme part if necessary). Uses default libc-based memory manager. NOTE: On success you have to call uriFreeUriMembersA on `dest` manually later.

Parameters

  dest | OUT: Result URI
  absoluteSource | IN: Absolute URI to make relative
  absoluteBase | IN: Base URI
  domainRootMode | IN: Create URI with path relative to domain root

Returns
  Error code or 0 on success

See also
  uriRemoveBaseUriMmA
  uriAddBaseUriA
  uriAddBaseUriExA
  uriAddBaseUriExMmA

Since
  0.5.2

## uriRemoveBaseUriMmA()

int uriRemoveBaseUriMmA | ( | UriUriA * | dest,
|  | const UriUriA * | absoluteSource,
|  | const UriUriA * | absoluteBase,
|  | UriBool | domainRootMode,
|  | UriMemoryManager * | memory )

Tries to make a relative URI (a reference) from an absolute URI and a given base URI. The resulting URI is going to be relative if the absolute URI and base UI share both scheme and authority. If that is not the case, the result will still be an absolute URI (with scheme part if necessary). NOTE: On success you have to call uriFreeUriMembersMmA on `dest` manually later.

Parameters

  dest | OUT: Result URI
  absoluteSource | IN: Absolute URI to make relative
  absoluteBase | IN: Base URI
  domainRootMode | IN: Create URI with path relative to domain root
  memory | IN: Memory manager to use, NULL for default libc

Returns
  Error code or 0 on success

See also
  uriRemoveBaseUriA
  uriAddBaseUriA
  uriAddBaseUriExA
  uriAddBaseUriExMmA

Since
  0.9.0

## uriSetFragmentA()

int uriSetFragmentA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the fragment of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedFragmentA
  uriSetFragmentMmA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetFragmentMmA()

int uriSetFragmentMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the fragment of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedFragmentA
  uriSetFragmentA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetHostAutoA()

int uriSetHostAutoA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIp6MmA
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostIpFutureMmA
  uriIsWellFormedHostRegNameA
  uriSetFragmentA
  uriSetHostAutoMmA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetHostAutoMmA()

int uriSetHostAutoMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriIsWellFormedHostIp6A
  uriIsWellFormedHostIp6MmA
  uriIsWellFormedHostIpFutureA
  uriIsWellFormedHostIpFutureMmA
  uriIsWellFormedHostRegNameA
  uriSetFragmentMmA
  uriSetHostAutoA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetHostIp4A()

int uriSetHostIp4A | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4MmA
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetHostIp4MmA()

int uriSetHostIp4MmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4A
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetHostIp6A()

int uriSetHostIp6A | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp6A
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6MmA
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetHostIp6MmA()

int uriSetHostIp6MmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp6A
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6A
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetHostIpFutureA()

int uriSetHostIpFutureA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureMmA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetHostIpFutureMmA()

int uriSetHostIpFutureMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostIp4A
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetHostRegNameA()

int uriSetHostRegNameA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostRegNameA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameMmA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetHostRegNameMmA()

int uriSetHostRegNameMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the host of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedHostRegNameA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetPathA()

int uriSetPathA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the path of the given URI to the given value.

Non-`NULL` values must start with a leading slash for URIs that have a host.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedPathA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPathMmA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetPathMmA()

int uriSetPathMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the path of the given URI to the given value.

Non-`NULL` values must start with a leading slash for URIs that have a host.

The URI must have a non-`NULL` host set.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedPathA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPathA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetPortTextA()

int uriSetPortTextA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the port text of the given URI to the given value.

The URI must have a non-`NULL` host set.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedPortA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextMmA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetPortTextMmA()

int uriSetPortTextMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the port text of the given URI to the given value.

The URI must have a non-`NULL` host set.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedPortA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetQueryA()

int uriSetQueryA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the query of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedQueryA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryMmA
  uriSetSchemeA
  uriSetUserInfoA

Since
  0.9.9

## uriSetQueryMmA()

int uriSetQueryMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the query of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedQueryA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryA
  uriSetSchemeMmA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetSchemeA()

int uriSetSchemeA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the scheme of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedSchemeA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeMmA
  uriSetUserInfoA

Since
  0.9.9

## uriSetSchemeMmA()

int uriSetSchemeMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the scheme of the given URI to the given value.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedSchemeA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetUserInfoA()

int uriSetUserInfoA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast )

Sets the user info of the given URI to the given value.

The URI must have a non-`NULL` host set.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Uses default libc-based memory manager.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`

Returns
  Error code or 0 on success

See also
  uriIsWellFormedUserInfoA
  uriSetFragmentA
  uriSetHostAutoA
  uriSetHostIp4A
  uriSetHostIp6A
  uriSetHostIpFutureA
  uriSetHostRegNameA
  uriSetPortTextA
  uriSetQueryA
  uriSetSchemeA
  uriSetUserInfoMmA

Since
  0.9.9

## uriSetUserInfoMmA()

int uriSetUserInfoMmA | ( | UriUriA * | uri,
|  | const char * | first,
|  | const char * | afterLast,
|  | UriMemoryManager * | memory )

Sets the user info of the given URI to the given value.

The URI must have a non-`NULL` host set.

Parameters `first` and `afterLast` must both be `NULL` or non-`NULL` at the same time.

The function may make the URI own its memory if needed (if it is not already owned).

For all return values but `URI_ERROR_MALLOC`, all-or-nothing behavior can be expected, e.g. trying to apply a malformed value will leave the URI unchanged.

Parameters

  uri | INOUT: URI to modify
  first | IN: Pointer to first character, can be `NULL`
  afterLast | IN: Pointer to character after the last one still in, can be `NULL`
  memory | IN: Memory manager to use, `NULL` for default libc

Returns
  Error code or 0 on success

See also
  uriIsWellFormedUserInfoA
  uriSetFragmentMmA
  uriSetHostAutoMmA
  uriSetHostIp4MmA
  uriSetHostIp6MmA
  uriSetHostIpFutureMmA
  uriSetHostRegNameMmA
  uriSetPortTextMmA
  uriSetQueryMmA
  uriSetSchemeMmA
  uriSetUserInfoA

Since
  0.9.9

## uriToStringA()

int uriToStringA | ( | char * | dest,
|  | const UriUriA * | uri,
|  | int | maxChars,
|  | int * | charsWritten )

Converts a URI structure back to text as described in section 5.3 of RFC 3986.

NOTE: Scheme-based normalization (section 6.2.3 of RFC 3986) is not applied and is considered a responsibility of the application using uriparser.

Parameters

  dest | OUT: Output destination
  uri | IN: URI to convert
  maxChars | IN: Maximum number of characters to copy including terminator
  charsWritten | OUT: Number of characters written, can be lower than maxChars even if the URI is too long!

Returns
  Error code or 0 on success

See also
  uriToStringCharsRequiredA

Since
  0.4.0

## uriToStringCharsRequiredA()

int uriToStringCharsRequiredA | ( | const UriUriA * | uri,
|  | int * | charsRequired )

Calculates the number of characters needed to store the string representation of the given URI excluding the terminator.

Parameters

  uri | IN: URI to measure
  charsRequired | OUT: Length of the string representation in characters excluding terminator

Returns
  Error code or 0 on success

See also
  uriToStringA

Since
  0.5.0

## uriUnescapeInPlaceA()

const char * uriUnescapeInPlaceA | ( | char * | inout | ) |

Unescapes percent-encoded groups in a given string. E.g. "%20" will become " ". Unescaping is done in place. The return value will be point to the new position of the terminating zero. Use this value to get the new length of the string. NULL is only returned if `inout` is NULL.

NOTE: '+' is not decoded to ' ' and line breaks are not converted. Use the more advanced UnescapeInPlaceEx for that features instead.

Parameters

  inout | INOUT: Text to unescape/decode

Returns
  Pointer to new position of the terminating zero

See also
  uriUnescapeInPlaceExA
  uriEscapeA

Since
  0.3.0

## uriUnescapeInPlaceExA()

const char * uriUnescapeInPlaceExA | ( | char * | inout,
|  | UriBool | plusToSpace,
|  | UriBreakConversion | breakConversion )

Unescapes percent-encoded groups in a given string. E.g. "%20" will become " ". Unescaping is done in place. The return value will be point to the new position of the terminating zero. Use this value to get the new length of the string. NULL is only returned if `inout` is NULL.

Parameters

  inout | INOUT: Text to unescape/decode
  plusToSpace | IN: Whether to convert '+' to ' ' or not
  breakConversion | IN: Line break conversion mode

Returns
  Pointer to new position of the terminating zero

See also
  uriUnescapeInPlaceA
  uriEscapeExA

Since
  0.5.0

## uriUnixFilenameToUriStringA()

int uriUnixFilenameToUriStringA | ( | const char * | filename,
|  | char * | uriString )

Converts a Unix filename to a URI string. The destination buffer must be large enough to hold 7 + 3 * len(filename) + 1 characters in case of an absolute filename or 3 * len(filename) + 1 in case of a relative filename.

EXAMPLE Input: "/bin/bash" Output: "file:///bin/bash"

Parameters

  filename | IN: Unix filename to convert
  uriString | OUT: Destination to write URI string to

Returns
  Error code or 0 on success

See also
  uriUriStringToUnixFilenameA
  uriWindowsFilenameToUriStringA

Since
  0.5.2

## uriUriStringToUnixFilenameA()

int uriUriStringToUnixFilenameA | ( | const char * | uriString,
|  | char * | filename )

Extracts a Unix filename from a URI string. The destination buffer must be large enough to hold len(uriString) + 1 - 5 characters in case of an absolute URI or len(uriString) + 1 in case of a relative URI.

Parameters

  uriString | IN: URI string to convert
  filename | OUT: Destination to write filename to

Returns
  Error code or 0 on success

See also
  uriUnixFilenameToUriStringA
  uriUriStringToWindowsFilenameA

Since
  0.5.2

## uriUriStringToWindowsFilenameA()

int uriUriStringToWindowsFilenameA | ( | const char * | uriString,
|  | char * | filename )

Extracts a Windows filename from a URI string. The destination buffer must be large enough to hold len(uriString) + 1 - 5 characters in case of an absolute URI or len(uriString) + 1 in case of a relative URI.

Parameters

  uriString | IN: URI string to convert
  filename | OUT: Destination to write filename to

Returns
  Error code or 0 on success

See also
  uriWindowsFilenameToUriStringA
  uriUriStringToUnixFilenameA

Since
  0.5.2

## uriWindowsFilenameToUriStringA()

int uriWindowsFilenameToUriStringA | ( | const char * | filename,
|  | char * | uriString )

Converts a Windows filename to a URI string. The destination buffer must be large enough to hold 8 + 3 * len(filename) + 1 characters in case of an absolute filename or 3 * len(filename) + 1 in case of a relative filename.

EXAMPLE Input: "E:\\Documents and Settings" Output: "file:///E:/Documents%20and%20Settings"

Parameters

  filename | IN: Windows filename to convert
  uriString | OUT: Destination to write URI string to

Returns
  Error code or 0 on success

See also
  uriUriStringToWindowsFilenameA
  uriUnixFilenameToUriStringA

Since
  0.5.2