Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
5d3ffa0e
Commit
5d3ffa0e
authored
Jan 12, 2011
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add us_vasprintf() function
For use within already variadic functions
parent
888f4987
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
include/vlc_charset.h
include/vlc_charset.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/text/charset.c
src/text/charset.c
+20
-7
No files found.
include/vlc_charset.h
View file @
5d3ffa0e
...
...
@@ -114,6 +114,7 @@ VLC_EXPORT( void *, ToCharset, ( const char *charset, const char *in, size_t *ou
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
src/libvlccore.sym
View file @
5d3ffa0e
...
...
@@ -453,6 +453,7 @@ us_asprintf
us_atof
us_strtod
us_strtof
us_vasprintf
vlc_fopen
utf8_fprintf
vlc_loaddir
...
...
src/text/charset.c
View file @
5d3ffa0e
...
...
@@ -92,19 +92,15 @@ double us_atof( const char *str )
/**
* us_
asprintf() has the same prototype as
asprintf(), but doesn't use
* us_
vasprintf() has the same prototype as v
asprintf(), 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
)
{
...
...
@@ -114,3 +110,20 @@ int us_asprintf( char **ret, const char *format, ... )
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment