13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /* png.c - location for general purpose libpng functions 26 * 27 * This file is available under and governed by the GNU General Public 28 * License version 2 only, as published by the Free Software Foundation. 29 * However, the following notice accompanied the original version of this 30 * file and, per its terms, should not be removed: 31 * 32 * Last changed in libpng 1.6.19 [November 12, 2015] 33 * Copyright (c) 1998-2015 Glenn Randers-Pehrson 34 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 35 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 36 * 37 * This code is released under the libpng license. 38 * For conditions of distribution and use, see the disclaimer 39 * and license in png.h 40 */ 41 42 #include "pngpriv.h" 43 44 /* Generate a compiler error if there is an old png.h in the search path. */ 45 typedef png_libpng_version_1_6_20 Your_png_h_is_not_version_1_6_20; 46 47 /* Tells libpng that we have already handled the first "num_bytes" bytes 48 * of the PNG file signature. If the PNG data is embedded into another 49 * stream we can set num_bytes = 8 so that libpng will not attempt to read 50 * or write any of the magic bytes before it starts on the IHDR. 51 */ 52 53 #ifdef PNG_READ_SUPPORTED 54 void PNGAPI 55 png_set_sig_bytes(png_structrp png_ptr, int num_bytes) 56 { 57 unsigned int nb = (unsigned int)num_bytes; 58 59 png_debug(1, "in png_set_sig_bytes"); 60 61 if (png_ptr == NULL) 62 return; 63 64 if (num_bytes < 0) 65 nb = 0; 786 else 787 return png_ptr->time_buffer; 788 } 789 790 return NULL; 791 } 792 # endif /* LIBPNG_VER < 10700 */ 793 # endif /* TIME_RFC1123 */ 794 795 #endif /* READ || WRITE */ 796 797 png_const_charp PNGAPI 798 png_get_copyright(png_const_structrp png_ptr) 799 { 800 PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ 801 #ifdef PNG_STRING_COPYRIGHT 802 return PNG_STRING_COPYRIGHT 803 #else 804 # ifdef __STDC__ 805 return PNG_STRING_NEWLINE \ 806 "libpng version 1.6.20 - December 3, 2015" PNG_STRING_NEWLINE \ 807 "Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ 808 "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ 809 "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ 810 PNG_STRING_NEWLINE; 811 # else 812 return "libpng version 1.6.20 - December 3, 2015\ 813 Copyright (c) 1998-2015 Glenn Randers-Pehrson\ 814 Copyright (c) 1996-1997 Andreas Dilger\ 815 Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; 816 # endif 817 #endif 818 } 819 820 /* The following return the library version as a short string in the 821 * format 1.0.0 through 99.99.99zz. To get the version of *.h files 822 * used with your application, print out PNG_LIBPNG_VER_STRING, which 823 * is defined in png.h. 824 * Note: now there is no difference between png_get_libpng_ver() and 825 * png_get_header_ver(). Due to the version_nn_nn_nn typedef guard, 826 * it is guaranteed that png.c uses the correct version of png.h. 827 */ 828 png_const_charp PNGAPI 829 png_get_libpng_ver(png_const_structrp png_ptr) 830 { 831 /* Version of *.c files used when building libpng */ 832 return png_get_header_ver(png_ptr); 833 } | 13 * version 2 for more details (a copy is included in the LICENSE file that 14 * accompanied this code). 15 * 16 * You should have received a copy of the GNU General Public License version 17 * 2 along with this work; if not, write to the Free Software Foundation, 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21 * or visit www.oracle.com if you need additional information or have any 22 * questions. 23 */ 24 25 /* png.c - location for general purpose libpng functions 26 * 27 * This file is available under and governed by the GNU General Public 28 * License version 2 only, as published by the Free Software Foundation. 29 * However, the following notice accompanied the original version of this 30 * file and, per its terms, should not be removed: 31 * 32 * Last changed in libpng 1.6.19 [November 12, 2015] 33 * Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson 34 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 35 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 36 * 37 * This code is released under the libpng license. 38 * For conditions of distribution and use, see the disclaimer 39 * and license in png.h 40 */ 41 42 #include "pngpriv.h" 43 44 /* Generate a compiler error if there is an old png.h in the search path. */ 45 typedef png_libpng_version_1_6_23 Your_png_h_is_not_version_1_6_23; 46 47 /* Tells libpng that we have already handled the first "num_bytes" bytes 48 * of the PNG file signature. If the PNG data is embedded into another 49 * stream we can set num_bytes = 8 so that libpng will not attempt to read 50 * or write any of the magic bytes before it starts on the IHDR. 51 */ 52 53 #ifdef PNG_READ_SUPPORTED 54 void PNGAPI 55 png_set_sig_bytes(png_structrp png_ptr, int num_bytes) 56 { 57 unsigned int nb = (unsigned int)num_bytes; 58 59 png_debug(1, "in png_set_sig_bytes"); 60 61 if (png_ptr == NULL) 62 return; 63 64 if (num_bytes < 0) 65 nb = 0; 786 else 787 return png_ptr->time_buffer; 788 } 789 790 return NULL; 791 } 792 # endif /* LIBPNG_VER < 10700 */ 793 # endif /* TIME_RFC1123 */ 794 795 #endif /* READ || WRITE */ 796 797 png_const_charp PNGAPI 798 png_get_copyright(png_const_structrp png_ptr) 799 { 800 PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ 801 #ifdef PNG_STRING_COPYRIGHT 802 return PNG_STRING_COPYRIGHT 803 #else 804 # ifdef __STDC__ 805 return PNG_STRING_NEWLINE \ 806 "libpng version 1.6.23 - June 9, 2016" PNG_STRING_NEWLINE \ 807 "Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ 808 PNG_STRING_NEWLINE \ 809 "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ 810 "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ 811 PNG_STRING_NEWLINE; 812 # else 813 return "libpng version 1.6.23 - June 9, 2016\ 814 Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ 815 Copyright (c) 1996-1997 Andreas Dilger\ 816 Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; 817 # endif 818 #endif 819 } 820 821 /* The following return the library version as a short string in the 822 * format 1.0.0 through 99.99.99zz. To get the version of *.h files 823 * used with your application, print out PNG_LIBPNG_VER_STRING, which 824 * is defined in png.h. 825 * Note: now there is no difference between png_get_libpng_ver() and 826 * png_get_header_ver(). Due to the version_nn_nn_nn typedef guard, 827 * it is guaranteed that png.c uses the correct version of png.h. 828 */ 829 png_const_charp PNGAPI 830 png_get_libpng_ver(png_const_structrp png_ptr) 831 { 832 /* Version of *.c files used when building libpng */ 833 return png_get_header_ver(png_ptr); 834 } |