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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-newlib/] [newlib-1.17.0/] [newlib/] [libc/] [stdio/] [putwchar.c] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 jlechner
/*-
2
 * Copyright (c) 2002 Tim J. Robbins.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 */
26
 
27
/*
28
FUNCTION
29
<<putwchar>>---write a wide character to standard output
30
 
31
INDEX
32
        putwchar
33
INDEX
34
        _putwchar_r
35
 
36
ANSI_SYNOPSIS
37
        #include <wchar.h>
38
        wint_t putwchar(wchar_t <[wc]>);
39
 
40
        wint_t _putwchar_r(struct _reent *<[reent]>, wchar_t <[wc]>);
41
 
42
TRAD_SYNOPSIS
43
        #include <wchar.h>
44
        wint_t putwchar(<[wc]>)
45
        wchar_t <[wc]>;
46
 
47
        wint_t _putwchar_r(<[reent]>, <[wc]>)
48
        struct _reent *<[reent]>;
49
        wchar_t <[wc]>;
50
 
51
DESCRIPTION
52
The <<putwchar>> function or macro is the wide-character equivalent of
53
the <<putchar>> function. It writes the wide character wc to stdout.
54
 
55
The alternate function <<_putwchar_r>> is a reentrant version.  The
56
extra argument <[reent]> is a pointer to a reentrancy structure.
57
 
58
RETURNS
59
If successful, <<putwchar>> returns its argument <[wc]>.  If an error
60
intervenes, the result is <<EOF>>.  You can use `<<ferror(stdin)>>' to
61
query for errors.
62
 
63
PORTABILITY
64
C99
65
*/
66
 
67
#include <_ansi.h>
68
#include <reent.h>
69
#include <stdio.h>
70
#include <wchar.h>
71
#include "local.h"
72
 
73
#undef putwchar
74
 
75
wint_t
76
_DEFUN(_putwchar_r, (ptr, wc),
77
        struct _reent *ptr _AND
78
        wchar_t wc)
79
{
80
  return _fputwc_r (ptr, wc, stdout);
81
}
82
 
83
/*
84
 * Synonym for fputwc(wc, stdout).
85
 */
86
wint_t
87
_DEFUN(putwchar, (wc),
88
        wchar_t wc)
89
{
90
  _REENT_SMALL_CHECK_INIT (_REENT);
91
  return fputwc (wc, stdout);
92
}

powered by: WebSVN 2.1.0

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