source: trunk/libs/newlib/src/newlib/libc/time/lcltime.c @ 543

Last change on this file since 543 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.1 KB
Line 
1/*
2 * localtime.c
3 */
4
5/*
6FUNCTION
7<<localtime>>---convert time to local representation
8
9INDEX
10        localtime
11INDEX
12        localtime_r
13
14SYNOPSIS
15        #include <time.h>
16        struct tm *localtime(time_t *<[clock]>);
17        struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
18
19DESCRIPTION
20<<localtime>> converts the time at <[clock]> into local time, then
21converts its representation from the arithmetic representation to the
22traditional representation defined by <<struct tm>>.
23
24<<localtime>> constructs the traditional time representation in static
25storage; each call to <<gmtime>> or <<localtime>> will overwrite the
26information generated by previous calls to either function.
27
28<<mktime>> is the inverse of <<localtime>>.
29
30RETURNS
31A pointer to the traditional time representation (<<struct tm>>).
32
33PORTABILITY
34ANSI C requires <<localtime>>.
35
36<<localtime>> requires no supporting OS subroutines.
37*/
38
39#include <stdlib.h>
40#include <time.h>
41#include <reent.h>
42
43#ifndef _REENT_ONLY
44
45struct tm *
46localtime (const time_t * tim_p)
47{
48  struct _reent *reent = _REENT;
49
50  _REENT_CHECK_TM(reent);
51  return localtime_r (tim_p, (struct tm *)_REENT_TM(reent));
52}
53
54#endif
Note: See TracBrowser for help on using the repository browser.