From 8a0efa53e44919bcf5ccb1d3353618a82afdf8bc Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 17 Feb 2000 19:39:52 +0000 Subject: import newlib-2000-02-17 snapshot --- newlib/libc/time/lcltime.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 newlib/libc/time/lcltime.c (limited to 'newlib/libc/time/lcltime.c') diff --git a/newlib/libc/time/lcltime.c b/newlib/libc/time/lcltime.c new file mode 100644 index 000000000..d4c7d7d61 --- /dev/null +++ b/newlib/libc/time/lcltime.c @@ -0,0 +1,57 @@ +/* + * localtime.c + */ + +/* +FUNCTION +<>---convert time to local representation + +INDEX + localtime + +ANSI_SYNOPSIS + #include + struct tm *localtime(time_t *<[clock]>); + struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>); + +TRAD_SYNOPSIS + #include + struct tm *localtime(<[clock]>) + time_t *<[clock]>; + struct tm *localtime(<[clock]>, <[res]>) + time_t *<[clock]>; + struct tm *<[res]>; + +DESCRIPTION +<> converts the time at <[clock]> into local time, then +converts its representation from the arithmetic representation to the +traditional representation defined by <>. + +<> constructs the traditional time representation in static +storage; each call to <> or <> will overwrite the +information generated by previous calls to either function. + +<> is the inverse of <>. + +RETURNS +A pointer to the traditional time representation (<>). + +PORTABILITY +ANSI C requires <>. + +<> requires no supporting OS subroutines. +*/ + +#include +#include + +#ifndef _REENT_ONLY + +struct tm * +_DEFUN (localtime, (tim_p), + _CONST time_t * tim_p) +{ + return localtime_r (tim_p, &(_REENT->_new._reent._localtime_buf)); +} + +#endif -- cgit v1.2.3