VLC 4.0.0-dev
Collaboration diagram for C/POSIX locale functions:

Functions

double vlc_strtod_c (const char *restrict str, char **restrict end)
 Parses a double in C locale. More...
 
float vlc_strtof_c (const char *restrict str, char **restrict end)
 Parses a float in C locale. More...
 
static double vlc_atof_c (const char *str)
 Parses a double in C locale. More...
 
int vlc_vasprintf_c (char **restrict p, const char *restrict fmt, va_list ap)
 Formats a string using the C locale. More...
 
int vlc_asprintf_c (char **, const char *,...)
 Formats a string using the C locale. More...
 
int vlc_vsscanf_c (const char *, const char *, va_list)
 
int vlc_sscanf_c (const char *, const char *,...)
 

Detailed Description

Function Documentation

◆ vlc_asprintf_c()

int vlc_asprintf_c ( char **  ,
const char *  ,
  ... 
)

Formats a string using the C locale.

This function formats a string from a format string and a variable argument list, just like the standard vasprintf() but using the C locale for the formatting of numerals.

Parameters
[out]pstorage space for a pointer to the heap-allocated formatted string (undefined on error)
fmtformat string
Returns
number of bytes formatted (excluding the nul terminator) or -1 on error

◆ vlc_atof_c()

static double vlc_atof_c ( const char *  str)
inlinestatic

Parses a double in C locale.

This function parses a double-precision floating point number from a string just like the standard atof() but it uses the C locale. In other words, it expects the POSIX/C/American decimal format regardless of the current numeric locale.

Parameters
strnul-terminated string to parse
Returns
the parsed double value (zero if no character could be parsed)

References vlc_strtod_c().

Referenced by config_ChainParse(), config_LoadCmdLine(), var_OptionParse(), and vlc_audio_replay_gain_MergeFromMeta().

◆ vlc_sscanf_c()

int vlc_sscanf_c ( const char *  ,
const char *  ,
  ... 
)

◆ vlc_strtod_c()

double vlc_strtod_c ( const char *restrict  str,
char **restrict  end 
)

Parses a double in C locale.

This function parses a double-precision floating point number from a string just like the standard strtod() but it uses the C locale. In other words, it expects the POSIX/C/American decimal format regardless of the current numeric locale.

Parameters
strnul-terminated string to parse
[out]endstorage space for a pointer to the first unparsed byte (or NULL to discard it)
Returns
the parsed double value (zero if no character could be parsed)

References freelocale(), LC_NUMERIC_MASK, newlocale(), and uselocale().

Referenced by vlc_atof_c().

◆ vlc_strtof_c()

float vlc_strtof_c ( const char *restrict  str,
char **restrict  end 
)

Parses a float in C locale.

This function parses a single-precision floating point number from a string just like the standard strtof() but it uses the C locale. In other words, it expects the POSIX/C/American decimal format regardless of the current numeric locale.

Parameters
strnul-terminated string to parse
[out]endstorage space for a pointer to the first unparsed byte (or NULL to discard it)
Returns
the parsed double value (zero if no character could be parsed)

References freelocale(), LC_NUMERIC_MASK, newlocale(), strtof(), and uselocale().

◆ vlc_vasprintf_c()

int vlc_vasprintf_c ( char **restrict  p,
const char *restrict  fmt,
va_list  ap 
)

Formats a string using the C locale.

This function formats a string from a format string and a variable argument list, just like the standard vasprintf() but using the C locale for the formatting of numerals.

Parameters
[out]pstorage space for a pointer to the heap-allocated formatted string (undefined on error)
fmtformat string
apvariable argument list
Returns
number of bytes formatted (excluding the nul terminator) or -1 on error

References freelocale(), LC_NUMERIC_MASK, newlocale(), uselocale(), and vasprintf().

Referenced by httpd_MsgAdd(), and vlc_asprintf_c().

◆ vlc_vsscanf_c()

int vlc_vsscanf_c ( const char *  ,
const char *  ,
va_list   
)