VLC_EXPORT( double, us_strtod, ( const char *, char ** ) LIBVLC_USED );
VLC_EXPORT( float, us_strtof, ( const char *, char ** ) LIBVLC_USED );
VLC_EXPORT( double, us_atof, ( const char * ) LIBVLC_USED );
+VLC_EXPORT( int, us_vasprintf, ( char **, const char *, va_list ) );
VLC_EXPORT( int, us_asprintf, ( char **, const char *, ... ) LIBVLC_USED );
#endif
/**
- * us_asprintf() has the same prototype as asprintf(), but doesn't use
+ * us_vasprintf() has the same prototype as vasprintf(), but doesn't use
* the system locale.
*/
-int us_asprintf( char **ret, const char *format, ... )
+int us_vasprintf( char **ret, const char *format, va_list ap )
{
- va_list ap;
locale_t loc = newlocale( LC_NUMERIC_MASK, "C", NULL );
locale_t oldloc = uselocale( loc );
- int i_rc;
- va_start( ap, format );
- i_rc = vasprintf( ret, format, ap );
- va_end( ap );
+ int i_rc = vasprintf( ret, format, ap );
if ( loc != (locale_t)0 )
{
return i_rc;
}
+
+
+/**
+ * us_asprintf() has the same prototype as asprintf(), but doesn't use
+ * the system locale.
+ */
+int us_asprintf( char **ret, const char *format, ... )
+{
+ va_list ap;
+ int i_rc;
+
+ va_start( ap, format );
+ i_rc = us_vasprintf( ret, format, ap );
+ va_end( ap );
+
+ return i_rc;
+}