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/] [lcltime.c] - Diff between revs 207 and 345

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

Rev 207 Rev 345
/*
/*
 * localtime.c
 * localtime.c
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<localtime>>---convert time to local representation
<<localtime>>---convert time to local representation
 
 
INDEX
INDEX
        localtime
        localtime
INDEX
INDEX
        localtime_r
        localtime_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <time.h>
        #include <time.h>
        struct tm *localtime(time_t *<[clock]>);
        struct tm *localtime(time_t *<[clock]>);
        struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
        struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <time.h>
        #include <time.h>
        struct tm *localtime(<[clock]>)
        struct tm *localtime(<[clock]>)
        time_t *<[clock]>;
        time_t *<[clock]>;
        struct tm *localtime(<[clock]>, <[res]>)
        struct tm *localtime(<[clock]>, <[res]>)
        time_t *<[clock]>;
        time_t *<[clock]>;
        struct tm *<[res]>;
        struct tm *<[res]>;
 
 
DESCRIPTION
DESCRIPTION
<<localtime>> converts the time at <[clock]> into local time, then
<<localtime>> converts the time at <[clock]> into local time, then
converts its representation from the arithmetic representation to the
converts its representation from the arithmetic representation to the
traditional representation defined by <<struct tm>>.
traditional representation defined by <<struct tm>>.
 
 
<<localtime>> constructs the traditional time representation in static
<<localtime>> 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.
 
 
<<mktime>> is the inverse of <<localtime>>.
<<mktime>> is the inverse of <<localtime>>.
 
 
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 <<localtime>>.
ANSI C requires <<localtime>>.
 
 
<<localtime>> requires no supporting OS subroutines.
<<localtime>> requires no supporting OS subroutines.
*/
*/
 
 
#include <time.h>
#include <time.h>
#include <reent.h>
#include <reent.h>
 
 
#ifndef _REENT_ONLY
#ifndef _REENT_ONLY
 
 
struct tm *
struct tm *
_DEFUN (localtime, (tim_p),
_DEFUN (localtime, (tim_p),
        _CONST time_t * tim_p)
        _CONST time_t * tim_p)
{
{
  _REENT_CHECK_TM(_REENT);
  _REENT_CHECK_TM(_REENT);
  return localtime_r (tim_p, (struct tm *)_REENT_TM(_REENT));
  return localtime_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.