/*
 * Copyright (c) 2004, 2005 Sendmail, Inc. and its suppliers.
 *	All rights reserved.
 *
 * 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/generic.h"
SM_RCSID("@(#)$Id: sm-conf-prterr.c,v 1.4 2007/04/24 03:07:51 ca Exp $")
#include "sm/error.h"
#include "sm/assert.h"
#include "sm/io.h"
#include "sm/sm-conf.h"
#include "sm/sm-conf-prt.h"

/*
**  SM_PRT_CONFERR -- Show configuration error
**
**	Parameters:
**		fn -- filename of configuration file
**		smc -- configuration context
**		err -- error number
**		fp -- file pointer for output
**
**	Returns:
**		none.
*/

void
sm_prt_conferr(const char *fn, sm_conf_T *smc, int err, sm_file_T *fp)
{
	char buf[256];
	char const *e;

	e = NULL;
	sm_io_fprintf(fp, "%s: %s\n", fn,
		sm_conf_strerror(err, buf, sizeof buf));
	while ((e = sm_conf_syntax_error(smc, e)) != NULL)
		sm_io_fprintf(fp, "%s\n", e);
	return;
}


syntax highlighted by Code2HTML, v. 0.9.1