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
fac4fdb5
Commit
fac4fdb5
authored
Jun 25, 2015
by
Iván Matellanes
Committed by
Alexandre Julliard
Jun 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcirt: Add implementation of streambuf::snextc.
parent
4c6507d9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
6 deletions
+78
-6
msvcirt.c
dlls/msvcirt/msvcirt.c
+18
-0
msvcirt.spec
dlls/msvcirt/msvcirt.spec
+2
-2
msvcirt.c
dlls/msvcirt/tests/msvcirt.c
+54
-0
msvcrt20.spec
dlls/msvcrt20/msvcrt20.spec
+2
-2
msvcrt40.spec
dlls/msvcrt40/msvcrt40.spec
+2
-2
No files found.
dlls/msvcirt/msvcirt.c
View file @
fac4fdb5
...
...
@@ -597,6 +597,24 @@ int __thiscall streambuf_sputn(streambuf *this, const char *data, int length)
return
call_streambuf_xsputn
(
this
,
data
,
length
);
}
/* ?snextc@streambuf@@QAEHXZ */
/* ?snextc@streambuf@@QEAAHXZ */
DEFINE_THISCALL_WRAPPER
(
streambuf_snextc
,
4
)
int
__thiscall
streambuf_snextc
(
streambuf
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
if
(
this
->
unbuffered
)
{
if
(
this
->
stored_char
==
EOF
)
call_streambuf_underflow
(
this
);
return
this
->
stored_char
=
call_streambuf_underflow
(
this
);
}
else
{
if
(
this
->
gptr
>=
this
->
egptr
)
call_streambuf_underflow
(
this
);
this
->
gptr
++
;
return
(
this
->
gptr
<
this
->
egptr
)
?
*
this
->
gptr
:
call_streambuf_underflow
(
this
);
}
}
/******************************************************************
* ??1ios@@UAE@XZ (MSVCRTI.@)
* class ios & __thiscall ios::-ios<<(void)
...
...
dlls/msvcirt/msvcirt.spec
View file @
fac4fdb5
...
...
@@ -700,8 +700,8 @@
# @ extern ?sh_none@filebuf@@2HB # static int const filebuf::sh_none
# @ extern ?sh_read@filebuf@@2HB # static int const filebuf::sh_read
# @ extern ?sh_write@filebuf@@2HB # static int const filebuf::sh_write
@
stub -arch=win32 ?snextc@streambuf@@QAEHXZ # int __thiscall streambuf::snextc(void)
@
stub -arch=win64 ?snextc@streambuf@@QEAAHXZ
@
thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) streambuf_snextc
@
cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) streambuf_snextc
@ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z # int __thiscall streambuf::sputbackc(char)
@ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z
@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) streambuf_sputc
...
...
dlls/msvcirt/tests/msvcirt.c
View file @
fac4fdb5
...
...
@@ -62,6 +62,7 @@ static void (*__thiscall p_streambuf_setb)(streambuf*, char*, char*, int);
static
void
(
*
__thiscall
p_streambuf_setlock
)(
streambuf
*
);
static
streambuf
*
(
*
__thiscall
p_streambuf_setbuf
)(
streambuf
*
,
char
*
,
int
);
static
int
(
*
__thiscall
p_streambuf_sgetc
)(
streambuf
*
);
static
int
(
*
__thiscall
p_streambuf_snextc
)(
streambuf
*
);
static
int
(
*
__thiscall
p_streambuf_sputc
)(
streambuf
*
,
int
);
static
int
(
*
__thiscall
p_streambuf_sync
)(
streambuf
*
);
static
void
(
*
__thiscall
p_streambuf_unlock
)(
streambuf
*
);
...
...
@@ -150,6 +151,7 @@ static BOOL init(void)
SET
(
p_streambuf_setbuf
,
"?setbuf@streambuf@@UEAAPEAV1@PEADH@Z"
);
SET
(
p_streambuf_setlock
,
"?setlock@streambuf@@QEAAXXZ"
);
SET
(
p_streambuf_sgetc
,
"?sgetc@streambuf@@QEAAHXZ"
);
SET
(
p_streambuf_snextc
,
"?snextc@streambuf@@QEAAHXZ"
);
SET
(
p_streambuf_sputc
,
"?sputc@streambuf@@QEAAHH@Z"
);
SET
(
p_streambuf_sync
,
"?sync@streambuf@@UEAAHXZ"
);
SET
(
p_streambuf_unlock
,
"?unlock@streambuf@@QEAAXXZ"
);
...
...
@@ -169,6 +171,7 @@ static BOOL init(void)
SET
(
p_streambuf_setbuf
,
"?setbuf@streambuf@@UAEPAV1@PADH@Z"
);
SET
(
p_streambuf_setlock
,
"?setlock@streambuf@@QAEXXZ"
);
SET
(
p_streambuf_sgetc
,
"?sgetc@streambuf@@QAEHXZ"
);
SET
(
p_streambuf_snextc
,
"?snextc@streambuf@@QAEHXZ"
);
SET
(
p_streambuf_sputc
,
"?sputc@streambuf@@QAEHH@Z"
);
SET
(
p_streambuf_sync
,
"?sync@streambuf@@UAEHXZ"
);
SET
(
p_streambuf_unlock
,
"?unlock@streambuf@@QAEXXZ"
);
...
...
@@ -564,6 +567,57 @@ static void test_streambuf(void)
ok
(
sb3
.
stored_char
==
'G'
,
"wrong stored character, expected 'G' got %c
\n
"
,
sb3
.
stored_char
);
ok
(
overflow_count
==
14
,
"expected 3 calls to overflow, got %d
\n
"
,
overflow_count
-
11
);
/* snextc */
strcpy
(
sb
.
eback
,
"Test"
);
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb
);
ok
(
ret
==
'e'
,
"expected 'e' got '%c'
\n
"
,
ret
);
ok
(
sb
.
gptr
==
sb
.
eback
+
1
,
"wrong get pointer, expected %p got %p
\n
"
,
sb
.
eback
+
1
,
sb
.
gptr
);
test_this
=
&
sb2
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb2
);
ok
(
ret
==
EOF
,
"expected EOF got '%c'
\n
"
,
ret
);
ok
(
sb2
.
gptr
==
sb2
.
egptr
+
1
,
"wrong get pointer, expected %p got %p
\n
"
,
sb2
.
egptr
+
1
,
sb2
.
gptr
);
ok
(
underflow_count
==
39
,
"expected 2 calls to underflow, got %d
\n
"
,
underflow_count
-
37
);
sb2
.
gptr
=
sb2
.
egptr
-
1
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb2
);
ok
(
ret
==
EOF
,
"expected EOF got '%c'
\n
"
,
ret
);
ok
(
sb2
.
gptr
==
sb2
.
egptr
,
"wrong get pointer, expected %p got %p
\n
"
,
sb2
.
egptr
,
sb2
.
gptr
);
ok
(
underflow_count
==
40
,
"expected call to underflow
\n
"
);
get_end
=
0
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb2
);
ok
(
ret
==
'o'
,
"expected 'o' got '%c'
\n
"
,
ret
);
ok
(
sb2
.
gptr
==
sb2
.
eback
+
1
,
"wrong get pointer, expected %p got %p
\n
"
,
sb2
.
eback
+
1
,
sb2
.
gptr
);
ok
(
underflow_count
==
41
,
"expected call to underflow
\n
"
);
sb2
.
gptr
=
sb2
.
egptr
-
1
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb2
);
ok
(
ret
==
'W'
,
"expected 'W' got '%c'
\n
"
,
ret
);
ok
(
sb2
.
gptr
==
sb2
.
eback
,
"wrong get pointer, expected %p got %p
\n
"
,
sb2
.
eback
,
sb2
.
gptr
);
ok
(
underflow_count
==
42
,
"expected call to underflow
\n
"
);
sb2
.
gptr
=
sb2
.
egptr
;
test_this
=
&
sb3
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb3
);
ok
(
ret
==
'l'
,
"expected 'l' got '%c'
\n
"
,
ret
);
ok
(
sb3
.
stored_char
==
'l'
,
"wrong stored character, expected 'l' got %c
\n
"
,
sb3
.
stored_char
);
ok
(
underflow_count
==
43
,
"expected call to underflow
\n
"
);
buffer_pos
=
22
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb3
);
ok
(
ret
==
't'
,
"expected 't' got '%c'
\n
"
,
ret
);
ok
(
sb3
.
stored_char
==
't'
,
"wrong stored character, expected 't' got %c
\n
"
,
sb3
.
stored_char
);
ok
(
underflow_count
==
44
,
"expected call to underflow
\n
"
);
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb3
);
ok
(
ret
==
EOF
,
"expected EOF got '%c'
\n
"
,
ret
);
ok
(
sb3
.
stored_char
==
EOF
,
"wrong stored character, expected EOF got %c
\n
"
,
sb3
.
stored_char
);
ok
(
underflow_count
==
45
,
"expected call to underflow
\n
"
);
buffer_pos
=
0
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb3
);
ok
(
ret
==
'o'
,
"expected 'o' got '%c'
\n
"
,
ret
);
ok
(
sb3
.
stored_char
==
'o'
,
"wrong stored character, expected 'o' got %c
\n
"
,
sb3
.
stored_char
);
ok
(
underflow_count
==
47
,
"expected 2 calls to underflow, got %d
\n
"
,
underflow_count
-
45
);
sb3
.
stored_char
=
EOF
;
ret
=
(
int
)
call_func1
(
p_streambuf_snextc
,
&
sb3
);
ok
(
ret
==
'p'
,
"expected 'p' got '%c'
\n
"
,
ret
);
ok
(
sb3
.
stored_char
==
'p'
,
"wrong stored character, expected 'p' got %c
\n
"
,
sb3
.
stored_char
);
ok
(
underflow_count
==
49
,
"expected 2 calls to underflow, got %d
\n
"
,
underflow_count
-
47
);
SetEvent
(
lock_arg
.
test
[
3
]);
WaitForSingleObject
(
thread
,
INFINITE
);
...
...
dlls/msvcrt20/msvcrt20.spec
View file @
fac4fdb5
...
...
@@ -688,8 +688,8 @@
# @ extern ?sh_none@filebuf@@2HB
# @ extern ?sh_read@filebuf@@2HB
# @ extern ?sh_write@filebuf@@2HB
@
stub -arch=win32
?snextc@streambuf@@QAEHXZ
@
stub -arch=win64
?snextc@streambuf@@QEAAHXZ
@
thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) msvcirt.
?snextc@streambuf@@QAEHXZ
@
cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) msvcirt.
?snextc@streambuf@@QEAAHXZ
@ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z
@ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z
@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) msvcirt.?sputc@streambuf@@QAEHH@Z
...
...
dlls/msvcrt40/msvcrt40.spec
View file @
fac4fdb5
...
...
@@ -760,8 +760,8 @@
# @ extern ?sh_none@filebuf@@2HB
# @ extern ?sh_read@filebuf@@2HB
# @ extern ?sh_write@filebuf@@2HB
@
stub -arch=win32
?snextc@streambuf@@QAEHXZ
@
stub -arch=win64
?snextc@streambuf@@QEAAHXZ
@
thiscall -arch=win32 ?snextc@streambuf@@QAEHXZ(ptr) msvcirt.
?snextc@streambuf@@QAEHXZ
@
cdecl -arch=win64 ?snextc@streambuf@@QEAAHXZ(ptr) msvcirt.
?snextc@streambuf@@QEAAHXZ
@ stub -arch=win32 ?sputbackc@streambuf@@QAEHD@Z
@ stub -arch=win64 ?sputbackc@streambuf@@QEAAHD@Z
@ thiscall -arch=win32 ?sputc@streambuf@@QAEHH@Z(ptr long) msvcirt.?sputc@streambuf@@QAEHH@Z
...
...
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