Files
seta75D d6fe8fe829 Init
2021-10-11 22:19:34 -03:00

45 lines
1.1 KiB
C

static char sccsid[] = "@(#)05 1.13 src/bos/usr/ccs/lib/libc/NLfprintf.c, libcprnt, bos411, 9428A410j 6/16/90 01:28:57";
/*
* COMPONENT_NAME: (LIBCPRNT) Standard C Library Print Functions
*
* FUNCTIONS: NLfprintf
*
* ORIGINS: 3, 27
*
* This module contains IBM CONFIDENTIAL code. -- (IBM
* Confidential Restricted when combined with the aggregated
* modules for this product)
* SOURCE MATERIALS
* (C) COPYRIGHT International Business Machines Corp. 1987, 1989
* All Rights Reserved
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
*/
#include <stdio.h>
#include <stdarg.h>
extern int _doprnt();
int
NLfprintf(FILE *iop, char *format, ...)
{
register int count;
va_list ap;
va_start(ap, format);
if (!(iop->_flag & _IOWRT)) {
/* if no write flag */
if (iop->_flag & _IORW) {
/* if ok, cause read-write */
iop->_flag |= _IOWRT;
} else {
/* else error */
return EOF;
}
}
count = _doprnt(format, ap, iop);
va_end(ap);
return(ferror(iop)? EOF: count);
}