source: trunk/libs/newlib/src/newlib/libc/time/asctime.c @ 543

Last change on this file since 543 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 1.1 KB
Line 
1/*
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/*
14FUNCTION
15<<asctime>>---format time as string
16
17INDEX
18        asctime
19INDEX
20        _asctime_r
21
22SYNOPSIS
23        #include <time.h>
24        char *asctime(const struct tm *<[clock]>);
25        char *_asctime_r(const struct tm *<[clock]>, char *<[buf]>);
26
27DESCRIPTION
28Format the time value at <[clock]> into a string of the form
29. Wed Jun 15 11:38:07 1988\n\0
30The string is generated in a static buffer; each call to <<asctime>>
31overwrites the string generated by previous calls.
32
33RETURNS
34A pointer to the string containing a formatted timestamp.
35
36PORTABILITY
37ANSI C requires <<asctime>>.
38
39<<asctime>> requires no supporting OS subroutines.
40*/
41
42#include <stdlib.h>
43#include <string.h>
44#include <time.h>
45#include <_ansi.h>
46#include <reent.h>
47
48#ifndef _REENT_ONLY
49
50char *
51asctime (const struct tm *tim_p)
52{
53  struct _reent *reent = _REENT;
54
55  _REENT_CHECK_ASCTIME_BUF(reent);
56  return asctime_r (tim_p, _REENT_ASCTIME_BUF(reent));
57}
58
59#endif
Note: See TracBrowser for help on using the repository browser.