home *** CD-ROM | disk | FTP | other *** search
- /*================================================*/
- /* TVWPRNTF.C */
- /* */
- /* (c) Copyright 1988 Ralf Brown */
- /* All Rights Reserved */
- /* May be freely copied for noncommercial use as */
- /* long as this copyright notice is kept intact */
- /* and any changes are indicated in the comment */
- /* blocks for the functions */
- /*================================================*/
- /* Unlike most other functions, TVwin_printf() is */
- /* definitely nonportable, and requires Turbo C */
- /*================================================*/
-
- #include <stdio.h>
- #include <stdarg.h>
- #include "tvapi.h"
-
- /*================================================*/
-
- extern OBJECT _TV_printf_mutex_ ;
-
- /*================================================*/
-
- int pascal __vprinter( void pascal (*putter)(char *,int,void *),
- void *outP,
- char *format,
- va_list argP ) ;
-
- /*================================================*/
- /* printf_put internal func to output formatted */
- /* string */
- /* Ralf Brown 5/9/88 */
- /*================================================*/
-
- static void pascal printf_put( char *s, int len, void *win )
- {
- TVwin_write( *(OBJECT *)win, s, len ) ;
- }
-
- /*================================================*/
- /* TVwin_printf formatted output to window */
- /* Ralf Brown 5/9/88 */
- /*================================================*/
-
- int cdecl TVwin_printf(OBJECT win,char *format, ...)
- {
- int retval ;
-
- if (!TVisobj(_TV_printf_mutex_))
- _TV_printf_mutex_ = TVmbx_new() ;
- TVlock(_TV_printf_mutex_) ;
- retval = __vprinter( printf_put, &win, format, _va_ptr ) ;
- TVunlock(_TV_printf_mutex_) ;
- return retval ;
- }
-
- /* End of TVWPRNTF.C */
-