4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-15 19:09:58 +08:00
Jeff Johnston 1dc1ccd4ae 2008-10-31 Jeff Johnston <jjohnstn@redhat.com>
* 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.
2008-10-31 21:08:03 +00:00

69 lines
1.5 KiB
C

/*
* gmtime.c
* Original Author: G. Haley
*
* Converts the calendar time pointed to by tim_p into a broken-down time
* expressed as Greenwich Mean Time (GMT). Returns a pointer to a structure
* containing the broken-down time, or a null pointer if GMT is not
* available.
*/
/*
FUNCTION
<<gmtime>>---convert time to UTC traditional form
INDEX
gmtime
INDEX
gmtime_r
ANSI_SYNOPSIS
#include <time.h>
struct tm *gmtime(const time_t *<[clock]>);
struct tm *gmtime_r(const time_t *<[clock]>, struct tm *<[res]>);
TRAD_SYNOPSIS
#include <time.h>
struct tm *gmtime(<[clock]>)
const time_t *<[clock]>;
struct tm *gmtime_r(<[clock]>, <[res]>)
const time_t *<[clock]>;
struct tm *<[res]>;
DESCRIPTION
<<gmtime>> takes the time at <[clock]> representing the number
of elapsed seconds since 00:00:00 on January 1, 1970, Universal
Coordinated Time (UTC, also known in some countries as GMT,
Greenwich Mean time) and converts it to a <<struct tm>>
representation.
<<gmtime>> 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.
RETURNS
A pointer to the traditional time representation (<<struct tm>>).
PORTABILITY
ANSI C requires <<gmtime>>.
<<gmtime>> requires no supporting OS subroutines.
*/
#include <stdlib.h>
#include <time.h>
#define _GMT_OFFSET 0
#ifndef _REENT_ONLY
struct tm *
_DEFUN (gmtime, (tim_p),
_CONST time_t * tim_p)
{
_REENT_CHECK_TM(_REENT);
return gmtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
}
#endif