diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2002-02-17 21:56:45 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2002-02-17 21:56:45 +0000 |
commit | 8449595fe97f4474b9b9a7e4edee1ef35dcff393 (patch) | |
tree | e7a33b132264d449a512ddf4a8685df097669c1d /contrib/sendmail/libsm/fprintf.c | |
parent | 289b381b31415647269c7520d881017e2dcb27f1 (diff) | |
download | FreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.zip FreeBSD-src-8449595fe97f4474b9b9a7e4edee1ef35dcff393.tar.gz |
Import sendmail 8.12.2
Diffstat (limited to 'contrib/sendmail/libsm/fprintf.c')
-rw-r--r-- | contrib/sendmail/libsm/fprintf.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/sendmail/libsm/fprintf.c b/contrib/sendmail/libsm/fprintf.c new file mode 100644 index 0000000..7193872 --- /dev/null +++ b/contrib/sendmail/libsm/fprintf.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers. + * All rights reserved. + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Chris Torek. + * + * By using this file, you agree to the terms and conditions set + * forth in the LICENSE file which can be found at the top level of + * the sendmail distribution. + */ + +#include <sm/gen.h> +SM_RCSID("@(#)$Id: fprintf.c,v 1.17 2001/09/11 04:04:48 gshapiro Exp $") +#include <sm/varargs.h> +#include <sm/io.h> +#include <sm/assert.h> +#include "local.h" + +/* +** SM_IO_FPRINTF -- format and print a string to a file pointer +** +** Parameters: +** fp -- file pointer to be printed to +** timeout -- time to complete print +** fmt -- markup format for the string to be printed +** ... -- additional information for 'fmt' +** +** Returns: +** Failure: returns SM_IO_EOF and sets errno +** Success: returns the number of characters o/p +*/ + +int +#if SM_VA_STD +sm_io_fprintf(SM_FILE_T *fp, int timeout, const char *fmt, ...) +#else /* SM_VA_STD */ +sm_io_fprintf(fp, timeout, fmt, va_alist) + SM_FILE_T *fp; + int timeout; + char *fmt; + va_dcl +#endif /* SM_VA_STD */ +{ + int ret; + SM_VA_LOCAL_DECL + + SM_REQUIRE_ISA(fp, SmFileMagic); + SM_VA_START(ap, fmt); + ret = sm_io_vfprintf(fp, timeout, fmt, ap); + SM_VA_END(ap); + return ret; +} |