[devel] Added exported png_longjmp() function.
diff --git a/ANNOUNCE b/ANNOUNCE
index 5a49f37..eab158c 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -58,6 +58,7 @@
     wherever png_snprintf() is used to construct error and warning messages.
   Noted in scripts/makefile.mingw that it expects to be run under MSYS.
   Removed obsolete unused MMX-querying support from contrib/gregbook
+  Added exported png_longjmp() function.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/CHANGES b/CHANGES
index 76501ca..480dc79 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2534,6 +2534,7 @@
   Changed #ifdef PNG_NO_STDIO_SUPPORTED to #ifdef PNG_NO_CONSOLE_IO_SUPPORTED
     wherever png_snprintf() is used to construct error and warning messages.
   Removed obsolete unused MMX-querying support from contrib/gregbook
+  Added exported png_longjmp() function.
 
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
diff --git a/contrib/gregbook/readpng2.c b/contrib/gregbook/readpng2.c
index eb53030..5dd6d7c 100644
--- a/contrib/gregbook/readpng2.c
+++ b/contrib/gregbook/readpng2.c
@@ -480,5 +480,5 @@
         exit(99);
     }
 
-    longjmp(mainprog_ptr->jmpbuf, 1);
+    png_longjmp(mainprog_ptr, 1);
 }
diff --git a/contrib/gregbook/writepng.c b/contrib/gregbook/writepng.c
index e6d81ea..7b32aad 100644
--- a/contrib/gregbook/writepng.c
+++ b/contrib/gregbook/writepng.c
@@ -388,5 +388,5 @@
         exit(99);
     }
 
-    longjmp(mainprog_ptr->jmpbuf, 1);
+    png_longjmp(mainprog_ptr, 1);
 }
diff --git a/libpng-1.5.0beta07.txt b/libpng-1.5.0beta07.txt
index 73e49d9..1f62b18 100644
--- a/libpng-1.5.0beta07.txt
+++ b/libpng-1.5.0beta07.txt
@@ -1,6 +1,6 @@
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.5.0beta07 - February 14, 2010
+ libpng version 1.5.0beta07 - February 19, 2010
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2009 Glenn Randers-Pehrson
@@ -11,7 +11,7 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.5.0beta07 - February 14, 2010
+ libpng versions 0.97, January 1998, through 1.5.0beta07 - February 19, 2010
  Updated and distributed by Glenn Randers-Pehrson
  Copyright (c) 1998-2009 Glenn Randers-Pehrson
 
@@ -3245,7 +3245,7 @@
 
 XIII. Y2K Compliance in libpng
 
-February 14, 2010
+February 19, 2010
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
diff --git a/libpng.3 b/libpng.3
index a411801..28d3696 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,4 +1,4 @@
-.TH LIBPNG 3 "February 14, 2010"
+.TH LIBPNG 3 "February 19, 2010"
 .SH NAME
 libpng \- Portable Network Graphics (PNG) Reference Library 1.5.0beta07
 .SH SYNOPSIS
@@ -338,6 +338,10 @@
 
 \fI\fB
 
+\fBvoid png_longjmp (png_structp \fP\fIpng_ptr\fP\fB, int \fIval\fP\fB);\fP
+
+\fI\fB
+
 \fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
 
 \fI\fB
@@ -785,7 +789,7 @@
 .SH LIBPNG.TXT
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.5.0beta07 - February 14, 2010
+ libpng version 1.5.0beta07 - February 19, 2010
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2009 Glenn Randers-Pehrson
@@ -796,7 +800,7 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.5.0beta07 - February 14, 2010
+ libpng versions 0.97, January 1998, through 1.5.0beta07 - February 19, 2010
  Updated and distributed by Glenn Randers-Pehrson
  Copyright (c) 1998-2009 Glenn Randers-Pehrson
 
@@ -4030,7 +4034,7 @@
 
 .SH XIII. Y2K Compliance in libpng
 
-February 14, 2010
+February 19, 2010
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
@@ -4268,7 +4272,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.5.0beta07 - February 14, 2010:
+Libpng version 1.5.0beta07 - February 19, 2010:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -4291,7 +4295,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.2.6, August 15, 2004, through 1.5.0beta07, February 14, 2010, are
+libpng versions 1.2.6, August 15, 2004, through 1.5.0beta07, February 19, 2010, are
 Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -4390,7 +4394,7 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-February 14, 2010
+February 19, 2010
 
 .\" end of man page
 
diff --git a/png.h b/png.h
index ff73f19..01bb32d 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.5.0beta07 - February 14, 2010
+ * libpng version 1.5.0beta07 - February 19, 2010
  * Copyright (c) 1998-2010 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -11,7 +11,7 @@
  * Authors and maintainers:
  *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *  libpng versions 0.97, January 1998, through 1.5.0beta07 - February 14, 2010: Glenn
+ *  libpng versions 0.97, January 1998, through 1.5.0beta07 - February 19, 2010: Glenn
  *  See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -169,7 +169,7 @@
  *
  * This code is released under the libpng license.
  *
- * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta07, February 14, 2010, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta07, February 19, 2010, are
  * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
  * distributed according to the same disclaimer and license as libpng-1.2.5
  * with the following individual added to the list of Contributing Authors:
@@ -281,7 +281,7 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    February 14, 2010
+ *    February 19, 2010
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
@@ -345,7 +345,7 @@
 /* Version information for png.h - this should match the version in png.c */
 #define PNG_LIBPNG_VER_STRING "1.5.0beta07"
 #define PNG_HEADER_VERSION_STRING \
-   " libpng version 1.5.0beta07 - February 14, 2010\n"
+   " libpng version 1.5.0beta07 - February 19, 2010\n"
 
 #define PNG_LIBPNG_VER_SONUM   15
 #define PNG_LIBPNG_VER_DLLNUM  15
@@ -863,6 +863,12 @@
 #  define png_jmpbuf(png_ptr) \
    (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP)
 #endif
+/* This function should be used by libpng applications in place of
+ * longjmp(png_ptr->jmpbuf, val).  If longjmp_fn() has been set, it
+ * will use it; otherwise it will call PNG_ABORT().  This function was
+ * added in libpng-1.5.0.
+ */
+extern PNG_EXPORT(void, png_longjmp) PNGARG((png_structp png_ptr, int val));
 
 /* Reset the compression stream */
 extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
diff --git a/pngerror.c b/pngerror.c
index fa926d2..f5f7b06 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,7 +1,7 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.5.0 [February 14, 2010]
+ * Last changed in libpng 1.5.0 [February 19, 2010]
  * Copyright (c) 1998-2010 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -289,7 +289,15 @@
       fprintf(stderr, PNG_STRING_NEWLINE);
    }
 #endif
+   png_longjmp(png_ptr, 1);
+#ifndef PNG_CONSOLE_IO_SUPPORTED
+   error_message = error_message; /* Make compiler happy */
+#endif
+}
 
+void PNGAPI
+png_longjmp(png_structp png_ptr, int val)
+{
 #ifdef PNG_SETJMP_SUPPORTED
    if (png_ptr && png_ptr->longjmp_fn)
    {
@@ -297,18 +305,15 @@
    {
       jmp_buf jmpbuf;
       png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf));
-     png_ptr->longjmp_fn(jmpbuf, 1);
+     png_ptr->longjmp_fn(jmpbuf, val);
    }
 #  else
-   png_ptr->longjmp_fn(png_ptr->jmpbuf, 1);
+   png_ptr->longjmp_fn(png_ptr->jmpbuf, val);
 #  endif
    }
 #endif
    /* Here if not setjmp support or if png_ptr is null. */
    PNG_ABORT();
-#ifndef PNG_CONSOLE_IO_SUPPORTED
-   error_message = error_message; /* Make compiler happy */
-#endif
 }
 
 #ifdef PNG_WARNINGS_SUPPORTED