From: Gerd Moellmann Date: Fri, 5 Oct 2001 11:22:57 +0000 (+0000) Subject: (tiff_error_handler, tiff_warning_handler): New functions. X-Git-Tag: ttn-vms-21-2-B4~19726 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c6892044967e3c75bf231877d3e6b8c8b1486fc8;p=emacs.git (tiff_error_handler, tiff_warning_handler): New functions. (tiff_load): Install them as error and warning handler. --- 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) } +static void +tiff_error_handler (title, format, ap) + const char *title, *format; + va_list ap; +{ + char buf[512]; + int len; + + len = sprintf (buf, "TIFF error: %s ", title); + vsprintf (buf + len, format, ap); + add_to_log (buf, Qnil, Qnil); +} + + +static void +tiff_warning_handler (title, format, ap) + const char *title, *format; + va_list ap; +{ + char buf[512]; + int len; + + len = sprintf (buf, "TIFF warning: %s ", title); + vsprintf (buf + len, format, ap); + add_to_log (buf, Qnil, Qnil); +} + + /* Load TIFF image IMG for use on frame F. Value is non-zero if successful. */ @@ -9497,6 +9525,9 @@ tiff_load (f, img) file = Qnil; GCPRO1 (file); + TIFFSetErrorHandler (tiff_error_handler); + TIFFSetWarningHandler (tiff_warning_handler); + if (NILP (specified_data)) { /* Read from a file */