Update contrib.
3 * Portions Copyright (c) 1990-2006 Nokia Corporation and/or its subsidiary(-ies).
8 * Copyright (c) 1990 The Regents of the University of California.
11 * Redistribution and use in source and binary forms are permitted
12 * provided that the above copyright notice and this paragraph are
13 * duplicated in all such forms and that any documentation,
14 * advertising materials, and other materials related to such
15 * distribution and use acknowledge that the software was developed
16 * by the University of California, Berkeley. The name of the
17 * University may not be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
26 <<putchar>>---write a character (macro)
35 int putchar(int <[ch]>);
37 int _putchar_r(void *<[reent]>, int <[ch]>);
44 int _putchar_r(<[reent]>, <[ch]>)
49 <<putchar>> is a macro, defined in <<stdio.h>>. <<putchar>>
50 writes its argument to the standard output stream,
51 after converting it from an <<int>> to an <<unsigned char>>.
53 The alternate function <<_putchar_r>> is a reentrant version. The
54 extra argument <[reent]> is a pointer to a reentrancy structure.
57 If successful, <<putchar>> returns its argument <[ch]>. If an error
58 intervenes, the result is <<EOF>>. You can use `<<ferror(stdin)>>' to
62 ANSI C requires <<putchar>>; it suggests, but does not require, that
63 <<putchar>> be implemented as a macro.
65 Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
66 <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
70 * A subroutine version of the macro putchar
79 A reentrant version of putchar().
82 _putchar_r (struct _reent *ptr,int c)
84 return __sputc ((unsigned char)c, _stdout_r (ptr));
91 Write character to standard output.
92 Writes character to the current position in the standard output
93 and increases the file pointer to point to next character.
94 This routine cooresponds to: putc(character,stdout).
96 @param c Character to be written.
98 @return On Success, returns the written character.
99 On Failure, EOF is returned and errno may be set.
104 /* CHECK_INIT is (eventually) called by __swbuf. */
105 struct _reent *r = _REENT2;
107 return EOF; // Memory for library globals is not allocated (errno not set).
108 return(_putchar_r (r, c));