43 lines
1.1 KiB
C
43 lines
1.1 KiB
C
static char sccsid[] = "@(#)27 1.11 src/bos/usr/ccs/lib/libc/NLsprintf.c, libcprnt, bos411, 9428A410j 6/16/90 01:29:07";
|
|
/*
|
|
* COMPONENT_NAME: (LIBCPRNT) Standard C Library Print Functions
|
|
*
|
|
* FUNCTIONS: NLsprintf
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
/*LINTLIBRARY*/
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
#include <values.h>
|
|
|
|
extern int _doprnt();
|
|
|
|
int
|
|
NLsprintf(char *string, char *format, ...)
|
|
{
|
|
register int count;
|
|
FILE siop;
|
|
va_list ap;
|
|
|
|
siop._cnt = MAXINT;
|
|
siop._base = siop._ptr = (unsigned char *)string;
|
|
siop._flag = (_IOWRT|_IONOFD);
|
|
va_start(ap, format);
|
|
count = _doprnt(format, ap, &siop);
|
|
va_end(ap);
|
|
*siop._ptr = '\0'; /* plant terminating null character */
|
|
return(count);
|
|
}
|