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
3b1186de
Commit
3b1186de
authored
Oct 07, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Move the 16-bit string functions to kernel16.c.
parent
bf0ffb2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
145 deletions
+129
-145
kernel16.c
dlls/kernel32/kernel16.c
+129
-0
string.c
dlls/kernel32/string.c
+0
-145
No files found.
dlls/kernel32/kernel16.c
View file @
3b1186de
...
...
@@ -86,6 +86,135 @@ BOOL WINAPI KERNEL_DllEntryPoint( DWORD reasion, HINSTANCE16 inst, WORD ds,
}
/***********************************************************************
* Reserved1 (KERNEL.77)
*/
SEGPTR
WINAPI
KERNEL_AnsiNext16
(
SEGPTR
current
)
{
return
(
*
(
char
*
)
MapSL
(
current
))
?
current
+
1
:
current
;
}
/***********************************************************************
* Reserved2(KERNEL.78)
*/
SEGPTR
WINAPI
KERNEL_AnsiPrev16
(
SEGPTR
start
,
SEGPTR
current
)
{
return
(
current
==
start
)
?
start
:
current
-
1
;
}
/***********************************************************************
* Reserved3 (KERNEL.79)
*/
SEGPTR
WINAPI
KERNEL_AnsiUpper16
(
SEGPTR
strOrChar
)
{
/* uppercase only one char if strOrChar < 0x10000 */
if
(
HIWORD
(
strOrChar
))
{
char
*
s
=
MapSL
(
strOrChar
);
while
(
*
s
)
{
*
s
=
toupper
(
*
s
);
s
++
;
}
return
strOrChar
;
}
else
return
toupper
((
char
)
strOrChar
);
}
/***********************************************************************
* Reserved4 (KERNEL.80)
*/
SEGPTR
WINAPI
KERNEL_AnsiLower16
(
SEGPTR
strOrChar
)
{
/* lowercase only one char if strOrChar < 0x10000 */
if
(
HIWORD
(
strOrChar
))
{
char
*
s
=
MapSL
(
strOrChar
);
while
(
*
s
)
{
*
s
=
tolower
(
*
s
);
s
++
;
}
return
strOrChar
;
}
else
return
tolower
((
char
)
strOrChar
);
}
/***********************************************************************
* Reserved5 (KERNEL.87)
*/
INT16
WINAPI
KERNEL_lstrcmp16
(
LPCSTR
str1
,
LPCSTR
str2
)
{
return
(
INT16
)
strcmp
(
str1
,
str2
);
}
/***********************************************************************
* lstrcpy (KERNEL.88)
*/
SEGPTR
WINAPI
lstrcpy16
(
SEGPTR
dst
,
LPCSTR
src
)
{
if
(
!
lstrcpyA
(
MapSL
(
dst
),
src
))
dst
=
0
;
return
dst
;
}
/***********************************************************************
* lstrcat (KERNEL.89)
*/
SEGPTR
WINAPI
lstrcat16
(
SEGPTR
dst
,
LPCSTR
src
)
{
/* Windows does not check for NULL pointers here, so we don't either */
strcat
(
MapSL
(
dst
),
src
);
return
dst
;
}
/***********************************************************************
* lstrlen (KERNEL.90)
*/
INT16
WINAPI
lstrlen16
(
LPCSTR
str
)
{
return
(
INT16
)
lstrlenA
(
str
);
}
/***********************************************************************
* hmemcpy (KERNEL.348)
*/
void
WINAPI
hmemcpy16
(
LPVOID
dst
,
LPCVOID
src
,
LONG
count
)
{
memcpy
(
dst
,
src
,
count
);
}
/***********************************************************************
* lstrcpyn (KERNEL.353)
*/
SEGPTR
WINAPI
lstrcpyn16
(
SEGPTR
dst
,
LPCSTR
src
,
INT16
n
)
{
lstrcpynA
(
MapSL
(
dst
),
src
,
n
);
return
dst
;
}
/***********************************************************************
* lstrcatn (KERNEL.352)
*/
SEGPTR
WINAPI
lstrcatn16
(
SEGPTR
dst
,
LPCSTR
src
,
INT16
n
)
{
LPSTR
p
=
MapSL
(
dst
);
LPSTR
start
=
p
;
while
(
*
p
)
p
++
;
if
((
n
-=
(
p
-
start
))
<=
0
)
return
dst
;
lstrcpynA
(
p
,
src
,
n
);
return
dst
;
}
/***********************************************************************
* UnicodeToAnsi (KERNEL.434)
*/
INT16
WINAPI
UnicodeToAnsi16
(
LPCWSTR
src
,
LPSTR
dst
,
INT16
codepage
)
{
if
(
codepage
==
-
1
)
codepage
=
CP_ACP
;
return
WideCharToMultiByte
(
codepage
,
0
,
src
,
-
1
,
dst
,
0x7fffffff
,
NULL
,
NULL
);
}
/***********************************************************************
* EnableDos (KERNEL.41)
* DisableDos (KERNEL.42)
* GetLastDiskChange (KERNEL.98)
...
...
dlls/kernel32/string.c
View file @
3b1186de
...
...
@@ -141,26 +141,6 @@ INT WINAPIV k32wsprintfA(LPSTR buffer, LPCSTR spec, ...)
/***********************************************************************
* hmemcpy (KERNEL.348)
*/
void
WINAPI
hmemcpy16
(
LPVOID
dst
,
LPCVOID
src
,
LONG
count
)
{
memcpy
(
dst
,
src
,
count
);
}
/***********************************************************************
* lstrcat (KERNEL.89)
*/
SEGPTR
WINAPI
lstrcat16
(
SEGPTR
dst
,
LPCSTR
src
)
{
/* Windows does not check for NULL pointers here, so we don't either */
strcat
(
MapSL
(
dst
),
src
);
return
dst
;
}
/***********************************************************************
* lstrcatA (KERNEL32.@)
* lstrcat (KERNEL32.@)
*/
...
...
@@ -200,31 +180,6 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
/***********************************************************************
* lstrcatn (KERNEL.352)
*/
SEGPTR
WINAPI
lstrcatn16
(
SEGPTR
dst
,
LPCSTR
src
,
INT16
n
)
{
LPSTR
p
=
MapSL
(
dst
);
LPSTR
start
=
p
;
while
(
*
p
)
p
++
;
if
((
n
-=
(
p
-
start
))
<=
0
)
return
dst
;
lstrcpynA
(
p
,
src
,
n
);
return
dst
;
}
/***********************************************************************
* lstrcpy (KERNEL.88)
*/
SEGPTR
WINAPI
lstrcpy16
(
SEGPTR
dst
,
LPCSTR
src
)
{
if
(
!
lstrcpyA
(
MapSL
(
dst
),
src
))
dst
=
0
;
return
dst
;
}
/***********************************************************************
* lstrcpyA (KERNEL32.@)
* lstrcpy (KERNEL32.@)
*/
...
...
@@ -265,16 +220,6 @@ LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
/***********************************************************************
* lstrcpyn (KERNEL.353)
*/
SEGPTR
WINAPI
lstrcpyn16
(
SEGPTR
dst
,
LPCSTR
src
,
INT16
n
)
{
lstrcpynA
(
MapSL
(
dst
),
src
,
n
);
return
dst
;
}
/***********************************************************************
* lstrcpynA (KERNEL32.@)
* lstrcpyn (KERNEL32.@)
*
...
...
@@ -344,15 +289,6 @@ LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
/***********************************************************************
* lstrlen (KERNEL.90)
*/
INT16
WINAPI
lstrlen16
(
LPCSTR
str
)
{
return
(
INT16
)
lstrlenA
(
str
);
}
/***********************************************************************
* lstrlenA (KERNEL32.@)
* lstrlen (KERNEL32.@)
*/
...
...
@@ -391,84 +327,3 @@ INT WINAPI lstrlenW( LPCWSTR str )
__ENDTRY
return
ret
;
}
/***********************************************************************
* UnicodeToAnsi (KERNEL.434)
*/
INT16
WINAPI
UnicodeToAnsi16
(
LPCWSTR
src
,
LPSTR
dst
,
INT16
codepage
)
{
if
(
codepage
==
-
1
)
codepage
=
CP_ACP
;
return
WideCharToMultiByte
(
codepage
,
0
,
src
,
-
1
,
dst
,
0x7fffffff
,
NULL
,
NULL
);
}
/***************************************************************************
*
* Win 2.x string functions now moved to USER
*
* We rather want to implement them here instead of doing Callouts
*/
/***********************************************************************
* Reserved1 (KERNEL.77)
*/
SEGPTR
WINAPI
KERNEL_AnsiNext16
(
SEGPTR
current
)
{
return
(
*
(
char
*
)
MapSL
(
current
))
?
current
+
1
:
current
;
}
/***********************************************************************
* Reserved2(KERNEL.78)
*/
SEGPTR
WINAPI
KERNEL_AnsiPrev16
(
SEGPTR
start
,
SEGPTR
current
)
{
return
(
current
==
start
)
?
start
:
current
-
1
;
}
/***********************************************************************
* Reserved3 (KERNEL.79)
*/
SEGPTR
WINAPI
KERNEL_AnsiUpper16
(
SEGPTR
strOrChar
)
{
/* uppercase only one char if strOrChar < 0x10000 */
if
(
HIWORD
(
strOrChar
))
{
char
*
s
=
MapSL
(
strOrChar
);
while
(
*
s
)
{
*
s
=
toupper
(
*
s
);
s
++
;
}
return
strOrChar
;
}
else
return
toupper
((
char
)
strOrChar
);
}
/***********************************************************************
* Reserved4 (KERNEL.80)
*/
SEGPTR
WINAPI
KERNEL_AnsiLower16
(
SEGPTR
strOrChar
)
{
/* lowercase only one char if strOrChar < 0x10000 */
if
(
HIWORD
(
strOrChar
))
{
char
*
s
=
MapSL
(
strOrChar
);
while
(
*
s
)
{
*
s
=
tolower
(
*
s
);
s
++
;
}
return
strOrChar
;
}
else
return
tolower
((
char
)
strOrChar
);
}
/***********************************************************************
* Reserved5 (KERNEL.87)
*/
INT16
WINAPI
KERNEL_lstrcmp16
(
LPCSTR
str1
,
LPCSTR
str2
)
{
return
(
INT16
)
strcmp
(
str1
,
str2
);
}
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