LibTIFF 4.7.2
TIFF library public API and implementation reference
Loading...
Searching...
No Matches
tif_warning.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 1988-1997 Sam Leffler
3 * Copyright (c) 1991-1997 Silicon Graphics, Inc.
4 *
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that (i) the above copyright notices and this permission notice appear in
8 * all copies of the software and related documentation, and (ii) the names of
9 * Sam Leffler and Silicon Graphics may not be used in any advertising or
10 * publicity relating to the software without the specific, prior written
11 * permission of Sam Leffler and Silicon Graphics.
12 *
13 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16 *
17 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22 * OF THIS SOFTWARE.
23 */
24
25/*
26 * TIFF Library.
27 */
33#include "tiffiop.h"
34
36
43
50
51void TIFFWarning(const char *module, const char *fmt, ...)
52{
53 va_list ap;
55 {
56 va_start(ap, fmt);
57 (*_TIFFwarningHandler)(module, fmt, ap);
58 va_end(ap);
59 }
61 {
62 va_start(ap, fmt);
63 (*_TIFFwarningHandlerExt)(0, module, fmt, ap);
64 va_end(ap);
65 }
66}
67
68void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt, ...)
69{
70 va_list ap;
72 {
73 va_start(ap, fmt);
74 (*_TIFFwarningHandler)(module, fmt, ap);
75 va_end(ap);
76 }
78 {
79 va_start(ap, fmt);
80 (*_TIFFwarningHandlerExt)(fd, module, fmt, ap);
81 va_end(ap);
82 }
83}
84
85void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt, ...)
86{
87 va_list ap;
88 if (tif && tif->tif_warnhandler)
89 {
90 va_start(ap, fmt);
91 int stop = (*tif->tif_warnhandler)(tif, tif->tif_warnhandler_user_data,
92 module, fmt, ap);
93 va_end(ap);
94 if (stop)
95 return;
96 }
98 {
99 va_start(ap, fmt);
100 (*_TIFFwarningHandler)(module, fmt, ap);
101 va_end(ap);
102 }
104 {
105 va_start(ap, fmt);
106 (*_TIFFwarningHandlerExt)(tif ? tif->tif_clientdata : 0, module, fmt,
107 ap);
108 va_end(ap);
109 }
110}
TIFFErrorHandler _TIFFwarningHandler
Store the global warning callback.
Definition tif_unix.c:530
TIFFErrorHandlerExt _TIFFwarningHandlerExt
Store the global extended warning callback.
Definition tif_warning.c:35
void(* TIFFErrorHandlerExt)(thandle_t fd, const char *module, const char *fmt, va_list ap)
Handle a library-wide error or warning diagnostic.
Definition tiffio.h:858
void TIFFWarningExtR(TIFF *tif, const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:85
void TIFFWarningExt(thandle_t fd, const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:68
void TIFFWarning(const char *module, const char *fmt,...)
Dispatch a warning diagnostic to the configured handlers.
Definition tif_warning.c:51
TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt handler)
Replace the library-wide warning extended handler.
Definition tif_warning.c:44
void(* TIFFErrorHandler)(const char *module, const char *fmt, va_list ap)
Handle a library-wide error or warning diagnostic.
Definition tiffio.h:835
TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler handler)
Replace the library-wide warning handler.
Definition tif_warning.c:37
void * thandle_t
Carry an opaque client I/O context through library callbacks.
Definition tiffio.h:161
Hold private state for one open TIFF library instance.
Definition tiffiop.h:389
thandle_t tif_clientdata
Client I/O context passed unchanged to the I/O callbacks.
Definition tiffiop.h:712
TIFFErrorHandlerExtR tif_warnhandler
Per-handle warning callback, or NULL for the default handling path.
Definition tiffiop.h:765
void * tif_warnhandler_user_data
Borrowed context passed to tif_warnhandler.
Definition tiffiop.h:767
Declare private library state, callbacks, and implementation helpers.