OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [time/] [gmtime.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

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

powered by: WebSVN 2.1.0

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