home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
328_02
/
wprintf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-03-17
|
711b
|
49 lines
/* wprintf
* window-limitted printf function
*
* supports all ANSI codes except total # bytes output must be < 500
*/
#include "wsys.h"
#include <stdarg.h>
int wprintf( char *format, ...) {
char *buffer;
va_list arg_ptr;
int num;
#if __TINY__
werror("WPRINTF - not supported in tiny model");
#endif /* model is other than TINY, so stack exists */
buffer = wmalloc (WPRINTF_LIMIT, "wprintf");
va_start(arg_ptr, format);
num = vsprintf(buffer, format, arg_ptr);
if (WPRINTF_LIMIT < num )
{
werror('W', "WPRINTF string too long.");
}
va_end(arg_ptr);
wputs(buffer);
free (buffer);
return(num);
}/* end of wprintf */