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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [time/] [asctime.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
 * asctime.c
3
 * Original Author:     G. Haley
4
 *
5
 * Converts the broken down time in the structure pointed to by tim_p into a
6
 * string of the form
7
 *
8
 * Wed Jun 15 11:38:07 1988\n\0
9
 *
10
 * Returns a pointer to the string.
11
 */
12
 
13
/*
14
FUNCTION
15
<<asctime>>---format time as string
16
 
17
INDEX
18
        asctime
19
INDEX
20
        _asctime_r
21
 
22
ANSI_SYNOPSIS
23
        #include <time.h>
24
        char *asctime(const struct tm *<[clock]>);
25
        char *asctime_r(const struct tm *<[clock]>, char *<[buf]>);
26
 
27
TRAD_SYNOPSIS
28
        #include <time.h>
29
        char *asctime(<[clock]>)
30
        struct tm *<[clock]>;
31
        char *asctime_r(<[clock]>)
32
        struct tm *<[clock]>;
33
        char *<[buf]>;
34
 
35
DESCRIPTION
36
Format the time value at <[clock]> into a string of the form
37
. Wed Jun 15 11:38:07 1988\n\0
38
The string is generated in a static buffer; each call to <<asctime>>
39
overwrites the string generated by previous calls.
40
 
41
RETURNS
42
A pointer to the string containing a formatted timestamp.
43
 
44
PORTABILITY
45
ANSI C requires <<asctime>>.
46
 
47
<<asctime>> requires no supporting OS subroutines.
48
*/
49
 
50
#include <time.h>
51
#include <_ansi.h>
52
#include <reent.h>
53
 
54
#ifndef _REENT_ONLY
55
 
56
char *
57
_DEFUN (asctime, (tim_p),
58
        _CONST struct tm *tim_p)
59
{
60
  char *buf = _REENT->_new._reent._asctime_buf;
61
  return asctime_r (tim_p, buf);
62
}
63
 
64
#endif

powered by: WebSVN 2.1.0

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