:i	static char V_p_sccs_id[] = "%W% %G%";
:1#include "V.h"
#include "sys_varargs.h"
:n	extern int dbn_write;
/*
* Print a formatted message to Vout, add a newline, and do a fflush.
* This  is  like Vdmsg, but no initial stuff is added.  It is normally
* invoked conditionally via the P?() macros.
*/
/*VARARGS*/
#if USE_varargs
Vpmsg(l,fmt,va_alist)
	int  l;
	char*fmt;
	va_dcl
{	va_list argp;
	int r=0, savlvl;
#else
Vpmsg(l,fmt,ARGLIST)
	int  l;
	char*fmt;
{	int r=0, savlvl;
#endif
#if defined(USE_pthreads) && (USE_pthreads > 0)
	if (V_locking && use_pthreads) {
		pthread_lock_global_np();
:9		fprintf(Vout,"### pthread_lock_global_np()\n");
	}
#endif /*USE_pthreads*/
	savlvl = Vlvl;
	Vlvl = 0;		/* Don't try to debug the debug messages! */
	if (savlvl<1) return r;
	if (!Vout) return r;
:8  H8(fmt,strlen(fmt),"Vpmsg");
	if ((!stdiofl) && (Fileno(Vout)<3))
		return r;		/* We aren't allowed to use stdout */
#if USE_varargs
	va_start(argp);
	vfprintf(Vout,fmt,argp);
	va_end(argp);
#else /* !USE_varargs */
	fprintf(Vout,fmt,ARGLIST);
#endif /* USE_varargs */
	fputc('\n',Vout);
	fflush(Vout);
#ifndef USE_syscall	/* If defined, write() does the increment */
:n	++dbn_write;
#endif
	Vlvl = savlvl;
#if defined(USE_pthreads) && (USE_pthreads > 0)
	if (V_locking && use_pthreads) {
:9		fprintf(Vout,"### pthread_unlock_global_np()\n");
		pthread_unlock_global_np();
	}
#endif /*USE_pthreads*/
	return r;
}
