Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
67386352
Commit
67386352
authored
Dec 22, 2006
by
Duane Clark
Committed by
Alexandre Julliard
Dec 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add function _mbsspnp.
parent
ce5fb9bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
mbcs.c
dlls/msvcrt/mbcs.c
+34
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+19
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
67386352
...
...
@@ -1196,6 +1196,40 @@ MSVCRT_size_t CDECL _mbsspn(const unsigned char* string, const unsigned char* se
}
/*********************************************************************
* _mbsspnp (MSVCRT.@)
*/
const
unsigned
char
*
CDECL
_mbsspnp
(
const
unsigned
char
*
string
,
const
unsigned
char
*
set
)
{
const
unsigned
char
*
p
,
*
q
;
for
(
p
=
string
;
*
p
;
p
++
)
{
if
(
MSVCRT_isleadbyte
(
*
p
))
{
for
(
q
=
set
;
*
q
;
q
++
)
{
if
(
!
q
[
1
])
break
;
if
((
*
p
==
*
q
)
&&
(
p
[
1
]
==
q
[
1
]))
break
;
q
++
;
}
if
(
!
q
[
0
]
||
!
q
[
1
])
break
;
}
else
{
for
(
q
=
set
;
*
q
;
q
++
)
if
(
*
p
==
*
q
)
break
;
if
(
!*
q
)
break
;
}
}
if
(
*
p
==
'\0'
)
return
NULL
;
return
p
;
}
/*********************************************************************
* _mbscspn(MSVCRT.@)
*/
MSVCRT_size_t
CDECL
_mbscspn
(
const
unsigned
char
*
str
,
const
unsigned
char
*
cmp
)
...
...
dlls/msvcrt/msvcrt.spec
View file @
67386352
...
...
@@ -386,7 +386,7 @@
@ cdecl _mbsrev(str)
@ cdecl _mbsset(str long)
@ cdecl _mbsspn(str str)
@
stub _mbsspnp #
(str str)
@
cdecl _mbsspnp
(str str)
@ cdecl _mbsstr(str str)
@ cdecl _mbstok(str str)
@ cdecl _mbstrlen(str)
...
...
dlls/msvcrt/tests/string.c
View file @
67386352
...
...
@@ -99,6 +99,24 @@ static void test_mbsspn( void)
ok
(
ret
==
0
,
"_mbsspn returns %d should be 0
\n
"
,
ret
);
}
static
void
test_mbsspnp
(
void
)
{
unsigned
char
str1
[]
=
"cabernet"
;
unsigned
char
str2
[]
=
"shiraz"
;
unsigned
char
set
[]
=
"abc"
;
unsigned
char
empty
[]
=
""
;
unsigned
char
full
[]
=
"abcenrt"
;
unsigned
char
*
ret
;
ret
=
_mbsspnp
(
str1
,
set
);
ok
(
ret
[
0
]
==
'e'
,
"_mbsspnp returns %c should be e
\n
"
,
ret
[
0
]);
ret
=
_mbsspnp
(
str2
,
set
);
ok
(
ret
[
0
]
==
's'
,
"_mbsspnp returns %c should be s
\n
"
,
ret
[
0
]);
ret
=
_mbsspnp
(
str1
,
empty
);
ok
(
ret
[
0
]
==
'c'
,
"_mbsspnp returns %c should be c
\n
"
,
ret
[
0
]);
ret
=
_mbsspnp
(
str1
,
full
);
ok
(
ret
==
NULL
,
"_mbsspnp returns %p should be NULL
\n
"
,
ret
);
}
static
void
test_strdup
(
void
)
{
char
*
str
;
...
...
@@ -138,6 +156,7 @@ START_TEST(string)
test_ismbblead
();
/* test _mbsspn */
test_mbsspn
();
test_mbsspnp
();
/* test _strdup */
test_strdup
();
}
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