OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [time/] [wcsftime.c] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
 * wcsftime.c
 * wcsftime.c
 * Original Author:     Craig Howland, for Newlib
 * Original Author:     Craig Howland, for Newlib
 *
 *
 * Source actually uses strftime.c.
 * Source actually uses strftime.c.
 * Documentation for wcsftime() here, with minimal overlap.
 * Documentation for wcsftime() here, with minimal overlap.
 */
 */
 
 
/*
/*
FUNCTION
FUNCTION
<<wcsftime>>--convert date and time to a formatted wide-character string
<<wcsftime>>--convert date and time to a formatted wide-character string
 
 
INDEX
INDEX
        wcsftime
        wcsftime
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <time.h>
        #include <time.h>
        #include <wchar.h>
        #include <wchar.h>
        size_t wcsftime(wchar_t *<[s]>, size_t <[maxsize]>,
        size_t wcsftime(wchar_t *<[s]>, size_t <[maxsize]>,
                        const wchar_t *<[format]>, const struct tm *<[timp]>);
                        const wchar_t *<[format]>, const struct tm *<[timp]>);
 
 
DESCRIPTION
DESCRIPTION
<<wcsftime>> is equivalent to <<strftime>>, except that:
<<wcsftime>> is equivalent to <<strftime>>, except that:
 
 
O+
O+
o The argument s points to the initial element of an array of wide characters
o The argument s points to the initial element of an array of wide characters
into which the generated output is to be placed.
into which the generated output is to be placed.
 
 
o The argument maxsize indicates the limiting number of wide characters.
o The argument maxsize indicates the limiting number of wide characters.
 
 
o The argument format is a wide-character string and the conversion specifiers
o The argument format is a wide-character string and the conversion specifiers
are replaced by corresponding sequences of wide characters.
are replaced by corresponding sequences of wide characters.
 
 
o The return value indicates the number of wide characters.
o The return value indicates the number of wide characters.
O-
O-
(The difference in all of the above being wide characters versus regular
(The difference in all of the above being wide characters versus regular
characters.)
characters.)
 
 
See <<strftime>> for the details of the format specifiers.
See <<strftime>> for the details of the format specifiers.
 
 
RETURNS
RETURNS
When the formatted time takes up no more than <[maxsize]> wide characters,
When the formatted time takes up no more than <[maxsize]> wide characters,
the result is the length of the formatted wide string.  Otherwise, if the
the result is the length of the formatted wide string.  Otherwise, if the
formatting operation was abandoned due to lack of room, the result is
formatting operation was abandoned due to lack of room, the result is
<<0>>, and the wide-character string starting at <[s]> corresponds to just those
<<0>>, and the wide-character string starting at <[s]> corresponds to just those
parts of <<*<[format]>>> that could be completely filled in within the
parts of <<*<[format]>>> that could be completely filled in within the
<[maxsize]> limit.
<[maxsize]> limit.
 
 
PORTABILITY
PORTABILITY
C99 and POSIX require <<wcsftime>>, but do not specify the contents of
C99 and POSIX require <<wcsftime>>, but do not specify the contents of
<<*<[s]>>> when the formatted string would require more than
<<*<[s]>>> when the formatted string would require more than
<[maxsize]> characters.  Unrecognized specifiers and fields of
<[maxsize]> characters.  Unrecognized specifiers and fields of
<<timp>> that are out of range cause undefined results.  Since some
<<timp>> that are out of range cause undefined results.  Since some
formats expand to 0 bytes, it is wise to set <<*<[s]>>> to a nonzero
formats expand to 0 bytes, it is wise to set <<*<[s]>>> to a nonzero
value beforehand to distinguish between failure and an empty string.
value beforehand to distinguish between failure and an empty string.
This implementation does not support <<s>> being NULL, nor overlapping
This implementation does not support <<s>> being NULL, nor overlapping
<<s>> and <<format>>.
<<s>> and <<format>>.
 
 
<<wcsftime>> requires no supporting OS subroutines.
<<wcsftime>> requires no supporting OS subroutines.
 
 
SEEALSO
SEEALSO
<<strftime>>
<<strftime>>
*/
*/
 
 
#include <time.h>
#include <time.h>
#include <wchar.h>
#include <wchar.h>
#define MAKE_WCSFTIME
#define MAKE_WCSFTIME
#include "../time/strftime.c"
#include "../time/strftime.c"
 
 

powered by: WebSVN 2.1.0

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