VLC  3.0.15
Files | Functions
String helpers

Files

file  vlc_charset.h
 
file  vlc_strings.h
 
file  vlc_url.h
 

Functions

static int vlc_ascii_toupper (int c)
 
static int vlc_ascii_tolower (int c)
 
static int vlc_ascii_strcasecmp (const char *psz1, const char *psz2)
 Compare two ASCII strings ignoring case. More...
 
static int vlc_ascii_strncasecmp (const char *psz1, const char *psz2, size_t n)
 
void vlc_xml_decode (char *st)
 Decodes XML entities. More...
 
char * vlc_xml_encode (const char *str)
 Encodes XML entites. More...
 
char * vlc_b64_encode_binary (const uint8_t *, size_t)
 
char * vlc_b64_encode (const char *)
 
size_t vlc_b64_decode_binary_to_buffer (uint8_t *p_dst, size_t i_dst_max, const char *psz_src)
 
size_t vlc_b64_decode_binary (uint8_t **pp_dst, const char *psz_src)
 
char * vlc_b64_decode (const char *psz_src)
 
char * vlc_strftime (const char *)
 Convenience wrapper for strftime(). More...
 
char * vlc_strfinput (input_thread_t *, const char *)
 Formats input meta-data. More...
 
static char * str_format (input_thread_t *input, const char *fmt)
 
int vlc_filenamecmp (const char *, const char *)
 
void filename_sanitize (char *)
 Sanitize a file name. More...
 

Detailed Description

Function Documentation

◆ filename_sanitize()

void filename_sanitize ( char *  str)

Sanitize a file name.

Remove forbidden, potentially forbidden and otherwise evil characters from file names. That includes slashes, and popular characters like colon (on Unix anyway).

Warning
This function should only be used for automatically generated file names. Do not use this on full paths, only single file names without any directory separator!

References EnsureUTF8().

Referenced by ArtCacheGetDirPath(), ArtCacheName(), and vout_snapshot_SaveImage().

◆ str_format()

static char* str_format ( input_thread_t input,
const char *  fmt 
)
inlinestatic

References vlc_strfinput(), and vlc_strftime().

Referenced by vout_snapshot_SaveImage().

◆ vlc_ascii_strcasecmp()

static int vlc_ascii_strcasecmp ( const char *  psz1,
const char *  psz2 
)
inlinestatic

Compare two ASCII strings ignoring case.

The result is independent of the locale. If there are non-ASCII characters in the strings, their cases are NOT ignored in the comparison.

References vlc_ascii_tolower().

Referenced by cookie_domain_matches(), demux_mapping_cmp(), vlc_http_cookies_store(), vlc_http_res_get_redirect(), and vlc_http_res_init().

◆ vlc_ascii_strncasecmp()

static int vlc_ascii_strncasecmp ( const char *  psz1,
const char *  psz2,
size_t  n 
)
inlinestatic

◆ vlc_ascii_tolower()

static int vlc_ascii_tolower ( int  c)
inlinestatic

◆ vlc_ascii_toupper()

static int vlc_ascii_toupper ( int  c)
inlinestatic

◆ vlc_b64_decode()

char* vlc_b64_decode ( const char *  psz_src)

◆ vlc_b64_decode_binary()

size_t vlc_b64_decode_binary ( uint8_t **  pp_dst,
const char *  psz_src 
)

◆ vlc_b64_decode_binary_to_buffer()

size_t vlc_b64_decode_binary_to_buffer ( uint8_t *  p_dst,
size_t  i_dst_max,
const char *  psz_src 
)

References p.

Referenced by pgp_unarmor().

◆ vlc_b64_encode()

char* vlc_b64_encode ( const char *  )

◆ vlc_b64_encode_binary()

char* vlc_b64_encode_binary ( const uint8_t *  ,
size_t   
)

◆ vlc_filenamecmp()

int vlc_filenamecmp ( const char *  ,
const char *   
)

Referenced by rdh_compar_filename().

◆ vlc_strfinput()

char* vlc_strfinput ( input_thread_t ,
const char *   
)

Formats input meta-data.

Formats input and input item meta-informations into a heap-allocated string.

Referenced by str_format().

◆ vlc_strftime()

char* vlc_strftime ( const char *  )

Convenience wrapper for strftime().

Formats the current time into a heap-allocated string.

Parameters
tformattime format (as with C strftime())
Returns
an allocated string (must be free()'d), or NULL on memory error.

Referenced by str_format().

◆ vlc_xml_decode()

void vlc_xml_decode ( char *  st)

Decodes XML entities.

Decodes a null-terminated UTF-8 string of XML character data into a regular nul-terminated UTF-8 string. In other words, replaces XML entities and numerical character references with the corresponding characters.

This function operates in place (the output is always of smaller or equal length than the input) and always succeeds.

Parameters
strnull-terminated string [IN/OUT]

◆ vlc_xml_encode()

char* vlc_xml_encode ( const char *  str)

Encodes XML entites.

Substitutes unsafe characters in a null-terminated UTF-8 strings with an XML entity or numerical character reference.

Parameters
strnull terminated UTF-8 string
Returns
On success, a heap-allocated null-terminated string is returned. If the input string was not a valid UTF-8 sequence, NULL is returned and errno is set to EILSEQ. If there was not enough memory, NULL is returned and errno is to ENOMEM.

Referenced by httpd_HtmlError().