OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [time/] [ctime.c] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1010 ivang
/*
2
 * ctime.c
3
 * Original Author:     G. Haley
4
 */
5
 
6
/*
7
FUNCTION
8
<<ctime>>---convert time to local and format as string
9
 
10
INDEX
11
        ctime
12
 
13
ANSI_SYNOPSIS
14
        #include <time.h>
15
        char *ctime(time_t <[clock]>);
16
        char *ctime_r(time_t <[clock]>, char *<[buf]>);
17
 
18
TRAD_SYNOPSIS
19
        #include <time.h>
20
        char *ctime(<[clock]>)
21
        time_t <[clock]>;
22
        char *ctime_r(<[clock]>, <[buf]>)
23
        time_t <[clock]>;
24
        char *<[buf]>;
25
 
26
DESCRIPTION
27
Convert the time value at <[clock]> to local time (like <<localtime>>)
28
and format it into a string of the form
29
. Wed Jun 15 11:38:07 1988\n\0
30
(like <<asctime>>).
31
 
32
RETURNS
33
A pointer to the string containing a formatted timestamp.
34
 
35
PORTABILITY
36
ANSI C requires <<ctime>>.
37
 
38
<<ctime>> requires no supporting OS subroutines.
39
*/
40
 
41
#include <time.h>
42
 
43
#ifndef _REENT_ONLY
44
 
45
char *
46
_DEFUN (ctime, (tim_p),
47
        _CONST time_t * tim_p)
48
{
49
  return asctime (localtime (tim_p));
50
}
51
 
52
#endif

powered by: WebSVN 2.1.0

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