mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 19:09:58 +08:00
1dc1ccd4ae
* libc/stdio/diprintf.c: Modify documentation so eclipse newlib libhover docs generate properly. * libc/stdio/dprintf.c: Ditto. * libc/stdio/fflush.c: Ditto. * libc/stdio/fopencookie.c: Ditto. * libc/stdio/fread.c: Ditto. * libc/stdio/fsetpos.c: Ditto. * libc/stdio/getc_u.c: Ditto. * libc/stdio/getchar_u.c: Ditto. * libc/stdio/putc_u.c: Ditto. * libc/stdio/putchar_u.c: Ditto. * libc/stdio/remove.c: Ditto. * libc/stdio/siprintf.c: Ditto. * libc/stdio/siscanf.c: Ditto. * libc/stdio/sprintf.c: Ditto. * libc/stdio/sscanf.c: Ditto. * libc/stdio/vfprintf.c: Ditto. * libc/stdio/vfscanf.c: Ditto. * libc/stdio/viprintf.c: Ditto. * libc/stdio/viscanf.c: Ditto. * libc/stdlib/calloc.c: Ditto. * libc/stdlib/efgcvt.c: Ditto. * libc/stdlib/envlock.c: Ditto. * libc/time/asctime.c: Ditto. * libc/time/ctime.c: Ditto. * libc/time/gmtime.c: Ditto. * libc/time/lcltime.c: Ditto. * libc/time/tzset.c: Ditto. * libc/stdlib/envlock.h: Moved to libc/include.
61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
/*
|
|
* localtime.c
|
|
*/
|
|
|
|
/*
|
|
FUNCTION
|
|
<<localtime>>---convert time to local representation
|
|
|
|
INDEX
|
|
localtime
|
|
INDEX
|
|
localtime_r
|
|
|
|
ANSI_SYNOPSIS
|
|
#include <time.h>
|
|
struct tm *localtime(time_t *<[clock]>);
|
|
struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
|
|
|
|
TRAD_SYNOPSIS
|
|
#include <time.h>
|
|
struct tm *localtime(<[clock]>)
|
|
time_t *<[clock]>;
|
|
struct tm *localtime(<[clock]>, <[res]>)
|
|
time_t *<[clock]>;
|
|
struct tm *<[res]>;
|
|
|
|
DESCRIPTION
|
|
<<localtime>> converts the time at <[clock]> into local time, then
|
|
converts its representation from the arithmetic representation to the
|
|
traditional representation defined by <<struct tm>>.
|
|
|
|
<<localtime>> constructs the traditional time representation in static
|
|
storage; each call to <<gmtime>> or <<localtime>> will overwrite the
|
|
information generated by previous calls to either function.
|
|
|
|
<<mktime>> is the inverse of <<localtime>>.
|
|
|
|
RETURNS
|
|
A pointer to the traditional time representation (<<struct tm>>).
|
|
|
|
PORTABILITY
|
|
ANSI C requires <<localtime>>.
|
|
|
|
<<localtime>> requires no supporting OS subroutines.
|
|
*/
|
|
|
|
#include <time.h>
|
|
#include <reent.h>
|
|
|
|
#ifndef _REENT_ONLY
|
|
|
|
struct tm *
|
|
_DEFUN (localtime, (tim_p),
|
|
_CONST time_t * tim_p)
|
|
{
|
|
_REENT_CHECK_TM(_REENT);
|
|
return localtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
|
|
}
|
|
|
|
#endif
|