cairo 1.12.2-x86-mingw32 → 1.12.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

Files changed (90) hide show
  1. data/NEWS +48 -33
  2. data/README.rdoc +4 -1
  3. data/Rakefile +5 -9
  4. data/ext/cairo/depend +2 -1
  5. data/ext/cairo/extconf.rb +3 -1
  6. data/ext/cairo/rb_cairo.h +1 -1
  7. data/lib/1.8/cairo.so +0 -0
  8. data/lib/1.9/cairo.so +0 -0
  9. data/vendor/local/bin/freetype-config +2 -2
  10. data/vendor/local/bin/freetype6.dll +0 -0
  11. data/vendor/local/bin/libcairo-2.dll +0 -0
  12. data/vendor/local/bin/libcairo-gobject-2.dll +0 -0
  13. data/vendor/local/bin/libcairo-script-interpreter-2.dll +0 -0
  14. data/vendor/local/bin/libexpat-1.dll +0 -0
  15. data/vendor/local/bin/libpng14-14.dll +0 -0
  16. data/vendor/local/bin/xmlwf.exe +0 -0
  17. data/vendor/local/include/expat.h +36 -3
  18. data/vendor/local/include/freetype2/freetype/config/ftconfig.h +83 -15
  19. data/vendor/local/include/freetype2/freetype/config/ftheader.h +14 -1
  20. data/vendor/local/include/freetype2/freetype/config/ftoption.h +76 -4
  21. data/vendor/local/include/freetype2/freetype/config/ftstdlib.h +7 -6
  22. data/vendor/local/include/freetype2/freetype/freetype.h +98 -54
  23. data/vendor/local/include/freetype2/freetype/ftbbox.h +9 -1
  24. data/vendor/local/include/freetype2/freetype/ftbzip2.h +102 -0
  25. data/vendor/local/include/freetype2/freetype/ftcache.h +17 -2
  26. data/vendor/local/include/freetype2/freetype/ftchapters.h +1 -0
  27. data/vendor/local/include/freetype2/freetype/fterrdef.h +3 -2
  28. data/vendor/local/include/freetype2/freetype/fterrors.h +2 -1
  29. data/vendor/local/include/freetype2/freetype/ftgasp.h +11 -3
  30. data/vendor/local/include/freetype2/freetype/ftglyph.h +8 -1
  31. data/vendor/local/include/freetype2/freetype/ftimage.h +12 -0
  32. data/vendor/local/include/freetype2/freetype/ftmoderr.h +20 -19
  33. data/vendor/local/include/freetype2/freetype/ftoutln.h +25 -4
  34. data/vendor/local/include/freetype2/freetype/ftrender.h +8 -0
  35. data/vendor/local/include/freetype2/freetype/ftstroke.h +47 -12
  36. data/vendor/local/include/freetype2/freetype/ftsynth.h +4 -3
  37. data/vendor/local/include/freetype2/freetype/fttypes.h +2 -2
  38. data/vendor/local/include/freetype2/freetype/t1tables.h +160 -2
  39. data/vendor/local/include/freetype2/freetype/tttables.h +10 -5
  40. data/vendor/local/include/libpng14/png.h +310 -274
  41. data/vendor/local/include/libpng14/pngconf.h +82 -55
  42. data/vendor/local/include/png.h +310 -274
  43. data/vendor/local/include/pngconf.h +82 -55
  44. data/vendor/local/lib/cairo.lib +0 -0
  45. data/vendor/local/lib/expat.lib +0 -0
  46. data/vendor/local/lib/freetype.def +3 -0
  47. data/vendor/local/lib/freetype.lib +0 -0
  48. data/vendor/local/lib/libcairo-gobject.dll.a +0 -0
  49. data/vendor/local/lib/libcairo-script-interpreter.dll.a +0 -0
  50. data/vendor/local/lib/libcairo.dll.a +0 -0
  51. data/vendor/local/lib/libexpat.dll.a +0 -0
  52. data/vendor/local/lib/libfreetype.dll.a +0 -0
  53. data/vendor/local/lib/libpng.lib +0 -0
  54. data/vendor/local/lib/libpng14.dll.a +0 -0
  55. data/vendor/local/lib/pkgconfig/cairo.pc +2 -2
  56. data/vendor/local/lib/pkgconfig/freetype2.pc +2 -2
  57. data/vendor/local/lib/pkgconfig/libpng.pc +1 -1
  58. data/vendor/local/lib/pkgconfig/libpng14.pc +1 -1
  59. data/vendor/local/manifest/{cairo-dev_1.10.2-1_win32.mft → cairo-dev_1.10.2-2_win32.mft} +3 -3
  60. data/vendor/local/manifest/cairo_1.10.2-2_win32.mft +7 -0
  61. data/vendor/local/manifest/expat-dev_2.1.0-1_win32.mft +10 -0
  62. data/vendor/local/manifest/expat_2.1.0-1_win32.mft +2 -0
  63. data/vendor/local/manifest/{freetype-dev_2.4.2-1_win32.mft → freetype-dev_2.4.10-1_win32.mft} +4 -3
  64. data/vendor/local/manifest/freetype_2.4.10-1_win32.mft +2 -0
  65. data/vendor/local/manifest/{libpng-dev_1.4.3-1_win32.mft → libpng-dev_1.4.12-1_win32.mft} +3 -3
  66. data/vendor/local/manifest/libpng_1.4.12-1_win32.mft +2 -0
  67. data/vendor/local/share/doc/{cairo_1.10.2-1_win32 → cairo_1.10.2-2_win32}/COPYING +0 -0
  68. data/vendor/local/share/doc/{cairo_1.10.2-1_win32 → cairo_1.10.2-2_win32}/COPYING-LGPL-2.1 +0 -0
  69. data/vendor/local/share/doc/{cairo_1.10.2-1_win32 → cairo_1.10.2-2_win32}/COPYING-MPL-1.1 +0 -0
  70. data/vendor/local/{man → share/man}/man1/xmlwf.1 +0 -0
  71. data/vendor/local/share/man/man3/libpng.3 +288 -138
  72. data/vendor/local/share/man/man3/libpngpf.3 +5 -11
  73. data/vendor/local/share/man/man5/png.5 +2 -2
  74. data/vendor/local/src/{tml/packaging/cairo_1.10.2-1_win32.log → dieterv/packaging/cairo_1.10.2-2_win32.log} +346 -300
  75. data/vendor/local/src/dieterv/packaging/cairo_1.10.2-2_win32.sh +251 -0
  76. data/vendor/local/src/dieterv/packaging/expat_2.1.0-1_win32.log +181 -0
  77. data/vendor/local/src/{tml/packaging/expat_2.0.1-1_win32.sh → dieterv/packaging/expat_2.1.0-1_win32.sh} +20 -12
  78. data/vendor/local/src/dieterv/packaging/freetype_2.4.10-1_win32.log +363 -0
  79. data/vendor/local/src/{tml/packaging/freetype_2.4.2-1_win32.sh → dieterv/packaging/freetype_2.4.10-1_win32.sh} +10 -11
  80. data/vendor/local/src/{tml/packaging/libpng_1.4.3-1_win32.log → dieterv/packaging/libpng_1.4.12-1_win32.log} +132 -121
  81. data/vendor/local/src/{tml/packaging/libpng_1.4.3-1_win32.sh → dieterv/packaging/libpng_1.4.12-1_win32.sh} +10 -10
  82. metadata +31 -30
  83. data/vendor/local/manifest/cairo_1.10.2-1_win32.mft +0 -7
  84. data/vendor/local/manifest/expat-dev_2.0.1-1_win32.mft +0 -10
  85. data/vendor/local/manifest/expat_2.0.1-1_win32.mft +0 -2
  86. data/vendor/local/manifest/freetype_2.4.2-1_win32.mft +0 -2
  87. data/vendor/local/manifest/libpng_1.4.3-1_win32.mft +0 -2
  88. data/vendor/local/src/tml/packaging/cairo_1.10.2-1_win32.sh +0 -84
  89. data/vendor/local/src/tml/packaging/expat_2.0.1-1_win32.log +0 -188
  90. data/vendor/local/src/tml/packaging/freetype_2.4.2-1_win32.log +0 -364
@@ -1,9 +1,9 @@
1
1
 
2
2
  /* pngconf.h - machine configurable file for libpng
3
3
  *
4
- * libpng version 1.4.3 - June 26, 2010
4
+ * libpng version 1.4.12 - July 10, 2012
5
5
  * For conditions of distribution and use, see copyright notice in png.h
6
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
6
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
7
7
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
8
8
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
9
9
  *
@@ -44,14 +44,14 @@
44
44
  * includes the resource compiler for Windows DLL configurations.
45
45
  */
46
46
  #ifdef PNG_USER_CONFIG
47
+ # include "pngusr.h"
47
48
  # ifndef PNG_USER_PRIVATEBUILD
48
49
  # define PNG_USER_PRIVATEBUILD
49
50
  # endif
50
- # include "pngusr.h"
51
51
  #endif
52
52
 
53
53
  /*
54
- * If you create a private DLL you need to define in "pngusr.h" the followings:
54
+ * If you create a private DLL you should define in "pngusr.h" the following:
55
55
  * #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
56
56
  * the DLL was built>
57
57
  * e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
@@ -59,7 +59,7 @@
59
59
  * distinguish your DLL from those of the official release. These
60
60
  * correspond to the trailing letters that come after the version
61
61
  * number and must match your private DLL name>
62
- * e.g. // private DLL "libpng13gx.dll"
62
+ * e.g. // private DLL "libpng14gx.dll"
63
63
  * #define PNG_USER_DLLFNAME_POSTFIX "gx"
64
64
  *
65
65
  * The following macros are also at your disposal if you want to complete the
@@ -84,6 +84,18 @@
84
84
 
85
85
  /* End of material added to libpng-1.2.8 */
86
86
 
87
+ /* Added at libpng-1.4.6 */
88
+ #ifndef PNG_UNUSED
89
+ /* Unused formal parameter warnings are silenced using the following macro
90
+ * which is expected to have no bad effects on performance (optimizing
91
+ * compilers will probably remove it entirely). Note that if you replace
92
+ * it with something other than whitespace, you must include the terminating
93
+ * semicolon.
94
+ */
95
+ # define PNG_UNUSED(param) (void)param;
96
+ #endif
97
+ /* End of material added to libpng-1.4.6 */
98
+
87
99
  #ifndef PNG_VERSION_INFO_ONLY
88
100
 
89
101
  /* This is the size of the compression buffer, and thus the size of
@@ -269,11 +281,19 @@
269
281
  * #define PNG_NO_STDIO
270
282
  */
271
283
 
284
+ #ifdef _WIN32_WCE
285
+ # define PNG_NO_CONSOLE_IO
286
+ # define PNG_NO_STDIO
287
+ # define PNG_NO_TIME_RFC1123
288
+ # ifdef PNG_DEBUG
289
+ # undef PNG_DEBUG
290
+ # endif
291
+ #endif
292
+
272
293
  #if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED)
273
294
  # define PNG_STDIO_SUPPORTED
274
295
  #endif
275
296
 
276
-
277
297
  #ifdef PNG_BUILD_DLL
278
298
  # if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO)
279
299
  # define PNG_NO_CONSOLE_IO
@@ -439,7 +459,7 @@
439
459
 
440
460
  /* The following uses const char * instead of char * for error
441
461
  * and warning message functions, so some compilers won't complain.
442
- * If you do not want to use const, define PNG_NO_CONST here.
462
+ * If you do not want to use const, define PNG_NO_CONST.
443
463
  */
444
464
 
445
465
  #ifndef PNG_CONST
@@ -454,8 +474,10 @@
454
474
  * library that you will not be using. I wish I could figure out how to
455
475
  * automate this, but I can't do that without making it seriously hard
456
476
  * on the users. So if you are not using an ability, change the #define
457
- * to and #undef, and that part of the library will not be compiled. If
458
- * your linker can't find a function, you may want to make sure the
477
+ * to an #undef, or pass in PNG_NO_feature and that part of the library
478
+ * will not be compiled.
479
+
480
+ * If your linker can't find a function, you may want to make sure the
459
481
  * ability is defined here. Some of these depend upon some others being
460
482
  * defined. I haven't figured out all the interactions here, so you may
461
483
  * have to experiment awhile to get everything to compile. If you are
@@ -1114,7 +1136,7 @@ typedef unsigned char png_byte;
1114
1136
  #else
1115
1137
  typedef size_t png_size_t;
1116
1138
  #endif
1117
- #define png_sizeof(x) sizeof(x)
1139
+ #define png_sizeof(x) (sizeof (x))
1118
1140
 
1119
1141
  /* The following is needed for medium model support. It cannot be in the
1120
1142
  * pngpriv.h header. Needs modification for other compilers besides
@@ -1236,6 +1258,13 @@ typedef char FAR * FAR * FAR * png_charppp;
1236
1258
  # define PNG_DLL
1237
1259
  #endif
1238
1260
 
1261
+ /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
1262
+ * you may get warnings regarding the linkage of png_zalloc and png_zfree.
1263
+ * Don't ignore those warnings; you must also reset the default calling
1264
+ * convention in your compiler to match your PNGAPI, and you must build
1265
+ * zlib and your applications the same way you build libpng.
1266
+ */
1267
+
1239
1268
  #ifdef __CYGWIN__
1240
1269
  # undef PNGAPI
1241
1270
  # define PNGAPI __cdecl
@@ -1243,14 +1272,11 @@ typedef char FAR * FAR * FAR * png_charppp;
1243
1272
  # define PNG_IMPEXP
1244
1273
  #endif
1245
1274
 
1246
- #define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */
1247
-
1248
- /* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
1249
- * you may get warnings regarding the linkage of png_zalloc and png_zfree.
1250
- * Don't ignore those warnings; you must also reset the default calling
1251
- * convention in your compiler to match your PNGAPI, and you must build
1252
- * zlib and your applications the same way you build libpng.
1253
- */
1275
+ #ifdef __WATCOMC__
1276
+ # ifndef PNGAPI
1277
+ # define PNGAPI
1278
+ # endif
1279
+ #endif
1254
1280
 
1255
1281
  #if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
1256
1282
  # ifndef PNG_NO_MODULEDEF
@@ -1335,6 +1361,8 @@ typedef char FAR * FAR * FAR * png_charppp;
1335
1361
  # define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
1336
1362
  #endif
1337
1363
 
1364
+ #define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */
1365
+
1338
1366
  /* Support for compiler specific function attributes. These are used
1339
1367
  * so that where compiler support is available incorrect use of API
1340
1368
  * functions in png.h will generate compiler warnings.
@@ -1363,15 +1391,15 @@ typedef char FAR * FAR * FAR * png_charppp;
1363
1391
  # endif
1364
1392
  # ifndef PNG_ALLOCATED
1365
1393
  # define PNG_ALLOCATED __attribute__((__malloc__))
1394
+ # endif
1395
+ # ifndef PNG_DEPRECATED
1396
+ # define PNG_DEPRECATED __attribute__((__deprecated__))
1366
1397
  # endif
1367
1398
 
1368
1399
  /* This specifically protects structure members that should only be
1369
1400
  * accessed from within the library, therefore should be empty during
1370
1401
  * a library build.
1371
1402
  */
1372
- # ifndef PNG_DEPRECATED
1373
- # define PNG_DEPRECATED __attribute__((__deprecated__))
1374
- # endif
1375
1403
  # ifndef PNG_DEPSTRUCT
1376
1404
  # define PNG_DEPSTRUCT __attribute__((__deprecated__))
1377
1405
  # endif
@@ -1412,7 +1440,7 @@ typedef char FAR * FAR * FAR * png_charppp;
1412
1440
 
1413
1441
  /* memory model/platform independent fns */
1414
1442
  #ifndef PNG_ABORT
1415
- # ifdef _WINDOWS_
1443
+ # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
1416
1444
  # define PNG_ABORT() ExitProcess(0)
1417
1445
  # else
1418
1446
  # define PNG_ABORT() abort()
@@ -1433,7 +1461,8 @@ typedef char FAR * FAR * FAR * png_charppp;
1433
1461
  # define png_memset _fmemset
1434
1462
  # define png_sprintf sprintf
1435
1463
  #else
1436
- # ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
1464
+ # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
1465
+ # /* Favor Windows over C runtime fns */
1437
1466
  # define CVT_PTR(ptr) (ptr)
1438
1467
  # define CVT_PTR_NOCHECK(ptr) (ptr)
1439
1468
  # define png_strcpy lstrcpyA
@@ -1453,31 +1482,32 @@ typedef char FAR * FAR * FAR * png_charppp;
1453
1482
  # define png_memcpy memcpy
1454
1483
  # define png_memset memset
1455
1484
  # define png_sprintf sprintf
1456
- # ifndef PNG_NO_SNPRINTF
1457
- # ifdef _MSC_VER
1458
- # define png_snprintf _snprintf /* Added to v 1.2.19 */
1459
- # define png_snprintf2 _snprintf
1460
- # define png_snprintf6 _snprintf
1461
- # else
1462
- # define png_snprintf snprintf /* Added to v 1.2.19 */
1463
- # define png_snprintf2 snprintf
1464
- # define png_snprintf6 snprintf
1465
- # endif
1466
- # else
1467
- /* You don't have or don't want to use snprintf(). Caution: Using
1468
- * sprintf instead of snprintf exposes your application to accidental
1469
- * or malevolent buffer overflows. If you don't have snprintf()
1470
- * as a general rule you should provide one (you can get one from
1471
- * Portable OpenSSH).
1472
- */
1473
- # define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
1474
- # define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
1475
- # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
1476
- sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
1477
- # endif
1478
1485
  # endif
1479
1486
  #endif
1480
1487
 
1488
+ #ifndef PNG_NO_SNPRINTF
1489
+ # ifdef _MSC_VER
1490
+ # define png_snprintf _snprintf /* Added to v 1.2.19 */
1491
+ # define png_snprintf2 _snprintf
1492
+ # define png_snprintf6 _snprintf
1493
+ # else
1494
+ # define png_snprintf snprintf /* Added to v 1.2.19 */
1495
+ # define png_snprintf2 snprintf
1496
+ # define png_snprintf6 snprintf
1497
+ # endif
1498
+ #else
1499
+ /* You don't have or don't want to use snprintf(). Caution: Using
1500
+ * sprintf instead of snprintf exposes your application to accidental
1501
+ * or malevolent buffer overflows. If you don't have snprintf()
1502
+ * as a general rule you should provide one (you can get one from
1503
+ * Portable OpenSSH).
1504
+ */
1505
+ # define png_snprintf(s1,n,fmt,x1) png_sprintf(s1,fmt,x1)
1506
+ # define png_snprintf2(s1,n,fmt,x1,x2) png_sprintf(s1,fmt,x1,x2)
1507
+ # define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
1508
+ png_sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
1509
+ #endif
1510
+
1481
1511
  /* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
1482
1512
  * and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
1483
1513
  * to png_alloc_size_t are not necessary; in fact, it is recommended
@@ -1488,22 +1518,19 @@ typedef char FAR * FAR * FAR * png_charppp;
1488
1518
  * to encounter practical situations that require such conversions.
1489
1519
  */
1490
1520
  #if defined(__TURBOC__) && !defined(__FLAT__)
1491
- # define png_mem_alloc farmalloc
1492
- # define png_mem_free farfree
1493
1521
  typedef unsigned long png_alloc_size_t;
1494
1522
  #else
1495
1523
  # if defined(_MSC_VER) && defined(MAXSEG_64K)
1496
- # define png_mem_alloc(s) halloc(s, 1)
1497
- # define png_mem_free hfree
1498
1524
  typedef unsigned long png_alloc_size_t;
1499
1525
  # else
1500
- # if defined(_WINDOWS_) && (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
1501
- # define png_mem_alloc(s) HeapAlloc(GetProcessHeap(), 0, s)
1502
- # define png_mem_free(p) HeapFree(GetProcessHeap(), 0, p)
1503
- typedef DWORD png_alloc_size_t;
1526
+ /* This is an attempt to detect an old Windows system where (int) is
1527
+ * actually 16 bits, in that case png_malloc must have an argument with a
1528
+ * bigger size to accomodate the requirements of the library.
1529
+ */
1530
+ # if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
1531
+ (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
1532
+ typedef DWORD png_alloc_size_t;
1504
1533
  # else
1505
- # define png_mem_alloc malloc
1506
- # define png_mem_free free
1507
1534
  typedef png_size_t png_alloc_size_t;
1508
1535
  # endif
1509
1536
  # endif
@@ -1,8 +1,8 @@
1
1
 
2
2
  /* png.h - header file for PNG reference library
3
3
  *
4
- * libpng version 1.4.3 - June 26, 2010
5
- * Copyright (c) 1998-2010 Glenn Randers-Pehrson
4
+ * libpng version 1.4.12 - July 10, 2012
5
+ * Copyright (c) 1998-2011 Glenn Randers-Pehrson
6
6
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
7
7
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
8
8
  *
@@ -11,7 +11,7 @@
11
11
  * Authors and maintainers:
12
12
  * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
13
13
  * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
14
- * libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010: Glenn
14
+ * libpng versions 0.97, January 1998, through 1.4.12 - July 10, 2012: Glenn
15
15
  * See also "Contributing Authors", below.
16
16
  *
17
17
  * Note about libpng version numbers:
@@ -145,6 +145,31 @@
145
145
  * 1.4.3beta01-05 14 10403 14.so.14.3[.0]
146
146
  * 1.4.3rc01-03 14 10403 14.so.14.3[.0]
147
147
  * 1.4.3 14 10403 14.so.14.3[.0]
148
+ * 1.4.4beta01-08 14 10404 14.so.14.4[.0]
149
+ * 1.4.4rc01-05 14 10404 14.so.14.4[.0]
150
+ * 1.4.4 14 10404 14.so.14.4[.0]
151
+ * 1.4.5beta01-04 14 10405 14.so.14.5[.0]
152
+ * 1.4.5rc01 14 10405 14.so.14.5[.0]
153
+ * 1.4.5beta05-07 14 10405 14.so.14.5[.0]
154
+ * 1.4.5rc02-03 14 10405 14.so.14.5[.0]
155
+ * 1.4.5 14 10405 14.so.14.5[.0]
156
+ * 1.4.6beta01-07 14 10406 14.so.14.6[.0]
157
+ * 1.4.6rc01 14 10406 14.so.14.6[.0]
158
+ * 1.4.6 14 10406 14.so.14.6[.0]
159
+ * 1.4.7rc01 14 10407 14.so.14.7[.0]
160
+ * 1.4.7 14 10407 14.so.14.7[.0]
161
+ * 1.4.8beta01-05 14 10408 14.so.14.8[.0]
162
+ * 1.4.8rc01 14 10408 14.so.14.8[.0]
163
+ * 1.4.8 14 10408 14.so.14.8[.0]
164
+ * 1.4.9beta01 14 10409 14.so.14.9[.0]
165
+ * 1.4.9rc01 14 10409 14.so.14.9[.0]
166
+ * 1.4.9 14 10409 14.so.14.9[.0]
167
+ * 1.4.10beta01 14 10410 14.so.14.10[.0]
168
+ * 1.4.10rc01-02 14 10410 14.so.14.10[.0]
169
+ * 1.4.10 14 10410 14.so.14.10[.0]
170
+ * 1.4.11rc01 14 10411 14.so.14.11[.0]
171
+ * 1.4.11 14 10411 14.so.14.11[.0]
172
+ * 1.4.12 14 10412 14.so.14.12[.0]
148
173
  *
149
174
  * Henceforth the source version will match the shared-library major
150
175
  * and minor numbers; the shared-library major version number will be
@@ -154,7 +179,7 @@
154
179
  * to the source version x.y.z (leading zeros in y and z). Beta versions
155
180
  * were given the previous public release number plus a letter, until
156
181
  * version 1.0.6j; from then on they were given the upcoming public
157
- * release number plus "betaNN" or "rcN".
182
+ * release number plus "betaNN" or "rcNN".
158
183
  *
159
184
  * Binary incompatibility exists only when applications make direct access
160
185
  * to the info_ptr or png_ptr members through png.h, and the compiled
@@ -176,7 +201,7 @@
176
201
  *
177
202
  * This code is released under the libpng license.
178
203
  *
179
- * libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are
204
+ * libpng versions 1.2.6, August 15, 2004, through 1.4.12, July 10, 2012, are
180
205
  * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
181
206
  * distributed according to the same disclaimer and license as libpng-1.2.5
182
207
  * with the following individual added to the list of Contributing Authors:
@@ -288,13 +313,13 @@
288
313
  * Y2K compliance in libpng:
289
314
  * =========================
290
315
  *
291
- * June 26, 2010
316
+ * July 10, 2012
292
317
  *
293
318
  * Since the PNG Development group is an ad-hoc body, we can't make
294
319
  * an official declaration.
295
320
  *
296
321
  * This is your unofficial assurance that libpng from version 0.71 and
297
- * upward through 1.4.3 are Y2K compliant. It is my belief that earlier
322
+ * upward through 1.4.12 are Y2K compliant. It is my belief that earlier
298
323
  * versions were also Y2K compliant.
299
324
  *
300
325
  * Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -350,9 +375,9 @@
350
375
  */
351
376
 
352
377
  /* Version information for png.h - this should match the version in png.c */
353
- #define PNG_LIBPNG_VER_STRING "1.4.3"
378
+ #define PNG_LIBPNG_VER_STRING "1.4.12"
354
379
  #define PNG_HEADER_VERSION_STRING \
355
- " libpng version 1.4.3 - June 26, 2010\n"
380
+ " libpng version 1.4.12 - July 10, 2012\n"
356
381
 
357
382
  #define PNG_LIBPNG_VER_SONUM 14
358
383
  #define PNG_LIBPNG_VER_DLLNUM 14
@@ -360,7 +385,7 @@
360
385
  /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
361
386
  #define PNG_LIBPNG_VER_MAJOR 1
362
387
  #define PNG_LIBPNG_VER_MINOR 4
363
- #define PNG_LIBPNG_VER_RELEASE 3
388
+ #define PNG_LIBPNG_VER_RELEASE 12
364
389
  /* This should match the numeric part of the final component of
365
390
  * PNG_LIBPNG_VER_STRING, omitting any leading zero:
366
391
  */
@@ -382,7 +407,7 @@
382
407
  #define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
383
408
  PNG_LIBPNG_BUILD_PRIVATE */
384
409
 
385
- #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
410
+ #define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
386
411
 
387
412
  /* Careful here. At one time, Guy wanted to use 082, but that would be octal.
388
413
  * We must not include leading zeros.
@@ -390,7 +415,7 @@
390
415
  * version 1.0.0 was mis-numbered 100 instead of 10000). From
391
416
  * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
392
417
  */
393
- #define PNG_LIBPNG_VER 10403 /* 1.4.3 */
418
+ #define PNG_LIBPNG_VER 10412 /* 1.4.12 */
394
419
 
395
420
  #ifndef PNG_VERSION_INFO_ONLY
396
421
  /* Include the compression library's header */
@@ -897,6 +922,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED)
897
922
  } png_info;
898
923
 
899
924
  typedef png_info FAR * png_infop;
925
+ typedef PNG_CONST png_info FAR * png_const_infop;
900
926
  typedef png_info FAR * FAR * png_infopp;
901
927
 
902
928
  /* Maximum positive integer used in PNG is (2^31)-1 */
@@ -1017,6 +1043,7 @@ typedef png_row_info FAR * FAR * png_row_infopp;
1017
1043
  */
1018
1044
  typedef struct png_struct_def png_struct;
1019
1045
  typedef png_struct FAR * png_structp;
1046
+ typedef PNG_CONST png_struct FAR * png_const_structp;
1020
1047
 
1021
1048
  typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp));
1022
1049
  typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t));
@@ -1474,7 +1501,7 @@ struct png_struct_def
1474
1501
  /* This triggers a compiler error in png.c, if png.c and png.h
1475
1502
  * do not agree upon the version number.
1476
1503
  */
1477
- typedef png_structp version_1_4_3;
1504
+ typedef png_structp version_1_4_12;
1478
1505
 
1479
1506
  typedef png_struct FAR * FAR * png_structpp;
1480
1507
 
@@ -1485,12 +1512,12 @@ typedef png_struct FAR * FAR * png_structpp;
1485
1512
  */
1486
1513
 
1487
1514
  /* Returns the version number of the library */
1488
- extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
1515
+ PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
1489
1516
 
1490
1517
  /* Tell lib we have already handled the first <num_bytes> magic bytes.
1491
1518
  * Handling more than 8 bytes from the beginning of the file is an error.
1492
1519
  */
1493
- extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
1520
+ PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
1494
1521
  int num_bytes));
1495
1522
 
1496
1523
  /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
@@ -1498,7 +1525,7 @@ extern PNG_EXPORT(void,png_set_sig_bytes) PNGARG((png_structp png_ptr,
1498
1525
  * signature, and non-zero otherwise. Having num_to_check == 0 or
1499
1526
  * start > 7 will always fail (ie return non-zero).
1500
1527
  */
1501
- extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
1528
+ PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
1502
1529
  png_size_t num_to_check));
1503
1530
 
1504
1531
  /* Simple signature checking function. This is the same as calling
@@ -1507,19 +1534,19 @@ extern PNG_EXPORT(int,png_sig_cmp) PNGARG((png_bytep sig, png_size_t start,
1507
1534
  #define png_check_sig(sig,n) !png_sig_cmp((sig), 0, (n))
1508
1535
 
1509
1536
  /* Allocate and initialize png_ptr struct for reading, and any other memory. */
1510
- extern PNG_EXPORT(png_structp,png_create_read_struct)
1537
+ PNG_EXPORT(png_structp,png_create_read_struct)
1511
1538
  PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1512
1539
  png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED;
1513
1540
 
1514
1541
  /* Allocate and initialize png_ptr struct for writing, and any other memory */
1515
- extern PNG_EXPORT(png_structp,png_create_write_struct)
1542
+ PNG_EXPORT(png_structp,png_create_write_struct)
1516
1543
  PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1517
1544
  png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED;
1518
1545
 
1519
- extern PNG_EXPORT(png_size_t,png_get_compression_buffer_size)
1520
- PNGARG((png_structp png_ptr));
1546
+ PNG_EXPORT(png_size_t,png_get_compression_buffer_size)
1547
+ PNGARG((png_const_structp png_ptr));
1521
1548
 
1522
- extern PNG_EXPORT(void,png_set_compression_buffer_size)
1549
+ PNG_EXPORT(void,png_set_compression_buffer_size)
1523
1550
  PNGARG((png_structp png_ptr, png_size_t size));
1524
1551
 
1525
1552
  /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp
@@ -1533,7 +1560,7 @@ extern PNG_EXPORT(void,png_set_compression_buffer_size)
1533
1560
  * allocated by the library - the call will return NULL on a mismatch
1534
1561
  * indicating an ABI mismatch.
1535
1562
  */
1536
- extern PNG_EXPORT(jmp_buf*, png_set_longjmp_fn)
1563
+ PNG_EXPORT(jmp_buf*, png_set_longjmp_fn)
1537
1564
  PNGARG((png_structp png_ptr, png_longjmp_ptr longjmp_fn, size_t
1538
1565
  jmp_buf_size));
1539
1566
  # define png_jmpbuf(png_ptr) \
@@ -1545,170 +1572,170 @@ extern PNG_EXPORT(jmp_buf*, png_set_longjmp_fn)
1545
1572
 
1546
1573
  #ifdef PNG_READ_SUPPORTED
1547
1574
  /* Reset the compression stream */
1548
- extern PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
1575
+ PNG_EXPORT(int,png_reset_zstream) PNGARG((png_structp png_ptr));
1549
1576
  #endif
1550
1577
 
1551
1578
  /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */
1552
1579
  #ifdef PNG_USER_MEM_SUPPORTED
1553
- extern PNG_EXPORT(png_structp,png_create_read_struct_2)
1580
+ PNG_EXPORT(png_structp,png_create_read_struct_2)
1554
1581
  PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1555
1582
  png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
1556
1583
  png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED;
1557
- extern PNG_EXPORT(png_structp,png_create_write_struct_2)
1584
+ PNG_EXPORT(png_structp,png_create_write_struct_2)
1558
1585
  PNGARG((png_const_charp user_png_ver, png_voidp error_ptr,
1559
1586
  png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr,
1560
1587
  png_malloc_ptr malloc_fn, png_free_ptr free_fn)) PNG_ALLOCATED;
1561
1588
  #endif
1562
1589
 
1563
1590
  /* Write the PNG file signature. */
1564
- extern PNG_EXPORT(void,png_write_sig) PNGARG((png_structp png_ptr));
1591
+ PNG_EXPORT(void,png_write_sig) PNGARG((png_structp png_ptr));
1565
1592
 
1566
1593
  /* Write a PNG chunk - size, type, (optional) data, CRC. */
1567
- extern PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr,
1594
+ PNG_EXPORT(void,png_write_chunk) PNGARG((png_structp png_ptr,
1568
1595
  png_bytep chunk_name, png_bytep data, png_size_t length));
1569
1596
 
1570
1597
  /* Write the start of a PNG chunk - length and chunk name. */
1571
- extern PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr,
1598
+ PNG_EXPORT(void,png_write_chunk_start) PNGARG((png_structp png_ptr,
1572
1599
  png_bytep chunk_name, png_uint_32 length));
1573
1600
 
1574
1601
  /* Write the data of a PNG chunk started with png_write_chunk_start(). */
1575
- extern PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr,
1602
+ PNG_EXPORT(void,png_write_chunk_data) PNGARG((png_structp png_ptr,
1576
1603
  png_bytep data, png_size_t length));
1577
1604
 
1578
1605
  /* Finish a chunk started with png_write_chunk_start() (includes CRC). */
1579
- extern PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));
1606
+ PNG_EXPORT(void,png_write_chunk_end) PNGARG((png_structp png_ptr));
1580
1607
 
1581
1608
  /* Allocate and initialize the info structure */
1582
- extern PNG_EXPORT(png_infop,png_create_info_struct)
1609
+ PNG_EXPORT(png_infop,png_create_info_struct)
1583
1610
  PNGARG((png_structp png_ptr)) PNG_ALLOCATED;
1584
1611
 
1585
- extern PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
1612
+ PNG_EXPORT(void,png_info_init_3) PNGARG((png_infopp info_ptr,
1586
1613
  png_size_t png_info_struct_size));
1587
1614
 
1588
1615
  /* Writes all the PNG information before the image. */
1589
- extern PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
1616
+ PNG_EXPORT(void,png_write_info_before_PLTE) PNGARG((png_structp png_ptr,
1590
1617
  png_infop info_ptr));
1591
- extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
1618
+ PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
1592
1619
  png_infop info_ptr));
1593
1620
 
1594
1621
  #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1595
1622
  /* Read the information before the actual image data. */
1596
- extern PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
1623
+ PNG_EXPORT(void,png_read_info) PNGARG((png_structp png_ptr,
1597
1624
  png_infop info_ptr));
1598
1625
  #endif
1599
1626
 
1600
1627
  #ifdef PNG_TIME_RFC1123_SUPPORTED
1601
- extern PNG_EXPORT(png_charp,png_convert_to_rfc1123)
1628
+ PNG_EXPORT(png_charp,png_convert_to_rfc1123)
1602
1629
  PNGARG((png_structp png_ptr, png_timep ptime));
1603
1630
  #endif
1604
1631
 
1605
1632
  #ifdef PNG_CONVERT_tIME_SUPPORTED
1606
1633
  /* Convert from a struct tm to png_time */
1607
- extern PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
1634
+ PNG_EXPORT(void,png_convert_from_struct_tm) PNGARG((png_timep ptime,
1608
1635
  struct tm FAR * ttime));
1609
1636
 
1610
1637
  /* Convert from time_t to png_time. Uses gmtime() */
1611
- extern PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
1638
+ PNG_EXPORT(void,png_convert_from_time_t) PNGARG((png_timep ptime,
1612
1639
  time_t ttime));
1613
1640
  #endif /* PNG_CONVERT_tIME_SUPPORTED */
1614
1641
 
1615
1642
  #ifdef PNG_READ_EXPAND_SUPPORTED
1616
1643
  /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */
1617
- extern PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
1618
- extern PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
1644
+ PNG_EXPORT(void,png_set_expand) PNGARG((png_structp png_ptr));
1645
+ PNG_EXPORT(void,png_set_expand_gray_1_2_4_to_8) PNGARG((png_structp
1619
1646
  png_ptr));
1620
- extern PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
1621
- extern PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
1647
+ PNG_EXPORT(void,png_set_palette_to_rgb) PNGARG((png_structp png_ptr));
1648
+ PNG_EXPORT(void,png_set_tRNS_to_alpha) PNGARG((png_structp png_ptr));
1622
1649
  #endif
1623
1650
 
1624
1651
  #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
1625
1652
  /* Use blue, green, red order for pixels. */
1626
- extern PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
1653
+ PNG_EXPORT(void,png_set_bgr) PNGARG((png_structp png_ptr));
1627
1654
  #endif
1628
1655
 
1629
1656
  #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
1630
1657
  /* Expand the grayscale to 24-bit RGB if necessary. */
1631
- extern PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
1658
+ PNG_EXPORT(void,png_set_gray_to_rgb) PNGARG((png_structp png_ptr));
1632
1659
  #endif
1633
1660
 
1634
1661
  #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
1635
1662
  /* Reduce RGB to grayscale. */
1636
1663
  #ifdef PNG_FLOATING_POINT_SUPPORTED
1637
- extern PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
1664
+ PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr,
1638
1665
  int error_action, double red, double green ));
1639
1666
  #endif
1640
- extern PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
1667
+ PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr,
1641
1668
  int error_action, png_fixed_point red, png_fixed_point green ));
1642
- extern PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp
1669
+ PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_const_structp
1643
1670
  png_ptr));
1644
1671
  #endif
1645
1672
 
1646
- extern PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
1673
+ PNG_EXPORT(void,png_build_grayscale_palette) PNGARG((int bit_depth,
1647
1674
  png_colorp palette));
1648
1675
 
1649
1676
  #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
1650
- extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
1677
+ PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
1651
1678
  #endif
1652
1679
 
1653
1680
  #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \
1654
1681
  defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED)
1655
- extern PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));
1682
+ PNG_EXPORT(void,png_set_swap_alpha) PNGARG((png_structp png_ptr));
1656
1683
  #endif
1657
1684
 
1658
1685
  #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
1659
1686
  defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
1660
- extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
1687
+ PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
1661
1688
  #endif
1662
1689
 
1663
1690
  #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
1664
1691
  /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */
1665
- extern PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
1692
+ PNG_EXPORT(void,png_set_filler) PNGARG((png_structp png_ptr,
1666
1693
  png_uint_32 filler, int flags));
1667
1694
  /* The values of the PNG_FILLER_ defines should NOT be changed */
1668
1695
  #define PNG_FILLER_BEFORE 0
1669
1696
  #define PNG_FILLER_AFTER 1
1670
1697
  /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */
1671
- extern PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
1698
+ PNG_EXPORT(void,png_set_add_alpha) PNGARG((png_structp png_ptr,
1672
1699
  png_uint_32 filler, int flags));
1673
1700
  #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */
1674
1701
 
1675
1702
  #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
1676
1703
  /* Swap bytes in 16-bit depth files. */
1677
- extern PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));
1704
+ PNG_EXPORT(void,png_set_swap) PNGARG((png_structp png_ptr));
1678
1705
  #endif
1679
1706
 
1680
1707
  #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
1681
1708
  /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */
1682
- extern PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));
1709
+ PNG_EXPORT(void,png_set_packing) PNGARG((png_structp png_ptr));
1683
1710
  #endif
1684
1711
 
1685
1712
  #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \
1686
1713
  defined(PNG_WRITE_PACKSWAP_SUPPORTED)
1687
1714
  /* Swap packing order of pixels in bytes. */
1688
- extern PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));
1715
+ PNG_EXPORT(void,png_set_packswap) PNGARG((png_structp png_ptr));
1689
1716
  #endif
1690
1717
 
1691
1718
  #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED)
1692
1719
  /* Converts files to legal bit depths. */
1693
- extern PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr,
1720
+ PNG_EXPORT(void,png_set_shift) PNGARG((png_structp png_ptr,
1694
1721
  png_color_8p true_bits));
1695
1722
  #endif
1696
1723
 
1697
1724
  #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
1698
1725
  defined(PNG_WRITE_INTERLACING_SUPPORTED)
1699
1726
  /* Have the code handle the interlacing. Returns the number of passes. */
1700
- extern PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
1727
+ PNG_EXPORT(int,png_set_interlace_handling) PNGARG((png_structp png_ptr));
1701
1728
  #endif
1702
1729
 
1703
1730
  #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
1704
1731
  /* Invert monochrome files */
1705
- extern PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
1732
+ PNG_EXPORT(void,png_set_invert_mono) PNGARG((png_structp png_ptr));
1706
1733
  #endif
1707
1734
 
1708
1735
  #ifdef PNG_READ_BACKGROUND_SUPPORTED
1709
1736
  /* Handle alpha and tRNS by replacing with a background color. */
1710
1737
  #ifdef PNG_FLOATING_POINT_SUPPORTED
1711
- extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
1738
+ PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
1712
1739
  png_color_16p background_color, int background_gamma_code,
1713
1740
  int need_expand, double background_gamma));
1714
1741
  #endif
@@ -1720,14 +1747,14 @@ extern PNG_EXPORT(void,png_set_background) PNGARG((png_structp png_ptr,
1720
1747
 
1721
1748
  #ifdef PNG_READ_16_TO_8_SUPPORTED
1722
1749
  /* Strip the second byte of information from a 16-bit depth file. */
1723
- extern PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
1750
+ PNG_EXPORT(void,png_set_strip_16) PNGARG((png_structp png_ptr));
1724
1751
  #endif
1725
1752
 
1726
1753
  #ifdef PNG_READ_QUANTIZE_SUPPORTED
1727
1754
  /* Turn on quantizing, and reduce the palette to the number of colors
1728
1755
  * available. Prior to libpng-1.4.2, this was png_set_dither().
1729
1756
  */
1730
- extern PNG_EXPORT(void,png_set_quantize) PNGARG((png_structp png_ptr,
1757
+ PNG_EXPORT(void,png_set_quantize) PNGARG((png_structp png_ptr,
1731
1758
  png_colorp palette, int num_palette, int maximum_colors,
1732
1759
  png_uint_16p histogram, int full_quantize));
1733
1760
  #endif
@@ -1737,7 +1764,7 @@ extern PNG_EXPORT(void,png_set_quantize) PNGARG((png_structp png_ptr,
1737
1764
  #ifdef PNG_READ_GAMMA_SUPPORTED
1738
1765
  /* Handle gamma correction. Screen_gamma=(display_exponent) */
1739
1766
  #ifdef PNG_FLOATING_POINT_SUPPORTED
1740
- extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
1767
+ PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
1741
1768
  double screen_gamma, double default_file_gamma));
1742
1769
  #endif
1743
1770
  #endif
@@ -1745,73 +1772,73 @@ extern PNG_EXPORT(void,png_set_gamma) PNGARG((png_structp png_ptr,
1745
1772
 
1746
1773
  #ifdef PNG_WRITE_FLUSH_SUPPORTED
1747
1774
  /* Set how many lines between output flushes - 0 for no flushing */
1748
- extern PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
1775
+ PNG_EXPORT(void,png_set_flush) PNGARG((png_structp png_ptr, int nrows));
1749
1776
  /* Flush the current PNG output buffer */
1750
- extern PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
1777
+ PNG_EXPORT(void,png_write_flush) PNGARG((png_structp png_ptr));
1751
1778
  #endif
1752
1779
 
1753
1780
  /* Optional update palette with requested transformations */
1754
- extern PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
1781
+ PNG_EXPORT(void,png_start_read_image) PNGARG((png_structp png_ptr));
1755
1782
 
1756
1783
  /* Optional call to update the users info structure */
1757
- extern PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
1784
+ PNG_EXPORT(void,png_read_update_info) PNGARG((png_structp png_ptr,
1758
1785
  png_infop info_ptr));
1759
1786
 
1760
1787
  #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1761
1788
  /* Read one or more rows of image data. */
1762
- extern PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
1789
+ PNG_EXPORT(void,png_read_rows) PNGARG((png_structp png_ptr,
1763
1790
  png_bytepp row, png_bytepp display_row, png_uint_32 num_rows));
1764
1791
  #endif
1765
1792
 
1766
1793
  #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1767
1794
  /* Read a row of data. */
1768
- extern PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
1795
+ PNG_EXPORT(void,png_read_row) PNGARG((png_structp png_ptr,
1769
1796
  png_bytep row,
1770
1797
  png_bytep display_row));
1771
1798
  #endif
1772
1799
 
1773
1800
  #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1774
1801
  /* Read the whole image into memory at once. */
1775
- extern PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
1802
+ PNG_EXPORT(void,png_read_image) PNGARG((png_structp png_ptr,
1776
1803
  png_bytepp image));
1777
1804
  #endif
1778
1805
 
1779
1806
  /* Write a row of image data */
1780
- extern PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
1807
+ PNG_EXPORT(void,png_write_row) PNGARG((png_structp png_ptr,
1781
1808
  png_bytep row));
1782
1809
 
1783
1810
  /* Write a few rows of image data */
1784
- extern PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
1811
+ PNG_EXPORT(void,png_write_rows) PNGARG((png_structp png_ptr,
1785
1812
  png_bytepp row, png_uint_32 num_rows));
1786
1813
 
1787
1814
  /* Write the image data */
1788
- extern PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
1815
+ PNG_EXPORT(void,png_write_image) PNGARG((png_structp png_ptr,
1789
1816
  png_bytepp image));
1790
1817
 
1791
1818
  /* Write the end of the PNG file. */
1792
- extern PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
1819
+ PNG_EXPORT(void,png_write_end) PNGARG((png_structp png_ptr,
1793
1820
  png_infop info_ptr));
1794
1821
 
1795
1822
  #ifdef PNG_SEQUENTIAL_READ_SUPPORTED
1796
1823
  /* Read the end of the PNG file. */
1797
- extern PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
1824
+ PNG_EXPORT(void,png_read_end) PNGARG((png_structp png_ptr,
1798
1825
  png_infop info_ptr));
1799
1826
  #endif
1800
1827
 
1801
1828
  /* Free any memory associated with the png_info_struct */
1802
- extern PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
1829
+ PNG_EXPORT(void,png_destroy_info_struct) PNGARG((png_structp png_ptr,
1803
1830
  png_infopp info_ptr_ptr));
1804
1831
 
1805
1832
  /* Free any memory associated with the png_struct and the png_info_structs */
1806
- extern PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
1833
+ PNG_EXPORT(void,png_destroy_read_struct) PNGARG((png_structpp
1807
1834
  png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr));
1808
1835
 
1809
1836
  /* Free any memory associated with the png_struct and the png_info_structs */
1810
- extern PNG_EXPORT(void,png_destroy_write_struct)
1837
+ PNG_EXPORT(void,png_destroy_write_struct)
1811
1838
  PNGARG((png_structpp png_ptr_ptr, png_infopp info_ptr_ptr));
1812
1839
 
1813
1840
  /* Set the libpng method of handling chunk CRC errors */
1814
- extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
1841
+ PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
1815
1842
  int crit_action, int ancil_action));
1816
1843
 
1817
1844
  /* Values for png_set_crc_action() to say how to handle CRC errors in
@@ -1841,7 +1868,7 @@ extern PNG_EXPORT(void,png_set_crc_action) PNGARG((png_structp png_ptr,
1841
1868
  /* Set the filtering method(s) used by libpng. Currently, the only valid
1842
1869
  * value for "method" is 0.
1843
1870
  */
1844
- extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
1871
+ PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
1845
1872
  int filters));
1846
1873
 
1847
1874
  /* Flags for png_set_filter() to say which filters to use. The flags
@@ -1898,7 +1925,7 @@ extern PNG_EXPORT(void,png_set_filter) PNGARG((png_structp png_ptr, int method,
1898
1925
  * to the UNWEIGHTED method, but with added encoding time/computation.
1899
1926
  */
1900
1927
  #ifdef PNG_FLOATING_POINT_SUPPORTED
1901
- extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
1928
+ PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
1902
1929
  int heuristic_method, int num_weights, png_doublep filter_weights,
1903
1930
  png_doublep filter_costs));
1904
1931
  #endif
@@ -1919,19 +1946,19 @@ extern PNG_EXPORT(void,png_set_filter_heuristics) PNGARG((png_structp png_ptr,
1919
1946
  * for PNG images, and do considerably fewer caclulations. In the future,
1920
1947
  * these values may not correspond directly to the zlib compression levels.
1921
1948
  */
1922
- extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
1949
+ PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
1923
1950
  int level));
1924
1951
 
1925
- extern PNG_EXPORT(void,png_set_compression_mem_level)
1952
+ PNG_EXPORT(void,png_set_compression_mem_level)
1926
1953
  PNGARG((png_structp png_ptr, int mem_level));
1927
1954
 
1928
- extern PNG_EXPORT(void,png_set_compression_strategy)
1955
+ PNG_EXPORT(void,png_set_compression_strategy)
1929
1956
  PNGARG((png_structp png_ptr, int strategy));
1930
1957
 
1931
- extern PNG_EXPORT(void,png_set_compression_window_bits)
1958
+ PNG_EXPORT(void,png_set_compression_window_bits)
1932
1959
  PNGARG((png_structp png_ptr, int window_bits));
1933
1960
 
1934
- extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
1961
+ PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
1935
1962
  int method));
1936
1963
 
1937
1964
  /* These next functions are called for input/output, memory, and error
@@ -1945,7 +1972,7 @@ extern PNG_EXPORT(void,png_set_compression_method) PNGARG((png_structp png_ptr,
1945
1972
 
1946
1973
  #ifdef PNG_STDIO_SUPPORTED
1947
1974
  /* Initialize the input/output for the PNG file to the default functions. */
1948
- extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr,
1975
+ PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr,
1949
1976
  png_FILE_p fp));
1950
1977
  #endif
1951
1978
 
@@ -1957,11 +1984,11 @@ extern PNG_EXPORT(void,png_init_io) PNGARG((png_structp png_ptr,
1957
1984
  * default function will be used.
1958
1985
  */
1959
1986
 
1960
- extern PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
1987
+ PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr,
1961
1988
  png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn));
1962
1989
 
1963
1990
  /* Return the user pointer associated with the error functions */
1964
- extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
1991
+ PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_const_structp png_ptr));
1965
1992
 
1966
1993
  /* Replace the default data output functions with a user supplied one(s).
1967
1994
  * If buffered output is not used, then output_flush_fn can be set to NULL.
@@ -1973,54 +2000,54 @@ extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
1973
2000
  * default flush function, which uses the standard *FILE structure, will
1974
2001
  * be used.
1975
2002
  */
1976
- extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
2003
+ PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
1977
2004
  png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));
1978
2005
 
1979
2006
  /* Replace the default data input function with a user supplied one. */
1980
- extern PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr,
2007
+ PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr,
1981
2008
  png_voidp io_ptr, png_rw_ptr read_data_fn));
1982
2009
 
1983
2010
  /* Return the user pointer associated with the I/O functions */
1984
- extern PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr));
2011
+ PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr));
1985
2012
 
1986
- extern PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr,
2013
+ PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr,
1987
2014
  png_read_status_ptr read_row_fn));
1988
2015
 
1989
- extern PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr,
2016
+ PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr,
1990
2017
  png_write_status_ptr write_row_fn));
1991
2018
 
1992
2019
  #ifdef PNG_USER_MEM_SUPPORTED
1993
2020
  /* Replace the default memory allocation functions with user supplied one(s). */
1994
- extern PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
2021
+ PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr,
1995
2022
  png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn));
1996
2023
  /* Return the user pointer associated with the memory functions */
1997
- extern PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr));
2024
+ PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_const_structp png_ptr));
1998
2025
  #endif
1999
2026
 
2000
2027
  #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
2001
- extern PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
2028
+ PNG_EXPORT(void,png_set_read_user_transform_fn) PNGARG((png_structp
2002
2029
  png_ptr, png_user_transform_ptr read_user_transform_fn));
2003
2030
  #endif
2004
2031
 
2005
2032
  #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
2006
- extern PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp
2033
+ PNG_EXPORT(void,png_set_write_user_transform_fn) PNGARG((png_structp
2007
2034
  png_ptr, png_user_transform_ptr write_user_transform_fn));
2008
2035
  #endif
2009
2036
 
2010
2037
  #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
2011
2038
  defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
2012
- extern PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp
2039
+ PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp
2013
2040
  png_ptr, png_voidp user_transform_ptr, int user_transform_depth,
2014
2041
  int user_transform_channels));
2015
2042
  /* Return the user pointer associated with the user transform functions */
2016
- extern PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
2017
- PNGARG((png_structp png_ptr));
2043
+ PNG_EXPORT(png_voidp,png_get_user_transform_ptr)
2044
+ PNGARG((png_const_structp png_ptr));
2018
2045
  #endif
2019
2046
 
2020
2047
  #ifdef PNG_USER_CHUNKS_SUPPORTED
2021
- extern PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
2048
+ PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr,
2022
2049
  png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn));
2023
- extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
2050
+ PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_const_structp
2024
2051
  png_ptr));
2025
2052
  #endif
2026
2053
 
@@ -2028,45 +2055,45 @@ extern PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp
2028
2055
  /* Sets the function callbacks for the push reader, and a pointer to a
2029
2056
  * user-defined structure available to the callback functions.
2030
2057
  */
2031
- extern PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr,
2058
+ PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr,
2032
2059
  png_voidp progressive_ptr,
2033
2060
  png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn,
2034
2061
  png_progressive_end_ptr end_fn));
2035
2062
 
2036
2063
  /* Returns the user pointer associated with the push read functions */
2037
- extern PNG_EXPORT(png_voidp,png_get_progressive_ptr)
2038
- PNGARG((png_structp png_ptr));
2064
+ PNG_EXPORT(png_voidp,png_get_progressive_ptr)
2065
+ PNGARG((png_const_structp png_ptr));
2039
2066
 
2040
2067
  /* Function to be called when data becomes available */
2041
- extern PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
2068
+ PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr,
2042
2069
  png_infop info_ptr, png_bytep buffer, png_size_t buffer_size));
2043
2070
 
2044
2071
  /* Function that combines rows. Not very much different than the
2045
2072
  * png_combine_row() call. Is this even used?????
2046
2073
  */
2047
- extern PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
2074
+ PNG_EXPORT(void,png_progressive_combine_row) PNGARG((png_structp png_ptr,
2048
2075
  png_bytep old_row, png_bytep new_row));
2049
2076
  #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
2050
2077
 
2051
- extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
2078
+ PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
2052
2079
  png_alloc_size_t size)) PNG_ALLOCATED;
2053
2080
  /* Added at libpng version 1.4.0 */
2054
- extern PNG_EXPORT(png_voidp,png_calloc) PNGARG((png_structp png_ptr,
2081
+ PNG_EXPORT(png_voidp,png_calloc) PNGARG((png_structp png_ptr,
2055
2082
  png_alloc_size_t size)) PNG_ALLOCATED;
2056
2083
 
2057
2084
  /* Added at libpng version 1.2.4 */
2058
- extern PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
2085
+ PNG_EXPORT(png_voidp,png_malloc_warn) PNGARG((png_structp png_ptr,
2059
2086
  png_alloc_size_t size)) PNG_ALLOCATED;
2060
2087
 
2061
2088
  /* Frees a pointer allocated by png_malloc() */
2062
- extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
2089
+ PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
2063
2090
 
2064
2091
  /* Free data that was allocated internally */
2065
- extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
2092
+ PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
2066
2093
  png_infop info_ptr, png_uint_32 free_me, int num));
2067
2094
  /* Reassign responsibility for freeing existing data, whether allocated
2068
2095
  * by libpng or by the application */
2069
- extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
2096
+ PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
2070
2097
  png_infop info_ptr, int freer, png_uint_32 mask));
2071
2098
  /* Assignments for png_data_freer */
2072
2099
  #define PNG_DESTROY_WILL_FREE_DATA 1
@@ -2088,45 +2115,45 @@ extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
2088
2115
  #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
2089
2116
 
2090
2117
  #ifdef PNG_USER_MEM_SUPPORTED
2091
- extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
2118
+ PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
2092
2119
  png_alloc_size_t size)) PNG_ALLOCATED;
2093
- extern PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
2120
+ PNG_EXPORT(void,png_free_default) PNGARG((png_structp png_ptr,
2094
2121
  png_voidp ptr));
2095
2122
  #endif
2096
2123
 
2097
2124
  #ifndef PNG_NO_ERROR_TEXT
2098
2125
  /* Fatal error in PNG image of libpng - can't continue */
2099
- extern PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
2126
+ PNG_EXPORT(void,png_error) PNGARG((png_structp png_ptr,
2100
2127
  png_const_charp error_message)) PNG_NORETURN;
2101
2128
 
2102
2129
  /* The same, but the chunk name is prepended to the error string. */
2103
- extern PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
2130
+ PNG_EXPORT(void,png_chunk_error) PNGARG((png_structp png_ptr,
2104
2131
  png_const_charp error_message)) PNG_NORETURN;
2105
2132
 
2106
2133
  #else
2107
2134
  /* Fatal error in PNG image of libpng - can't continue */
2108
- extern PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)) PNG_NORETURN;
2135
+ PNG_EXPORT(void,png_err) PNGARG((png_structp png_ptr)) PNG_NORETURN;
2109
2136
  #endif
2110
2137
 
2111
2138
  /* Non-fatal error in libpng. Can continue, but may have a problem. */
2112
- extern PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
2139
+ PNG_EXPORT(void,png_warning) PNGARG((png_structp png_ptr,
2113
2140
  png_const_charp warning_message));
2114
2141
 
2115
2142
  /* Non-fatal error in libpng, chunk name is prepended to message. */
2116
- extern PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
2143
+ PNG_EXPORT(void,png_chunk_warning) PNGARG((png_structp png_ptr,
2117
2144
  png_const_charp warning_message));
2118
2145
 
2119
2146
  #ifdef PNG_BENIGN_ERRORS_SUPPORTED
2120
2147
  /* Benign error in libpng. Can continue, but may have a problem.
2121
2148
  * User can choose whether to handle as a fatal error or as a warning. */
2122
- extern PNG_EXPORT(void,png_benign_error) PNGARG((png_structp png_ptr,
2149
+ PNG_EXPORT(void,png_benign_error) PNGARG((png_structp png_ptr,
2123
2150
  png_const_charp warning_message));
2124
2151
 
2125
2152
  /* Same, chunk name is prepended to message. */
2126
- extern PNG_EXPORT(void,png_chunk_benign_error) PNGARG((png_structp png_ptr,
2153
+ PNG_EXPORT(void,png_chunk_benign_error) PNGARG((png_structp png_ptr,
2127
2154
  png_const_charp warning_message));
2128
2155
 
2129
- extern PNG_EXPORT(void,png_set_benign_errors) PNGARG((png_structp
2156
+ PNG_EXPORT(void,png_set_benign_errors) PNGARG((png_structp
2130
2157
  png_ptr, int allowed));
2131
2158
  #endif
2132
2159
 
@@ -2143,109 +2170,109 @@ extern PNG_EXPORT(void,png_set_benign_errors) PNGARG((png_structp
2143
2170
  * png_info_struct.
2144
2171
  */
2145
2172
  /* Returns "flag" if chunk data is valid in info_ptr. */
2146
- extern PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr,
2147
- png_infop info_ptr, png_uint_32 flag));
2173
+ PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_const_structp png_ptr,
2174
+ png_const_infop info_ptr, png_uint_32 flag));
2148
2175
 
2149
2176
  /* Returns number of bytes needed to hold a transformed row. */
2150
- extern PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_structp png_ptr,
2151
- png_infop info_ptr));
2177
+ PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_const_structp png_ptr,
2178
+ png_const_infop info_ptr));
2152
2179
 
2153
2180
  #ifdef PNG_INFO_IMAGE_SUPPORTED
2154
2181
  /* Returns row_pointers, which is an array of pointers to scanlines that was
2155
2182
  * returned from png_read_png().
2156
2183
  */
2157
- extern PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr,
2158
- png_infop info_ptr));
2184
+ PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_const_structp png_ptr,
2185
+ png_const_infop info_ptr));
2159
2186
  /* Set row_pointers, which is an array of pointers to scanlines for use
2160
2187
  * by png_write_png().
2161
2188
  */
2162
- extern PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
2189
+ PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr,
2163
2190
  png_infop info_ptr, png_bytepp row_pointers));
2164
2191
  #endif
2165
2192
 
2166
2193
  /* Returns number of color channels in image. */
2167
- extern PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr,
2168
- png_infop info_ptr));
2194
+ PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_const_structp png_ptr,
2195
+ png_const_infop info_ptr));
2169
2196
 
2170
2197
  #ifdef PNG_EASY_ACCESS_SUPPORTED
2171
2198
  /* Returns image width in pixels. */
2172
- extern PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp
2173
- png_ptr, png_infop info_ptr));
2199
+ PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_const_structp
2200
+ png_ptr, png_const_infop info_ptr));
2174
2201
 
2175
2202
  /* Returns image height in pixels. */
2176
- extern PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp
2177
- png_ptr, png_infop info_ptr));
2203
+ PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_const_structp
2204
+ png_ptr, png_const_infop info_ptr));
2178
2205
 
2179
2206
  /* Returns image bit_depth. */
2180
- extern PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp
2181
- png_ptr, png_infop info_ptr));
2207
+ PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_const_structp
2208
+ png_ptr, png_const_infop info_ptr));
2182
2209
 
2183
2210
  /* Returns image color_type. */
2184
- extern PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp
2185
- png_ptr, png_infop info_ptr));
2211
+ PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_const_structp
2212
+ png_ptr, png_const_infop info_ptr));
2186
2213
 
2187
2214
  /* Returns image filter_type. */
2188
- extern PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp
2189
- png_ptr, png_infop info_ptr));
2215
+ PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_const_structp
2216
+ png_ptr, png_const_infop info_ptr));
2190
2217
 
2191
2218
  /* Returns image interlace_type. */
2192
- extern PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp
2193
- png_ptr, png_infop info_ptr));
2219
+ PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_const_structp
2220
+ png_ptr, png_const_infop info_ptr));
2194
2221
 
2195
2222
  /* Returns image compression_type. */
2196
- extern PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp
2197
- png_ptr, png_infop info_ptr));
2223
+ PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_const_structp
2224
+ png_ptr, png_const_infop info_ptr));
2198
2225
 
2199
2226
  /* Returns image resolution in pixels per meter, from pHYs chunk data. */
2200
- extern PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp
2201
- png_ptr, png_infop info_ptr));
2202
- extern PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp
2203
- png_ptr, png_infop info_ptr));
2204
- extern PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp
2205
- png_ptr, png_infop info_ptr));
2227
+ PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_const_structp
2228
+ png_ptr, png_const_infop info_ptr));
2229
+ PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_const_structp
2230
+ png_ptr, png_const_infop info_ptr));
2231
+ PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_const_structp
2232
+ png_ptr, png_const_infop info_ptr));
2206
2233
 
2207
2234
  /* Returns pixel aspect ratio, computed from pHYs chunk data. */
2208
2235
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2209
- extern PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp
2210
- png_ptr, png_infop info_ptr));
2236
+ PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_const_structp
2237
+ png_ptr, png_const_infop info_ptr));
2211
2238
  #endif
2212
2239
 
2213
2240
  /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */
2214
- extern PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp
2215
- png_ptr, png_infop info_ptr));
2216
- extern PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp
2217
- png_ptr, png_infop info_ptr));
2218
- extern PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp
2219
- png_ptr, png_infop info_ptr));
2220
- extern PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp
2221
- png_ptr, png_infop info_ptr));
2241
+ PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_const_structp
2242
+ png_ptr, png_const_infop info_ptr));
2243
+ PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_const_structp
2244
+ png_ptr, png_const_infop info_ptr));
2245
+ PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_const_structp
2246
+ png_ptr, png_const_infop info_ptr));
2247
+ PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_const_structp
2248
+ png_ptr, png_const_infop info_ptr));
2222
2249
 
2223
2250
  #endif /* PNG_EASY_ACCESS_SUPPORTED */
2224
2251
 
2225
2252
  /* Returns pointer to signature string read from PNG header */
2226
- extern PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr,
2227
- png_infop info_ptr));
2253
+ PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_const_structp png_ptr,
2254
+ png_infop info_ptr));
2228
2255
 
2229
2256
  #ifdef PNG_bKGD_SUPPORTED
2230
- extern PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr,
2257
+ PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_const_structp png_ptr,
2231
2258
  png_infop info_ptr, png_color_16p *background));
2232
2259
  #endif
2233
2260
 
2234
2261
  #ifdef PNG_bKGD_SUPPORTED
2235
- extern PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
2262
+ PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr,
2236
2263
  png_infop info_ptr, png_color_16p background));
2237
2264
  #endif
2238
2265
 
2239
2266
  #ifdef PNG_cHRM_SUPPORTED
2240
2267
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2241
- extern PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr,
2242
- png_infop info_ptr, double *white_x, double *white_y, double *red_x,
2268
+ PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_const_structp png_ptr,
2269
+ png_const_infop info_ptr, double *white_x, double *white_y, double *red_x,
2243
2270
  double *red_y, double *green_x, double *green_y, double *blue_x,
2244
2271
  double *blue_y));
2245
2272
  #endif
2246
2273
  #ifdef PNG_FIXED_POINT_SUPPORTED
2247
- extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
2248
- png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
2274
+ PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_const_structp png_ptr,
2275
+ png_const_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point
2249
2276
  *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y,
2250
2277
  png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point
2251
2278
  *int_blue_x, png_fixed_point *int_blue_y));
@@ -2254,12 +2281,12 @@ extern PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr,
2254
2281
 
2255
2282
  #ifdef PNG_cHRM_SUPPORTED
2256
2283
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2257
- extern PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
2284
+ PNG_EXPORT(void,png_set_cHRM) PNGARG((png_structp png_ptr,
2258
2285
  png_infop info_ptr, double white_x, double white_y, double red_x,
2259
2286
  double red_y, double green_x, double green_y, double blue_x, double blue_y));
2260
2287
  #endif
2261
2288
  #ifdef PNG_FIXED_POINT_SUPPORTED
2262
- extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
2289
+ PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
2263
2290
  png_infop info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y,
2264
2291
  png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
2265
2292
  int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
@@ -2269,132 +2296,132 @@ extern PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr,
2269
2296
 
2270
2297
  #ifdef PNG_gAMA_SUPPORTED
2271
2298
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2272
- extern PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr,
2273
- png_infop info_ptr, double *file_gamma));
2299
+ PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_const_structp png_ptr,
2300
+ png_const_infop info_ptr, double *file_gamma));
2274
2301
  #endif
2275
- extern PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr,
2276
- png_infop info_ptr, png_fixed_point *int_file_gamma));
2302
+ PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_const_structp png_ptr,
2303
+ png_const_infop info_ptr, png_fixed_point *int_file_gamma));
2277
2304
  #endif
2278
2305
 
2279
2306
  #ifdef PNG_gAMA_SUPPORTED
2280
2307
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2281
- extern PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
2308
+ PNG_EXPORT(void,png_set_gAMA) PNGARG((png_structp png_ptr,
2282
2309
  png_infop info_ptr, double file_gamma));
2283
2310
  #endif
2284
- extern PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr,
2311
+ PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr,
2285
2312
  png_infop info_ptr, png_fixed_point int_file_gamma));
2286
2313
  #endif
2287
2314
 
2288
2315
  #ifdef PNG_hIST_SUPPORTED
2289
- extern PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr,
2290
- png_infop info_ptr, png_uint_16p *hist));
2316
+ PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_const_structp png_ptr,
2317
+ png_const_infop info_ptr, png_uint_16p *hist));
2291
2318
  #endif
2292
2319
 
2293
2320
  #ifdef PNG_hIST_SUPPORTED
2294
- extern PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
2321
+ PNG_EXPORT(void,png_set_hIST) PNGARG((png_structp png_ptr,
2295
2322
  png_infop info_ptr, png_uint_16p hist));
2296
2323
  #endif
2297
2324
 
2298
- extern PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr,
2325
+ PNG_EXPORT(png_uint_32,png_get_IHDR) PNGARG((png_structp png_ptr,
2299
2326
  png_infop info_ptr, png_uint_32 *width, png_uint_32 *height,
2300
2327
  int *bit_depth, int *color_type, int *interlace_method,
2301
2328
  int *compression_method, int *filter_method));
2302
2329
 
2303
- extern PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr,
2330
+ PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr,
2304
2331
  png_infop info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth,
2305
2332
  int color_type, int interlace_method, int compression_method,
2306
2333
  int filter_method));
2307
2334
 
2308
2335
  #ifdef PNG_oFFs_SUPPORTED
2309
- extern PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr,
2310
- png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
2336
+ PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_const_structp png_ptr,
2337
+ png_const_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y,
2311
2338
  int *unit_type));
2312
2339
  #endif
2313
2340
 
2314
2341
  #ifdef PNG_oFFs_SUPPORTED
2315
- extern PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
2342
+ PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr,
2316
2343
  png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y,
2317
2344
  int unit_type));
2318
2345
  #endif
2319
2346
 
2320
2347
  #ifdef PNG_pCAL_SUPPORTED
2321
- extern PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr,
2322
- png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
2348
+ PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_const_structp png_ptr,
2349
+ png_const_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1,
2323
2350
  int *type, int *nparams, png_charp *units, png_charpp *params));
2324
2351
  #endif
2325
2352
 
2326
2353
  #ifdef PNG_pCAL_SUPPORTED
2327
- extern PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
2354
+ PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr,
2328
2355
  png_infop info_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1,
2329
2356
  int type, int nparams, png_charp units, png_charpp params));
2330
2357
  #endif
2331
2358
 
2332
2359
  #ifdef PNG_pHYs_SUPPORTED
2333
- extern PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr,
2334
- png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
2360
+ PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_const_structp png_ptr,
2361
+ png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
2335
2362
  #endif
2336
2363
 
2337
2364
  #ifdef PNG_pHYs_SUPPORTED
2338
- extern PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
2365
+ PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr,
2339
2366
  png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type));
2340
2367
  #endif
2341
2368
 
2342
- extern PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr,
2343
- png_infop info_ptr, png_colorp *palette, int *num_palette));
2369
+ PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_const_structp png_ptr,
2370
+ png_const_infop info_ptr, png_colorp *palette, int *num_palette));
2344
2371
 
2345
- extern PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
2372
+ PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr,
2346
2373
  png_infop info_ptr, png_colorp palette, int num_palette));
2347
2374
 
2348
2375
  #ifdef PNG_sBIT_SUPPORTED
2349
- extern PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr,
2376
+ PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_const_structp png_ptr,
2350
2377
  png_infop info_ptr, png_color_8p *sig_bit));
2351
2378
  #endif
2352
2379
 
2353
2380
  #ifdef PNG_sBIT_SUPPORTED
2354
- extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
2381
+ PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
2355
2382
  png_infop info_ptr, png_color_8p sig_bit));
2356
2383
  #endif
2357
2384
 
2358
2385
  #ifdef PNG_sRGB_SUPPORTED
2359
- extern PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr,
2360
- png_infop info_ptr, int *intent));
2386
+ PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_const_structp png_ptr,
2387
+ png_const_infop info_ptr, int *intent));
2361
2388
  #endif
2362
2389
 
2363
2390
  #ifdef PNG_sRGB_SUPPORTED
2364
- extern PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
2391
+ PNG_EXPORT(void,png_set_sRGB) PNGARG((png_structp png_ptr,
2365
2392
  png_infop info_ptr, int intent));
2366
- extern PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
2393
+ PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr,
2367
2394
  png_infop info_ptr, int intent));
2368
2395
  #endif
2369
2396
 
2370
2397
  #ifdef PNG_iCCP_SUPPORTED
2371
- extern PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr,
2372
- png_infop info_ptr, png_charpp name, int *compression_type,
2398
+ PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_const_structp png_ptr,
2399
+ png_const_infop info_ptr, png_charpp name, int *compression_type,
2373
2400
  png_charpp profile, png_uint_32 *proflen));
2374
2401
  /* Note to maintainer: profile should be png_bytepp */
2375
2402
  #endif
2376
2403
 
2377
2404
  #ifdef PNG_iCCP_SUPPORTED
2378
- extern PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
2405
+ PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr,
2379
2406
  png_infop info_ptr, png_charp name, int compression_type,
2380
2407
  png_charp profile, png_uint_32 proflen));
2381
2408
  /* Note to maintainer: profile should be png_bytep */
2382
2409
  #endif
2383
2410
 
2384
2411
  #ifdef PNG_sPLT_SUPPORTED
2385
- extern PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr,
2386
- png_infop info_ptr, png_sPLT_tpp entries));
2412
+ PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_const_structp png_ptr,
2413
+ png_const_infop info_ptr, png_sPLT_tpp entries));
2387
2414
  #endif
2388
2415
 
2389
2416
  #ifdef PNG_sPLT_SUPPORTED
2390
- extern PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
2417
+ PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr,
2391
2418
  png_infop info_ptr, png_sPLT_tp entries, int nentries));
2392
2419
  #endif
2393
2420
 
2394
2421
  #ifdef PNG_TEXT_SUPPORTED
2395
2422
  /* png_get_text also returns the number of text chunks in *num_text */
2396
- extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
2397
- png_infop info_ptr, png_textp *text_ptr, int *num_text));
2423
+ PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_const_structp png_ptr,
2424
+ png_const_infop info_ptr, png_textp *text_ptr, int *num_text));
2398
2425
  #endif
2399
2426
 
2400
2427
  /* Note while png_set_text() will accept a structure whose text,
@@ -2405,28 +2432,28 @@ extern PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr,
2405
2432
  */
2406
2433
 
2407
2434
  #ifdef PNG_TEXT_SUPPORTED
2408
- extern PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
2435
+ PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr,
2409
2436
  png_infop info_ptr, png_textp text_ptr, int num_text));
2410
2437
  #endif
2411
2438
 
2412
2439
  #ifdef PNG_tIME_SUPPORTED
2413
- extern PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr,
2440
+ PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_const_structp png_ptr,
2414
2441
  png_infop info_ptr, png_timep *mod_time));
2415
2442
  #endif
2416
2443
 
2417
2444
  #ifdef PNG_tIME_SUPPORTED
2418
- extern PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
2445
+ PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr,
2419
2446
  png_infop info_ptr, png_timep mod_time));
2420
2447
  #endif
2421
2448
 
2422
2449
  #ifdef PNG_tRNS_SUPPORTED
2423
- extern PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr,
2450
+ PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_const_structp png_ptr,
2424
2451
  png_infop info_ptr, png_bytep *trans_alpha, int *num_trans,
2425
2452
  png_color_16p *trans_color));
2426
2453
  #endif
2427
2454
 
2428
2455
  #ifdef PNG_tRNS_SUPPORTED
2429
- extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
2456
+ PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
2430
2457
  png_infop info_ptr, png_bytep trans_alpha, int num_trans,
2431
2458
  png_color_16p trans_color));
2432
2459
  #endif
@@ -2436,23 +2463,23 @@ extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
2436
2463
 
2437
2464
  #ifdef PNG_sCAL_SUPPORTED
2438
2465
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2439
- extern PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr,
2440
- png_infop info_ptr, int *unit, double *width, double *height));
2466
+ PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_const_structp png_ptr,
2467
+ png_const_infop info_ptr, int *unit, double *width, double *height));
2441
2468
  #else
2442
2469
  #ifdef PNG_FIXED_POINT_SUPPORTED
2443
- extern PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr,
2444
- png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
2470
+ PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_const_structp png_ptr,
2471
+ png_const_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight));
2445
2472
  #endif
2446
2473
  #endif
2447
2474
  #endif /* PNG_sCAL_SUPPORTED */
2448
2475
 
2449
2476
  #ifdef PNG_sCAL_SUPPORTED
2450
2477
  #ifdef PNG_FLOATING_POINT_SUPPORTED
2451
- extern PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
2478
+ PNG_EXPORT(void,png_set_sCAL) PNGARG((png_structp png_ptr,
2452
2479
  png_infop info_ptr, int unit, double width, double height));
2453
2480
  #else
2454
2481
  #ifdef PNG_FIXED_POINT_SUPPORTED
2455
- extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
2482
+ PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
2456
2483
  png_infop info_ptr, int unit, png_charp swidth, png_charp sheight));
2457
2484
  #endif
2458
2485
  #endif
@@ -2468,47 +2495,47 @@ extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
2468
2495
  = 2: keep only if safe-to-copy
2469
2496
  = 3: keep even if unsafe-to-copy
2470
2497
  */
2471
- extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
2498
+ PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
2472
2499
  png_ptr, int keep, png_bytep chunk_list, int num_chunks));
2473
2500
  PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
2474
2501
  chunk_name));
2475
2502
  #endif
2476
2503
  #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
2477
- extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
2504
+ PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
2478
2505
  png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
2479
- extern PNG_EXPORT(void, png_set_unknown_chunk_location)
2506
+ PNG_EXPORT(void, png_set_unknown_chunk_location)
2480
2507
  PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location));
2481
- extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
2482
- png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
2508
+ PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_const_structp
2509
+ png_ptr, png_const_infop info_ptr, png_unknown_chunkpp entries));
2483
2510
  #endif
2484
2511
 
2485
2512
  /* Png_free_data() will turn off the "valid" flag for anything it frees.
2486
2513
  * If you need to turn it off for a chunk that your application has freed,
2487
2514
  * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK);
2488
2515
  */
2489
- extern PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
2516
+ PNG_EXPORT(void, png_set_invalid) PNGARG((png_structp png_ptr,
2490
2517
  png_infop info_ptr, int mask));
2491
2518
 
2492
2519
  #ifdef PNG_INFO_IMAGE_SUPPORTED
2493
2520
  /* The "params" pointer is currently not used and is for future expansion. */
2494
- extern PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
2521
+ PNG_EXPORT(void, png_read_png) PNGARG((png_structp png_ptr,
2495
2522
  png_infop info_ptr,
2496
2523
  int transforms,
2497
2524
  png_voidp params));
2498
- extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
2525
+ PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
2499
2526
  png_infop info_ptr,
2500
2527
  int transforms,
2501
2528
  png_voidp params));
2502
2529
  #endif
2503
2530
 
2504
- extern PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr));
2505
- extern PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr));
2506
- extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp
2531
+ PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_const_structp png_ptr));
2532
+ PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_const_structp png_ptr));
2533
+ PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_const_structp
2507
2534
  png_ptr));
2508
- extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
2535
+ PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_const_structp png_ptr));
2509
2536
 
2510
2537
  #ifdef PNG_MNG_FEATURES_SUPPORTED
2511
- extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
2538
+ PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
2512
2539
  png_ptr, png_uint_32 mng_features_permitted));
2513
2540
  #endif
2514
2541
 
@@ -2522,57 +2549,58 @@ extern PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp
2522
2549
  * messages before passing them to the error or warning handler.
2523
2550
  */
2524
2551
  #ifdef PNG_ERROR_NUMBERS_SUPPORTED
2525
- extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
2552
+ PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
2526
2553
  png_ptr, png_uint_32 strip_mode));
2527
2554
  #endif
2528
2555
 
2529
2556
  /* Added in libpng-1.2.6 */
2530
2557
  #ifdef PNG_SET_USER_LIMITS_SUPPORTED
2531
- extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
2558
+ PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
2532
2559
  png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
2533
- extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
2560
+ PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_const_structp
2534
2561
  png_ptr));
2535
- extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
2562
+ PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_const_structp
2536
2563
  png_ptr));
2537
2564
  /* Added in libpng-1.4.0 */
2538
- extern PNG_EXPORT(void,png_set_chunk_cache_max) PNGARG((png_structp
2565
+ PNG_EXPORT(void,png_set_chunk_cache_max) PNGARG((png_structp
2539
2566
  png_ptr, png_uint_32 user_chunk_cache_max));
2540
- extern PNG_EXPORT(png_uint_32,png_get_chunk_cache_max)
2541
- PNGARG((png_structp png_ptr));
2567
+ PNG_EXPORT(png_uint_32,png_get_chunk_cache_max)
2568
+ PNGARG((png_const_structp png_ptr));
2542
2569
  /* Added in libpng-1.4.1 */
2543
- extern PNG_EXPORT(void,png_set_chunk_malloc_max) PNGARG((png_structp
2570
+ PNG_EXPORT(void,png_set_chunk_malloc_max) PNGARG((png_structp
2544
2571
  png_ptr, png_alloc_size_t user_chunk_cache_max));
2545
- extern PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max)
2546
- PNGARG((png_structp png_ptr));
2572
+ PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max)
2573
+ PNGARG((png_const_structp png_ptr));
2547
2574
  #endif
2548
2575
 
2549
2576
  #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
2550
- PNG_EXPORT(png_uint_32,png_get_pixels_per_inch) PNGARG((png_structp png_ptr,
2551
- png_infop info_ptr));
2577
+ PNG_EXPORT(png_uint_32,png_get_pixels_per_inch)
2578
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
2552
2579
 
2553
- PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch) PNGARG((png_structp png_ptr,
2554
- png_infop info_ptr));
2580
+ PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch)
2581
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
2555
2582
 
2556
- PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch) PNGARG((png_structp png_ptr,
2557
- png_infop info_ptr));
2583
+ PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch)
2584
+ PNGARG((png_const_structp png_ptr, png_const_infop info_ptr));
2558
2585
 
2559
- PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_structp png_ptr,
2560
- png_infop info_ptr));
2586
+ PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_const_structp png_ptr,
2587
+ png_const_infop info_ptr));
2561
2588
 
2562
- PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_structp png_ptr,
2563
- png_infop info_ptr));
2589
+ PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_const_structp png_ptr,
2590
+ png_const_infop info_ptr));
2564
2591
 
2565
2592
  #ifdef PNG_pHYs_SUPPORTED
2566
- PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_structp png_ptr,
2567
- png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
2593
+ PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_const_structp png_ptr,
2594
+ png_const_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y,
2595
+ int *unit_type));
2568
2596
  #endif /* PNG_pHYs_SUPPORTED */
2569
2597
  #endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
2570
2598
 
2571
2599
  /* Added in libpng-1.4.0 */
2572
2600
  #ifdef PNG_IO_STATE_SUPPORTED
2573
- extern PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_structp png_ptr));
2601
+ PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_const_structp png_ptr));
2574
2602
 
2575
- extern PNG_EXPORT(png_bytep,png_get_io_chunk_name)
2603
+ PNG_EXPORT(png_bytep,png_get_io_chunk_name)
2576
2604
  PNGARG((png_structp png_ptr));
2577
2605
 
2578
2606
  /* The flags returned by png_get_io_state() are the following: */
@@ -2638,44 +2666,52 @@ extern PNG_EXPORT(png_bytep,png_get_io_chunk_name)
2638
2666
  * The png_get_int_32() routine assumes we are using two's complement
2639
2667
  * format for negative values, which is almost certainly true.
2640
2668
  */
2641
- /* We could make special-case BIG_ENDIAN macros that do direct reads here */
2642
2669
  # define png_get_uint_32(buf) \
2643
2670
  (((png_uint_32)(*(buf)) << 24) + \
2644
2671
  ((png_uint_32)(*((buf) + 1)) << 16) + \
2645
2672
  ((png_uint_32)(*((buf) + 2)) << 8) + \
2646
2673
  ((png_uint_32)(*((buf) + 3))))
2674
+
2675
+ /* The following definition introduces an API incompatibility (but not
2676
+ * an ABI incompatibility) with libpng-1.4.0 through 1.4.4. Prior to
2677
+ * libpng-1.4.5 the macro, which is used by default, returned (incorrectly)
2678
+ * a (png_uint_32), while the function, if used instead, correctly returned
2679
+ * a (png_uint_16).
2680
+ *
2681
+ * Libpng versions 1.0.x and 1.2.x only used a function so are not affected
2682
+ * by this potential API incompatibility between macros.
2683
+ */
2647
2684
  # define png_get_uint_16(buf) \
2648
- (((png_uint_32)(*(buf)) << 8) + \
2649
- ((png_uint_32)(*((buf) + 1))))
2650
- #ifdef PNG_GET_INT_32_SUPPORTED
2685
+ ((png_uint_16) \
2686
+ (((unsigned int)(*(buf)) << 8) + \
2687
+ ((unsigned int)(*((buf) + 1)))))
2688
+
2651
2689
  # define png_get_int_32(buf) \
2652
- (((png_int_32)(*(buf)) << 24) + \
2653
- ((png_int_32)(*((buf) + 1)) << 16) + \
2654
- ((png_int_32)(*((buf) + 2)) << 8) + \
2655
- ((png_int_32)(*((buf) + 3))))
2656
- #endif
2690
+ ((png_int_32)((*(buf) & 0x80) \
2691
+ ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \
2692
+ : (png_int_32)png_get_uint_32(buf)))
2657
2693
  #else
2658
- extern PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
2659
- extern PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
2694
+ PNG_EXPORT(png_uint_32,png_get_uint_32) PNGARG((png_bytep buf));
2695
+ PNG_EXPORT(png_uint_16,png_get_uint_16) PNGARG((png_bytep buf));
2660
2696
  #ifdef PNG_GET_INT_32_SUPPORTED
2661
- extern PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
2697
+ PNG_EXPORT(png_int_32,png_get_int_32) PNGARG((png_bytep buf));
2662
2698
  #endif
2663
2699
  #endif
2664
- extern PNG_EXPORT(png_uint_32,png_get_uint_31)
2700
+ PNG_EXPORT(png_uint_32,png_get_uint_31)
2665
2701
  PNGARG((png_structp png_ptr, png_bytep buf));
2666
2702
  /* No png_get_int_16 -- may be added if there's a real need for it. */
2667
2703
 
2668
2704
  /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */
2669
- extern PNG_EXPORT(void,png_save_uint_32)
2705
+ PNG_EXPORT(void,png_save_uint_32)
2670
2706
  PNGARG((png_bytep buf, png_uint_32 i));
2671
- extern PNG_EXPORT(void,png_save_int_32)
2707
+ PNG_EXPORT(void,png_save_int_32)
2672
2708
  PNGARG((png_bytep buf, png_int_32 i));
2673
2709
 
2674
2710
  /* Place a 16-bit number into a buffer in PNG byte order.
2675
2711
  * The parameter is declared unsigned int, not png_uint_16,
2676
2712
  * just to avoid potential problems on pre-ANSI C compilers.
2677
2713
  */
2678
- extern PNG_EXPORT(void,png_save_uint_16)
2714
+ PNG_EXPORT(void,png_save_uint_16)
2679
2715
  PNGARG((png_bytep buf, unsigned int i));
2680
2716
  /* No png_save_int_16 -- may be added if there's a real need for it. */
2681
2717