Subversion Repositories Kolibri OS

Rev

Rev 4874 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4874 Rev 4921
1
/*
1
/*
2
 * localtime.c
2
 * localtime.c
3
 */
3
 */
4
 
4
 
5
/*
5
/*
6
FUNCTION
6
FUNCTION
7
<>---convert time to local representation
7
<>---convert time to local representation
8
 
8
 
9
INDEX
9
INDEX
10
	localtime
10
	localtime
11
INDEX
11
INDEX
12
	localtime_r
12
	localtime_r
13
 
13
 
14
ANSI_SYNOPSIS
14
ANSI_SYNOPSIS
15
	#include 
15
	#include 
16
	struct tm *localtime(time_t *<[clock]>);
16
	struct tm *localtime(time_t *<[clock]>);
17
	struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
17
	struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
18
 
18
 
19
TRAD_SYNOPSIS
19
TRAD_SYNOPSIS
20
	#include 
20
	#include 
21
	struct tm *localtime(<[clock]>)
21
	struct tm *localtime(<[clock]>)
22
	time_t *<[clock]>;
22
	time_t *<[clock]>;
23
	struct tm *localtime(<[clock]>, <[res]>)
23
	struct tm *localtime(<[clock]>, <[res]>)
24
	time_t *<[clock]>;
24
	time_t *<[clock]>;
25
	struct tm *<[res]>;
25
	struct tm *<[res]>;
26
 
26
 
27
DESCRIPTION
27
DESCRIPTION
28
<> converts the time at <[clock]> into local time, then
28
<> converts the time at <[clock]> into local time, then
29
converts its representation from the arithmetic representation to the
29
converts its representation from the arithmetic representation to the
30
traditional representation defined by <>.
30
traditional representation defined by <>.
31
 
31
 
32
<> constructs the traditional time representation in static
32
<> constructs the traditional time representation in static
33
storage; each call to <> or <> will overwrite the
33
storage; each call to <> or <> will overwrite the
34
information generated by previous calls to either function.
34
information generated by previous calls to either function.
35
 
35
 
36
<> is the inverse of <>.
36
<> is the inverse of <>.
37
 
37
 
38
RETURNS
38
RETURNS
39
A pointer to the traditional time representation (<>).
39
A pointer to the traditional time representation (<>).
40
 
40
 
41
PORTABILITY
41
PORTABILITY
42
ANSI C requires <>.
42
ANSI C requires <>.
43
 
43
 
44
<> requires no supporting OS subroutines.
44
<> requires no supporting OS subroutines.
45
*/
45
*/
46
 
46
 
47
#include 
47
#include 
48
#include 
48
#include 
49
 
49
 
50
#ifndef _REENT_ONLY
50
#ifndef _REENT_ONLY
51
 
51
 
52
struct tm *
52
struct tm *
53
_DEFUN (localtime, (tim_p),
53
_DEFUN (localtime, (tim_p),
54
	_CONST time_t * tim_p)
54
	_CONST time_t * tim_p)
55
{
55
{
-
 
56
  struct _reent *reent = _REENT;
-
 
57
 
56
  _REENT_CHECK_TM(_REENT);
58
  _REENT_CHECK_TM(reent);
57
  return localtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
59
  return localtime_r (tim_p, (struct tm *)_REENT_TM(reent));
58
}
60
}
59
 
61
 
60
#endif
62
#endif