Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
e2123909
Commit
e2123909
authored
Sep 03, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented strsep replacement.
parent
bbebf410
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
include/vlc_common.h
include/vlc_common.h
+1
-0
include/vlc_fixups.h
include/vlc_fixups.h
+4
-0
src/extras/libc.c
src/extras/libc.c
+22
-0
No files found.
include/vlc_common.h
View file @
e2123909
...
@@ -755,6 +755,7 @@ VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) );
...
@@ -755,6 +755,7 @@ VLC_EXPORT( size_t, vlc_strlcpy, ( char *, const char *, size_t ) );
VLC_EXPORT
(
long
long
,
vlc_strtoll
,
(
const
char
*
nptr
,
char
**
endptr
,
int
base
)
);
VLC_EXPORT
(
long
long
,
vlc_strtoll
,
(
const
char
*
nptr
,
char
**
endptr
,
int
base
)
);
VLC_EXPORT
(
char
*
,
vlc_strcasestr
,
(
const
char
*
s1
,
const
char
*
s2
)
);
VLC_EXPORT
(
char
*
,
vlc_strcasestr
,
(
const
char
*
s1
,
const
char
*
s2
)
);
VLC_EXPORT
(
char
*
,
vlc_strsep
,
(
char
**
,
const
char
*
)
);
#if defined(WIN32) || defined(UNDER_CE)
#if defined(WIN32) || defined(UNDER_CE)
/* win32, cl and icl support */
/* win32, cl and icl support */
...
...
include/vlc_fixups.h
View file @
e2123909
...
@@ -108,6 +108,10 @@ static inline char *strndup (const char *str, size_t max)
...
@@ -108,6 +108,10 @@ static inline char *strndup (const char *str, size_t max)
# define strtoll vlc_strtoll
# define strtoll vlc_strtoll
#endif
#endif
#ifndef HAVE_STRSEP
# define strsep vlc_strsep
#endif
#ifndef HAVE_ATOLL
#ifndef HAVE_ATOLL
# define atoll( str ) (strtoll ((str), (char **)NULL, 10))
# define atoll( str ) (strtoll ((str), (char **)NULL, 10))
#endif
#endif
...
...
src/extras/libc.c
View file @
e2123909
...
@@ -208,6 +208,28 @@ extern size_t vlc_strlcpy (char *tgt, const char *src, size_t bufsize)
...
@@ -208,6 +208,28 @@ extern size_t vlc_strlcpy (char *tgt, const char *src, size_t bufsize)
#endif
#endif
}
}
/**
* Extract a token from string.
* It is a replacement for strsep if not present.
*/
char
*
vlc_strsep
(
char
**
ppsz_string
,
const
char
*
psz_delimiters
)
{
char
*
psz_string
=
*
ppsz_string
;
if
(
!
psz_string
)
return
NULL
;
char
*
p
=
strpbrk
(
psz_string
,
psz_delimiters
);
if
(
!
p
)
{
*
ppsz_string
=
NULL
;
return
psz_string
;
}
*
p
++
=
'\0'
;
*
ppsz_string
=
p
;
return
psz_string
;
}
/*****************************************************************************
/*****************************************************************************
* vlc_*dir_wrapper: wrapper under Windows to return the list of drive letters
* vlc_*dir_wrapper: wrapper under Windows to return the list of drive letters
* when called with an empty argument or just '\'
* when called with an empty argument or just '\'
...
...
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