46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
static char sccsid[] = "@(#)16 1.13 src/bos/usr/ccs/lib/libc/NLprintf.c, libcprnt, bos411, 9428A410j 6/16/90 01:29:02";
|
|
/*
|
|
* COMPONENT_NAME: (LIBCPRNT) Standard C Library Print Functions
|
|
*
|
|
* FUNCTIONS: NLprintf
|
|
*
|
|
* 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
|
|
NLprintf(char *format, ...)
|
|
{
|
|
register int count;
|
|
va_list ap;
|
|
|
|
va_start(ap, format);
|
|
if (!(stdout->_flag & _IOWRT)) {
|
|
/* if no write flag */
|
|
if (stdout->_flag & _IORW) {
|
|
/* if ok, cause read-write */
|
|
stdout->_flag |= _IOWRT;
|
|
} else {
|
|
/* else error */
|
|
return EOF;
|
|
}
|
|
}
|
|
count = _doprnt(format, ap, stdout);
|
|
va_end(ap);
|
|
return(ferror(stdout)? EOF: count);
|
|
}
|