Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
22fe2438
Commit
22fe2438
authored
May 24, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify, fix and inline strcasecmp and strncasecmp
parent
05cfa654
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
52 deletions
+20
-52
include/vlc_common.h
include/vlc_common.h
+0
-2
include/vlc_fixups.h
include/vlc_fixups.h
+20
-2
src/extras/libc.c
src/extras/libc.c
+0
-46
src/libvlccore.sym
src/libvlccore.sym
+0
-2
No files found.
include/vlc_common.h
View file @
22fe2438
...
@@ -728,8 +728,6 @@ struct dirent;
...
@@ -728,8 +728,6 @@ struct dirent;
VLC_EXPORT
(
int
,
vlc_scandir
,
(
const
char
*
name
,
struct
dirent
***
namelist
,
int
(
*
filter
)
(
const
struct
dirent
*
),
int
(
*
compar
)
(
const
struct
dirent
**
,
const
struct
dirent
**
)
)
);
VLC_EXPORT
(
int
,
vlc_scandir
,
(
const
char
*
name
,
struct
dirent
***
namelist
,
int
(
*
filter
)
(
const
struct
dirent
*
),
int
(
*
compar
)
(
const
struct
dirent
**
,
const
struct
dirent
**
)
)
);
VLC_EXPORT
(
int
,
vlc_alphasort
,
(
const
struct
dirent
**
a
,
const
struct
dirent
**
b
)
);
VLC_EXPORT
(
int
,
vlc_alphasort
,
(
const
struct
dirent
**
a
,
const
struct
dirent
**
b
)
);
VLC_EXPORT
(
int
,
vlc_strcasecmp
,
(
const
char
*
s1
,
const
char
*
s2
)
);
VLC_EXPORT
(
int
,
vlc_strncasecmp
,
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
);
VLC_EXPORT
(
char
*
,
vlc_strcasestr
,
(
const
char
*
s1
,
const
char
*
s2
)
);
VLC_EXPORT
(
char
*
,
vlc_strcasestr
,
(
const
char
*
s1
,
const
char
*
s2
)
);
#if defined(WIN32) || defined(UNDER_CE)
#if defined(WIN32) || defined(UNDER_CE)
...
...
include/vlc_fixups.h
View file @
22fe2438
...
@@ -117,7 +117,16 @@ static inline getenv (const char *name)
...
@@ -117,7 +117,16 @@ static inline getenv (const char *name)
#ifndef HAVE_STRCASECMP
#ifndef HAVE_STRCASECMP
# ifndef HAVE_STRICMP
# ifndef HAVE_STRICMP
# define strcasecmp vlc_strcasecmp
# include <ctype.h>
static
inline
int
strcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
for
(
size_t
i
=
0
;;
i
++
)
{
int
d
=
tolower
(
s1
[
i
])
-
tolower
(
s2
[
i
]);
if
(
d
)
return
d
;
}
return
0
;
}
# else
# else
# define strcasecmp stricmp
# define strcasecmp stricmp
# endif
# endif
...
@@ -125,7 +134,16 @@ static inline getenv (const char *name)
...
@@ -125,7 +134,16 @@ static inline getenv (const char *name)
#ifndef HAVE_STRNCASECMP
#ifndef HAVE_STRNCASECMP
# ifndef HAVE_STRNICMP
# ifndef HAVE_STRNICMP
# define strncasecmp vlc_strncasecmp
# include <ctype.h>
static
inline
int
strncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
for
(
size_t
i
=
0
;
i
<
n
;
i
++
)
{
int
d
=
tolower
(
s1
[
i
])
-
tolower
(
s2
[
i
]);
if
(
d
)
return
d
;
}
return
0
;
}
# else
# else
# define strncasecmp strnicmp
# define strncasecmp strnicmp
# endif
# endif
...
...
src/extras/libc.c
View file @
22fe2438
...
@@ -74,52 +74,6 @@
...
@@ -74,52 +74,6 @@
# define strcoll strcmp
# define strcoll strcmp
#endif
#endif
/*****************************************************************************
* strcasecmp: compare two strings ignoring case
*****************************************************************************/
#if !defined( HAVE_STRCASECMP ) && !defined( HAVE_STRICMP )
int
vlc_strcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
int
c1
,
c2
;
if
(
!
s1
||
!
s2
)
return
-
1
;
while
(
*
s1
&&
*
s2
)
{
c1
=
tolower
(
*
s1
);
c2
=
tolower
(
*
s2
);
if
(
c1
!=
c2
)
return
(
c1
<
c2
?
-
1
:
1
);
s1
++
;
s2
++
;
}
if
(
!*
s1
&&
!*
s2
)
return
0
;
else
return
(
*
s1
?
1
:
-
1
);
}
#endif
/*****************************************************************************
* strncasecmp: compare n chars from two strings ignoring case
*****************************************************************************/
#if !defined( HAVE_STRNCASECMP ) && !defined( HAVE_STRNICMP )
int
vlc_strncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
int
c1
,
c2
;
if
(
!
s1
||
!
s2
)
return
-
1
;
while
(
n
>
0
&&
*
s1
&&
*
s2
)
{
c1
=
tolower
(
*
s1
);
c2
=
tolower
(
*
s2
);
if
(
c1
!=
c2
)
return
(
c1
<
c2
?
-
1
:
1
);
s1
++
;
s2
++
;
n
--
;
}
if
(
!
n
||
(
!*
s1
&&
!*
s2
)
)
return
0
;
else
return
(
*
s1
?
1
:
-
1
);
}
#endif
/******************************************************************************
/******************************************************************************
* strcasestr: find a substring (little) in another substring (big)
* strcasestr: find a substring (little) in another substring (big)
* Case sensitive. Return NULL if not found, return big if little == null
* Case sensitive. Return NULL if not found, return big if little == null
...
...
src/libvlccore.sym
View file @
22fe2438
...
@@ -438,10 +438,8 @@ vlc_recvmsg
...
@@ -438,10 +438,8 @@ vlc_recvmsg
vlc_scandir
vlc_scandir
vlc_sdp_Start
vlc_sdp_Start
vlc_sendmsg
vlc_sendmsg
vlc_strcasecmp
vlc_strcasestr
vlc_strcasestr
vlc_strlcpy
vlc_strlcpy
vlc_strncasecmp
vlc_strtoll
vlc_strtoll
vlc_submodule_create
vlc_submodule_create
__vlc_thread_create
__vlc_thread_create
...
...
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