source: trunk/libs/newlib/src/newlib/libc/time/wcsftime.c @ 620

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

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

File size: 2.1 KB
Line 
1/*
2 * wcsftime.c
3 * Original Author:     Craig Howland, for Newlib
4 *
5 * Source actually uses strftime.c.
6 * Documentation for wcsftime() here, with minimal overlap.
7 */
8
9/*
10FUNCTION
11<<wcsftime>>---convert date and time to a formatted wide-character string
12
13INDEX
14        wcsftime
15
16SYNOPSIS
17        #include <time.h>
18        #include <wchar.h>
19        size_t wcsftime(wchar_t *<[s]>, size_t <[maxsize]>,
20                        const wchar_t *<[format]>, const struct tm *<[timp]>);
21
22DESCRIPTION
23<<wcsftime>> is equivalent to <<strftime>>, except that:
24 
25O+
26o The argument s points to the initial element of an array of wide characters
27into which the generated output is to be placed.
28 
29o The argument maxsize indicates the limiting number of wide characters.
30 
31o The argument format is a wide-character string and the conversion specifiers
32are replaced by corresponding sequences of wide characters.
33 
34o The return value indicates the number of wide characters.
35O-
36(The difference in all of the above being wide characters versus regular
37characters.)
38 
39See <<strftime>> for the details of the format specifiers.
40
41RETURNS
42When the formatted time takes up no more than <[maxsize]> wide characters,
43the result is the length of the formatted wide string.  Otherwise, if the
44formatting operation was abandoned due to lack of room, the result is
45<<0>>, and the wide-character string starting at <[s]> corresponds to just those
46parts of <<*<[format]>>> that could be completely filled in within the
47<[maxsize]> limit.
48
49PORTABILITY
50C99 and POSIX require <<wcsftime>>, but do not specify the contents of
51<<*<[s]>>> when the formatted string would require more than
52<[maxsize]> characters.  Unrecognized specifiers and fields of
53<<timp>> that are out of range cause undefined results.  Since some
54formats expand to 0 bytes, it is wise to set <<*<[s]>>> to a nonzero
55value beforehand to distinguish between failure and an empty string.
56This implementation does not support <<s>> being NULL, nor overlapping
57<<s>> and <<format>>.
58
59<<wcsftime>> requires no supporting OS subroutines.
60
61SEEALSO
62<<strftime>>
63*/
64
65#include <time.h>
66#include <wchar.h>
67#define MAKE_WCSFTIME
68#include "../time/strftime.c"
Note: See TracBrowser for help on using the repository browser.