aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-10-05 11:22:57 +0000
committerGerd Moellmann2001-10-05 11:22:57 +0000
commitc6892044967e3c75bf231877d3e6b8c8b1486fc8 (patch)
tree9a94658acaa15430269c3220cce6ea7a7de654b0 /src
parentc86350b15d6b82073365950b4af1327bab0a9723 (diff)
downloademacs-c6892044967e3c75bf231877d3e6b8c8b1486fc8.tar.gz
emacs-c6892044967e3c75bf231877d3e6b8c8b1486fc8.zip
(tiff_error_handler, tiff_warning_handler): New functions.
(tiff_load): Install them as error and warning handler.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/xfns.c b/src/xfns.c
index cc778d833e3..2273c6d223e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -9474,6 +9474,34 @@ tiff_size_of_memory (data)
9474} 9474}
9475 9475
9476 9476
9477static void
9478tiff_error_handler (title, format, ap)
9479 const char *title, *format;
9480 va_list ap;
9481{
9482 char buf[512];
9483 int len;
9484
9485 len = sprintf (buf, "TIFF error: %s ", title);
9486 vsprintf (buf + len, format, ap);
9487 add_to_log (buf, Qnil, Qnil);
9488}
9489
9490
9491static void
9492tiff_warning_handler (title, format, ap)
9493 const char *title, *format;
9494 va_list ap;
9495{
9496 char buf[512];
9497 int len;
9498
9499 len = sprintf (buf, "TIFF warning: %s ", title);
9500 vsprintf (buf + len, format, ap);
9501 add_to_log (buf, Qnil, Qnil);
9502}
9503
9504
9477/* Load TIFF image IMG for use on frame F. Value is non-zero if 9505/* Load TIFF image IMG for use on frame F. Value is non-zero if
9478 successful. */ 9506 successful. */
9479 9507
@@ -9497,6 +9525,9 @@ tiff_load (f, img)
9497 file = Qnil; 9525 file = Qnil;
9498 GCPRO1 (file); 9526 GCPRO1 (file);
9499 9527
9528 TIFFSetErrorHandler (tiff_error_handler);
9529 TIFFSetWarningHandler (tiff_warning_handler);
9530
9500 if (NILP (specified_data)) 9531 if (NILP (specified_data))
9501 { 9532 {
9502 /* Read from a file */ 9533 /* Read from a file */