OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [time/] [lcltime.c] - Blame information for rev 57

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.