From 48ef7704c03e7e554c05de01bf8d1d70c16cb6f4 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 20 Dec 2017 16:34:35 -0500 Subject: add libc building to agbcc. --- libc/time/lcltime.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 libc/time/lcltime.c (limited to 'libc/time/lcltime.c') diff --git a/libc/time/lcltime.c b/libc/time/lcltime.c new file mode 100644 index 0000000..d4c7d7d --- /dev/null +++ b/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