FFmpeg
Functions
urldecode.h File Reference
#include <stddef.h>

Go to the source code of this file.

Functions

char * ff_urldecode (const char *url, int decode_plus_sign)
 Decodes an URL from its percent-encoded form back into normal representation. More...
 
int ff_urldecode_len (char *dest, size_t dest_len, const char *url, size_t url_max_len, int decode_plus_sign)
 Decodes an URL from its percent-encoded form back into normal representation. More...
 

Function Documentation

◆ ff_urldecode()

char* ff_urldecode ( const char *  url,
int  decode_plus_sign 
)

Decodes an URL from its percent-encoded form back into normal representation.

This function returns the decoded URL in a string. The URL to be decoded does not necessarily have to be encoded but in that case the original string is duplicated.

Parameters
urla string to be decoded.
decode_plus_signif nonzero plus sign is decoded to space
Returns
new string with the URL decoded or NULL if decoding failed. Note that the returned string should be explicitly freed when not used anymore.

Definition at line 80 of file urldecode.c.

Referenced by amqp_proto_open(), ff_http_auth_create_response(), and ftp_connect().

◆ ff_urldecode_len()

int ff_urldecode_len ( char *  dest,
size_t  dest_len,
const char *  url,
size_t  url_max_len,
int  decode_plus_sign 
)

Decodes an URL from its percent-encoded form back into normal representation.

This function returns the decoded URL in a string. The URL to be decoded does not necessarily have to be encoded but in that case the original string is duplicated.

Parameters
destthe destination buffer.
dest_lenthe maximum available space in the destination buffer. Must be bigger than FFMIN(strlen(url), url_max_len) to avoid an AVERROR(EINVAL) result
url_max_lenthe maximum number of chars to read from url
decode_plus_signif nonzero plus sign is decoded to space
Returns
the number of written bytes to dest excluding the zero terminator, negative on error

Definition at line 99 of file urldecode.c.

Referenced by ff_parse_opts_from_query_string(), and find_opt().