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 | /* |
---|
14 | FUNCTION |
---|
15 | <<asctime>>---format time as string |
---|
16 | |
---|
17 | INDEX |
---|
18 | asctime |
---|
19 | INDEX |
---|
20 | _asctime_r |
---|
21 | |
---|
22 | SYNOPSIS |
---|
23 | #include <time.h> |
---|
24 | char *asctime(const struct tm *<[clock]>); |
---|
25 | char *_asctime_r(const struct tm *<[clock]>, char *<[buf]>); |
---|
26 | |
---|
27 | DESCRIPTION |
---|
28 | Format the time value at <[clock]> into a string of the form |
---|
29 | . Wed Jun 15 11:38:07 1988\n\0 |
---|
30 | The string is generated in a static buffer; each call to <<asctime>> |
---|
31 | overwrites the string generated by previous calls. |
---|
32 | |
---|
33 | RETURNS |
---|
34 | A pointer to the string containing a formatted timestamp. |
---|
35 | |
---|
36 | PORTABILITY |
---|
37 | ANSI 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 | |
---|
50 | char * |
---|
51 | asctime (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.