Blame libtiff/tif_warning.c

Packit Service db44fb
/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_warning.c,v 1.2.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
Packit Service db44fb
Packit Service db44fb
/*
Packit Service db44fb
 * Copyright (c) 1988-1997 Sam Leffler
Packit Service db44fb
 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
Packit Service db44fb
 *
Packit Service db44fb
 * Permission to use, copy, modify, distribute, and sell this software and 
Packit Service db44fb
 * its documentation for any purpose is hereby granted without fee, provided
Packit Service db44fb
 * that (i) the above copyright notices and this permission notice appear in
Packit Service db44fb
 * all copies of the software and related documentation, and (ii) the names of
Packit Service db44fb
 * Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit Service db44fb
 * publicity relating to the software without the specific, prior written
Packit Service db44fb
 * permission of Sam Leffler and Silicon Graphics.
Packit Service db44fb
 * 
Packit Service db44fb
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
Packit Service db44fb
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
Packit Service db44fb
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
Packit Service db44fb
 * 
Packit Service db44fb
 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit Service db44fb
 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit Service db44fb
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit Service db44fb
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
Packit Service db44fb
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
Packit Service db44fb
 * OF THIS SOFTWARE.
Packit Service db44fb
 */
Packit Service db44fb
Packit Service db44fb
/*
Packit Service db44fb
 * TIFF Library.
Packit Service db44fb
 */
Packit Service db44fb
#include "tiffiop.h"
Packit Service db44fb
Packit Service db44fb
TIFFErrorHandlerExt _TIFFwarningHandlerExt = NULL;
Packit Service db44fb
Packit Service db44fb
TIFFErrorHandler
Packit Service db44fb
TIFFSetWarningHandler(TIFFErrorHandler handler)
Packit Service db44fb
{
Packit Service db44fb
	TIFFErrorHandler prev = _TIFFwarningHandler;
Packit Service db44fb
	_TIFFwarningHandler = handler;
Packit Service db44fb
	return (prev);
Packit Service db44fb
}
Packit Service db44fb
Packit Service db44fb
TIFFErrorHandlerExt
Packit Service db44fb
TIFFSetWarningHandlerExt(TIFFErrorHandlerExt handler)
Packit Service db44fb
{
Packit Service db44fb
	TIFFErrorHandlerExt prev = _TIFFwarningHandlerExt;
Packit Service db44fb
	_TIFFwarningHandlerExt = handler;
Packit Service db44fb
	return (prev);
Packit Service db44fb
}
Packit Service db44fb
Packit Service db44fb
void
Packit Service db44fb
TIFFWarning(const char* module, const char* fmt, ...)
Packit Service db44fb
{
Packit Service db44fb
	va_list ap;
Packit Service db44fb
	va_start(ap, fmt);
Packit Service db44fb
	if (_TIFFwarningHandler)
Packit Service db44fb
		(*_TIFFwarningHandler)(module, fmt, ap);
Packit Service db44fb
	if (_TIFFwarningHandlerExt)
Packit Service db44fb
		(*_TIFFwarningHandlerExt)(0, module, fmt, ap);
Packit Service db44fb
	va_end(ap);
Packit Service db44fb
}
Packit Service db44fb
Packit Service db44fb
void
Packit Service db44fb
TIFFWarningExt(thandle_t fd, const char* module, const char* fmt, ...)
Packit Service db44fb
{
Packit Service db44fb
	va_list ap;
Packit Service db44fb
	va_start(ap, fmt);
Packit Service db44fb
	if (_TIFFwarningHandler)
Packit Service db44fb
		(*_TIFFwarningHandler)(module, fmt, ap);
Packit Service db44fb
	if (_TIFFwarningHandlerExt)
Packit Service db44fb
		(*_TIFFwarningHandlerExt)(fd, module, fmt, ap);
Packit Service db44fb
	va_end(ap);
Packit Service db44fb
}
Packit Service db44fb
Packit Service db44fb
Packit Service db44fb
/*
Packit Service db44fb
 * Local Variables:
Packit Service db44fb
 * mode: c
Packit Service db44fb
 * c-basic-offset: 8
Packit Service db44fb
 * fill-column: 78
Packit Service db44fb
 * End:
Packit Service db44fb
 */