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
471bad1e
Commit
471bad1e
authored
Aug 27, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _strdate_s and _wstrdate_s implementation.
parent
7d0c04d3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
8 deletions
+79
-8
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
time.c
dlls/msvcrt/tests/time.c
+24
-0
time.c
dlls/msvcrt/time.c
+44
-0
time.h
include/msvcrt/time.h
+2
-0
wchar.h
include/msvcrt/wchar.h
+1
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
471bad1e
...
...
@@ -1131,7 +1131,7 @@
@ stub _statusfp2
@ stub _strcoll_l
@ cdecl _strdate(ptr) msvcrt._strdate
@
stub
_strdate_s
@
cdecl _strdate_s(ptr long) msvcrt.
_strdate_s
@ cdecl _strdup(str) msvcrt._strdup
@ cdecl _strerror(long) msvcrt._strerror
@ stub _strerror_s
...
...
@@ -1398,7 +1398,7 @@
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ stub _wstat64i32
@ cdecl _wstrdate(ptr) msvcrt._wstrdate
@
stub
_wstrdate_s
@
cdecl _wstrdate_s(ptr long) msvcrt.
_wstrdate_s
@ cdecl _wstrtime(ptr) msvcrt._wstrtime
@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s
@ cdecl _wsystem(wstr) msvcrt._wsystem
...
...
dlls/msvcr80/msvcr80.spec
View file @
471bad1e
...
...
@@ -985,7 +985,7 @@
@ stub _statusfp2
@ stub _strcoll_l
@ cdecl _strdate(ptr) msvcrt._strdate
@
stub
_strdate_s
@
cdecl _strdate_s(ptr long) msvcrt.
_strdate_s
@ cdecl _strdup(str) msvcrt._strdup
@ cdecl _strerror(long) msvcrt._strerror
@ stub _strerror_s
...
...
@@ -1254,7 +1254,7 @@
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ stub _wstat64i32
@ cdecl _wstrdate(ptr) msvcrt._wstrdate
@
stub
_wstrdate_s
@
cdecl _wstrdate_s(ptr long) msvcrt.
_wstrdate_s
@ cdecl _wstrtime(ptr) msvcrt._wstrtime
@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s
@ cdecl _wsystem(wstr) msvcrt._wsystem
...
...
dlls/msvcr90/msvcr90.spec
View file @
471bad1e
...
...
@@ -971,7 +971,7 @@
@ stub _statusfp2
@ stub _strcoll_l
@ cdecl _strdate(ptr) msvcrt._strdate
@
stub
_strdate_s
@
cdecl _strdate_s(ptr long) msvcrt.
_strdate_s
@ cdecl _strdup(str) msvcrt._strdup
@ cdecl _strerror(long) msvcrt._strerror
@ stub _strerror_s
...
...
@@ -1238,7 +1238,7 @@
@ cdecl _wstat64(wstr ptr) msvcrt._wstat64
@ stub _wstat64i32
@ cdecl _wstrdate(ptr) msvcrt._wstrdate
@
stub
_wstrdate_s
@
cdecl _wstrdate_s(ptr long) msvcrt.
_wstrdate_s
@ cdecl _wstrtime(ptr) msvcrt._wstrtime
@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s
@ cdecl _wsystem(wstr) msvcrt._wsystem
...
...
dlls/msvcrt/msvcrt.spec
View file @
471bad1e
...
...
@@ -906,7 +906,7 @@
@ cdecl _strcmpi(str str) ntdll._strcmpi
# stub _strcoll_l
@ cdecl _strdate(ptr)
# stub _strdate_s
@ cdecl _strdate_s(ptr long)
@ cdecl _strdup(str)
# stub _strdup_dbg
@ cdecl _strerror(long)
...
...
@@ -1168,7 +1168,7 @@
@ cdecl _wstati64(wstr ptr) MSVCRT__wstati64
@ cdecl _wstat64(wstr ptr) MSVCRT__wstat64
@ cdecl _wstrdate(ptr)
# stub _wstrdate_s
@ cdecl _wstrdate_s(ptr long)
@ cdecl _wstrtime(ptr)
@ cdecl _wstrtime_s(ptr long)
@ cdecl _wsystem(wstr)
...
...
dlls/msvcrt/tests/time.c
View file @
471bad1e
...
...
@@ -36,6 +36,7 @@
static
__time32_t
(
__cdecl
*
p_mkgmtime32
)(
struct
tm
*
);
static
struct
tm
*
(
__cdecl
*
p_gmtime32
)(
__time32_t
*
);
static
errno_t
(
__cdecl
*
p_strtime_s
)(
char
*
,
size_t
);
static
errno_t
(
__cdecl
*
p_strdate_s
)(
char
*
,
size_t
);
static
void
init
(
void
)
{
...
...
@@ -44,6 +45,7 @@ static void init(void)
p_gmtime32
=
(
void
*
)
GetProcAddress
(
hmod
,
"_gmtime32"
);
p_mkgmtime32
=
(
void
*
)
GetProcAddress
(
hmod
,
"_mkgmtime32"
);
p_strtime_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_strtime_s"
);
p_strdate_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_strdate_s"
);
}
static
int
get_test_year
(
time_t
*
start
)
...
...
@@ -295,6 +297,7 @@ static void test_strdate(void)
{
char
date
[
16
],
*
result
;
int
month
,
day
,
year
,
count
,
len
;
errno_t
err
;
result
=
_strdate
(
date
);
ok
(
result
==
date
,
"Wrong return value
\n
"
);
...
...
@@ -302,6 +305,27 @@ static void test_strdate(void)
ok
(
len
==
8
,
"Wrong length: returned %d, should be 8
\n
"
,
len
);
count
=
sscanf
(
date
,
"%02d/%02d/%02d"
,
&
month
,
&
day
,
&
year
);
ok
(
count
==
3
,
"Wrong format: count = %d, should be 3
\n
"
,
count
);
if
(
!
p_strdate_s
)
{
win_skip
(
"Skipping _strdate_s tests
\n
"
);
return
;
}
errno
=
0
;
err
=
p_strdate_s
(
NULL
,
1
);
ok
(
err
==
EINVAL
,
"err = %d
\n
"
,
err
);
ok
(
errno
==
EINVAL
,
"errno = %d
\n
"
,
errno
);
date
[
0
]
=
'x'
;
date
[
1
]
=
'x'
;
err
=
p_strdate_s
(
date
,
8
);
ok
(
err
==
ERANGE
,
"err = %d
\n
"
,
err
);
ok
(
errno
==
ERANGE
,
"errno = %d
\n
"
,
errno
);
ok
(
date
[
0
]
==
'\0'
,
"date[0] != '
\\
0'
\n
"
);
ok
(
date
[
1
]
==
'x'
,
"date[1] != 'x'
\n
"
);
err
=
p_strdate_s
(
date
,
9
);
ok
(
err
==
0
,
"err = %x
\n
"
,
err
);
}
static
void
test_strtime
(
void
)
...
...
dlls/msvcrt/time.c
View file @
471bad1e
...
...
@@ -302,6 +302,28 @@ char* CDECL _strdate(char* date)
}
/**********************************************************************
* _strdate_s (MSVCRT.@)
*/
int
CDECL
_strdate_s
(
char
*
date
,
MSVCRT_size_t
size
)
{
if
(
date
&&
size
)
date
[
0
]
=
'\0'
;
if
(
!
date
)
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
if
(
size
<
9
)
{
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
_strdate
(
date
);
return
0
;
}
/**********************************************************************
* _wstrdate (MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
_wstrdate
(
MSVCRT_wchar_t
*
date
)
...
...
@@ -313,6 +335,28 @@ MSVCRT_wchar_t* CDECL _wstrdate(MSVCRT_wchar_t* date)
return
date
;
}
/**********************************************************************
* _wstrdate_s (MSVCRT.@)
*/
int
CDECL
_wstrdate_s
(
MSVCRT_wchar_t
*
date
,
MSVCRT_size_t
size
)
{
if
(
date
&&
size
)
date
[
0
]
=
'\0'
;
if
(
!
date
)
{
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
if
(
size
<
9
)
{
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
MSVCRT_ERANGE
;
}
_wstrdate
(
date
);
return
0
;
}
/*********************************************************************
* _strtime (MSVCRT.@)
*/
...
...
include/msvcrt/time.h
View file @
471bad1e
...
...
@@ -89,6 +89,7 @@ extern char *_tzname;
unsigned
__cdecl
_getsystime
(
struct
tm
*
);
unsigned
__cdecl
_setsystime
(
struct
tm
*
,
unsigned
);
char
*
__cdecl
_strdate
(
char
*
);
errno_t
__cdecl
_strdate_s
(
char
*
,
size_t
);
char
*
__cdecl
_strtime
(
char
*
);
errno_t
__cdecl
_strtime_s
(
char
*
,
size_t
);
void
__cdecl
_tzset
(
void
);
...
...
@@ -130,6 +131,7 @@ size_t __cdecl wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
wchar_t
*
__cdecl
_wctime32
(
const
__time32_t
*
);
wchar_t
*
__cdecl
_wctime64
(
const
__time64_t
*
);
wchar_t
*
__cdecl
_wstrdate
(
wchar_t
*
);
errno_t
__cdecl
_wstrdate_s
(
wchar_t
*
,
size_t
);
wchar_t
*
__cdecl
_wstrtime
(
wchar_t
*
);
errno_t
__cdecl
_wstrtime_s
(
wchar_t
*
,
size_t
);
...
...
include/msvcrt/wchar.h
View file @
471bad1e
...
...
@@ -396,6 +396,7 @@ size_t __cdecl wcsftime(wchar_t*,size_t,const wchar_t*,const struct tm*);
wchar_t
*
__cdecl
_wctime32
(
const
__time32_t
*
);
wchar_t
*
__cdecl
_wctime64
(
const
__time64_t
*
);
wchar_t
*
__cdecl
_wstrdate
(
wchar_t
*
);
errno_t
__cdecl
_wstrdate_s
(
wchar_t
*
,
size_t
);
wchar_t
*
__cdecl
_wstrtime
(
wchar_t
*
);
errno_t
__cdecl
_wstrtime_s
(
wchar_t
*
,
size_t
);
...
...
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