Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0d4a5580
Commit
0d4a5580
authored
Jun 13, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a couple of Unicode string routines.
parent
9c51c96c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
9 deletions
+55
-9
unicode.h
include/wine/unicode.h
+16
-9
Makefile.in
unicode/Makefile.in
+1
-0
string.c
unicode/string.c
+38
-0
No files found.
include/wine/unicode.h
View file @
0d4a5580
...
...
@@ -118,7 +118,7 @@ static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 )
static
inline
int
strncmpW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
,
int
n
)
{
if
(
!
n
)
return
0
;
if
(
n
<=
0
)
return
0
;
while
((
--
n
>
0
)
&&
*
str1
&&
(
*
str1
==
*
str2
))
{
str1
++
;
str2
++
;
}
return
*
str1
-
*
str2
;
}
...
...
@@ -135,15 +135,22 @@ static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch )
return
NULL
;
}
static
inline
int
strcmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
)
static
inline
WCHAR
*
strlwrW
(
WCHAR
*
str
)
{
for
(;;)
{
int
ret
=
toupperW
(
*
str1
)
-
toupperW
(
*
str2
);
if
(
ret
||
!*
str1
)
return
ret
;
str1
++
;
str2
++
;
}
WCHAR
*
ret
=
str
;
while
((
*
str
=
tolowerW
(
*
str
)))
str
++
;
return
ret
;
}
static
inline
WCHAR
*
struprW
(
WCHAR
*
str
)
{
WCHAR
*
ret
=
str
;
while
((
*
str
=
toupperW
(
*
str
)))
str
++
;
return
ret
;
}
extern
int
strcmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
);
extern
int
strncmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
,
int
n
);
extern
WCHAR
*
strstrW
(
const
WCHAR
*
str
,
const
WCHAR
*
sub
);
#endif
/* __WINE_UNICODE_H */
unicode/Makefile.in
View file @
0d4a5580
...
...
@@ -65,6 +65,7 @@ C_SRCS = \
casemap.c
\
cptable.c
\
mbtowc.c
\
string.c
\
wctomb.c
\
$
(
CODEPAGES:%
=
c_%.c
)
...
...
unicode/string.c
0 → 100644
View file @
0d4a5580
/*
* Unicode string manipulation functions
*
* Copyright 2000 Alexandre Julliard
*/
#include "wine/unicode.h"
int
strcmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
)
{
for
(;;)
{
int
ret
=
toupperW
(
*
str1
)
-
toupperW
(
*
str2
);
if
(
ret
||
!*
str1
)
return
ret
;
str1
++
;
str2
++
;
}
}
int
strncmpiW
(
const
WCHAR
*
str1
,
const
WCHAR
*
str2
,
int
n
)
{
int
ret
=
0
;
for
(
;
n
>
0
;
n
--
,
str1
++
,
str2
++
)
if
((
ret
=
toupperW
(
*
str1
)
-
toupperW
(
*
str2
))
||
!*
str1
)
break
;
return
ret
;
}
WCHAR
*
strstrW
(
const
WCHAR
*
str
,
const
WCHAR
*
sub
)
{
while
(
*
str
)
{
const
WCHAR
*
p1
=
str
,
*
p2
=
sub
;
while
(
*
p1
&&
*
p2
&&
*
p1
==
*
p2
)
{
p1
++
;
p2
++
;
}
if
(
!*
p2
)
return
(
WCHAR
*
)
str
;
str
++
;
}
return
NULL
;
}
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