putchar.c revision 50476
131921Sbrian/*- 231921Sbrian * Copyright (c) 1990, 1993 331921Sbrian * The Regents of the University of California. All rights reserved. 431921Sbrian * 531921Sbrian * This code is derived from software contributed to Berkeley by 631921Sbrian * Chris Torek. 731921Sbrian * 831921Sbrian * Redistribution and use in source and binary forms, with or without 931921Sbrian * modification, are permitted provided that the following conditions 1031921Sbrian * are met: 1131921Sbrian * 1. Redistributions of source code must retain the above copyright 1231921Sbrian * notice, this list of conditions and the following disclaimer. 1331921Sbrian * 2. Redistributions in binary form must reproduce the above copyright 1431921Sbrian * notice, this list of conditions and the following disclaimer in the 1531921Sbrian * documentation and/or other materials provided with the distribution. 1631921Sbrian * 3. All advertising materials mentioning features or use of this software 1731921Sbrian * must display the following acknowledgement: 1831921Sbrian * This product includes software developed by the University of 1931921Sbrian * California, Berkeley and its contributors. 2031921Sbrian * 4. Neither the name of the University nor the names of its contributors 2131921Sbrian * may be used to endorse or promote products derived from this software 2231921Sbrian * without specific prior written permission. 2331921Sbrian * 2431921Sbrian * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2531921Sbrian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2650479Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2730715Sbrian * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2830715Sbrian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2931196Sbrian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3044279Sbrian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3144279Sbrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3244279Sbrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3344279Sbrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3444279Sbrian * SUCH DAMAGE. 3544279Sbrian */ 3644279Sbrian 3746085Sbrian#if defined(LIBC_SCCS) && !defined(lint) 3864698Sbrian#if 0 3964698Sbrianstatic char sccsid[] = "@(#)putchar.c 8.1 (Berkeley) 6/4/93"; 4064698Sbrian#endif 4164698Sbrianstatic const char rcsid[] = 4264698Sbrian "$FreeBSD: head/lib/libc/stdio/putchar.c 50476 1999-08-28 00:22:10Z peter $"; 4358034Sbrian#endif /* LIBC_SCCS and not lint */ 4430715Sbrian 4531121Sbrian#include <stdio.h> 4646686Sbrian#include "libc_private.h" 4737192Sbrian 4834539Sbrian#undef putchar 4937192Sbrian 5031196Sbrian/* 5130715Sbrian * A subroutine version of the macro putchar 5230715Sbrian */ 5330715Sbrianint 5446686Sbrianputchar(c) 5546686Sbrian int c; 5630715Sbrian{ 5730715Sbrian int retval; 5830715Sbrian register FILE *so = stdout; 5965210Sbrian 6037010Sbrian FLOCKFILE(so); 6130715Sbrian retval = __sputc(c, so); 6230715Sbrian FUNLOCKFILE(so); 6330715Sbrian return (retval); 6430715Sbrian} 6530715Sbrian