]> git.eshelyaron.com Git - emacs.git/commitdiff
(tiff_error_handler, tiff_warning_handler): New functions.
authorGerd Moellmann <gerd@gnu.org>
Fri, 5 Oct 2001 11:22:57 +0000 (11:22 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 5 Oct 2001 11:22:57 +0000 (11:22 +0000)
(tiff_load): Install them as error and warning handler.

src/xfns.c

index cc778d833e35e32f3e837ac28c40979da22d87d3..2273c6d223efb6b472caf75c22d2ee6c5d265cd8 100644 (file)
@@ -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 */