1N/A/*
1N/A * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
1N/A * All rights reserved.
1N/A * Copyright (c) 1990, 1993
1N/A * The Regents of the University of California. All rights reserved.
1N/A *
1N/A * This code is derived from software contributed to Berkeley by
1N/A * Chris Torek.
1N/A *
1N/A * By using this file, you agree to the terms and conditions set
1N/A * forth in the LICENSE file which can be found at the top level of
1N/A * the sendmail distribution.
1N/A */
1N/A
1N/A#pragma ident "%Z%%M% %I% %E% SMI"
1N/A
1N/A#include <sm/gen.h>
1N/ASM_RCSID("@(#)$Id: fprintf.c,v 1.15 2001/03/02 23:53:41 ca Exp $")
1N/A#include <sm/varargs.h>
1N/A#include <sm/io.h>
1N/A#include <sm/assert.h>
1N/A#include "local.h"
1N/A
1N/A/*
1N/A** SM_IO_FPRINTF -- format and print a string to a file pointer
1N/A**
1N/A** Parameters:
1N/A** fp -- file pointer to be printed to
1N/A** timeout -- time to complete print
1N/A** fmt -- markup format for the string to be printed
1N/A** ... -- additional information for 'fmt'
1N/A**
1N/A** Returns:
1N/A** Failure: returns SM_IO_EOF and sets errno
1N/A** Success: returns the number of characters o/p
1N/A*/
1N/A
1N/Aint
1N/A#if SM_VA_STD
1N/Asm_io_fprintf(SM_FILE_T *fp, int timeout, const char *fmt, ...)
1N/A#else /* SM_VA_STD */
1N/Asm_io_fprintf(fp, timeout, fmt, va_alist)
1N/A SM_FILE_T *fp;
1N/A int timeout;
1N/A char *fmt;
1N/A va_dcl
1N/A#endif /* SM_VA_STD */
1N/A{
1N/A int ret;
1N/A SM_VA_LOCAL_DECL
1N/A
1N/A SM_REQUIRE_ISA(fp, SmFileMagic);
1N/A SM_VA_START(ap, fmt);
1N/A ret = sm_io_vfprintf(fp, timeout, fmt, ap);
1N/A SM_VA_END(ap);
1N/A return ret;
1N/A}