Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
ba04ecfd
Commit
ba04ecfd
authored
Nov 05, 2011
by
Reimar Döffinger
Committed by
Martin Storsjö
Nov 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avstring: Add locale independent implementations of strcasecmp/strncasecmp
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
07b172fe
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
1 deletion
+37
-1
APIchanges
doc/APIchanges
+3
-0
avstring.c
libavutil/avstring.c
+21
-0
avstring.h
libavutil/avstring.h
+12
-0
avutil.h
libavutil/avutil.h
+1
-1
No files found.
doc/APIchanges
View file @
ba04ecfd
...
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2011-11-xx - xxxxxxx - lavu 51.14.0
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
2011-11-xx - xxxxxxx - lavu 51.13.0
Add av_toupper()/av_tolower()
...
...
libavutil/avstring.c
View file @
ba04ecfd
...
...
@@ -134,6 +134,27 @@ char *av_get_token(const char **buf, const char *term)
return
ret
;
}
int
av_strcasecmp
(
const
char
*
a
,
const
char
*
b
)
{
uint8_t
c1
,
c2
;
do
{
c1
=
av_tolower
(
*
a
++
);
c2
=
av_tolower
(
*
b
++
);
}
while
(
c1
&&
c1
==
c2
);
return
c1
-
c2
;
}
int
av_strncasecmp
(
const
char
*
a
,
const
char
*
b
,
size_t
n
)
{
const
char
*
end
=
a
+
n
;
uint8_t
c1
,
c2
;
do
{
c1
=
av_tolower
(
*
a
++
);
c2
=
av_tolower
(
*
b
++
);
}
while
(
a
<
end
&&
c1
&&
c1
==
c2
);
return
c1
-
c2
;
}
#ifdef TEST
#undef printf
...
...
libavutil/avstring.h
View file @
ba04ecfd
...
...
@@ -151,4 +151,16 @@ static inline int av_tolower(int c)
return
c
;
}
/*
* Locale independent case-insensitive compare.
* Note: This means only ASCII-range characters are case-insensitive
*/
int
av_strcasecmp
(
const
char
*
a
,
const
char
*
b
);
/**
* Locale independent case-insensitive compare.
* Note: This means only ASCII-range characters are case-insensitive
*/
int
av_strncasecmp
(
const
char
*
a
,
const
char
*
b
,
size_t
n
);
#endif
/* AVUTIL_AVSTRING_H */
libavutil/avutil.h
View file @
ba04ecfd
...
...
@@ -40,7 +40,7 @@
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 1
3
#define LIBAVUTIL_VERSION_MINOR 1
4
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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