1 module libpng.pngconf; 2 /* pngconf.h - machine-configurable file for libpng 3 * 4 * libpng version 1.6.37 5 * 6 * Copyright (c) 2018-2019 Cosmin Truta 7 * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson 8 * Copyright (c) 1996-1997 Andreas Dilger 9 * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. 10 * 11 * This code is released under the libpng license. 12 * For conditions of distribution and use, see the disclaimer 13 * and license in png.h 14 * 15 * Any machine specific code is near the front of this file, so if you 16 * are configuring libpng for a machine, you may want to read the section 17 * starting here down to where it starts to typedef png_color, png_text, 18 * and png_info. 19 */ 20 21 public: 22 23 /* For png_FILE_p - this provides the standard definition of a 24 * FILE 25 */ 26 import core.stdc.stdio : FILE; 27 28 /* Some typedefs to get us started. These should be safe on most of the common 29 * platforms. 30 * 31 * png_uint_32 and png_int_32 may, currently, be larger than required to hold a 32 * 32-bit value however this is not normally advisable. 33 * 34 * png_uint_16 and png_int_16 should always be two bytes in size - this is 35 * verified at library build time. 36 * 37 * png_byte must always be one byte in size. 38 * 39 * The checks below use constants from limits.h, as defined by the ISOC90 40 * standard. 41 */ 42 43 alias png_uint_32 = uint; 44 alias png_int_32 = int; 45 alias png_uint_16 = ushort; 46 alias png_int_16 = short; 47 alias png_byte = ubyte; 48 49 alias png_size_t = size_t; 50 alias png_ptrdiff_t = ptrdiff_t; 51 //#define png_sizeof(x) (sizeof (x)) 52 53 54 /* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller 55 * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are 56 * not necessary; in fact, it is recommended not to use them at all, so that 57 * the compiler can complain when something turns out to be problematic. 58 * 59 * Casts in the other direction (from png_alloc_size_t to size_t or 60 * png_uint_32) should be explicitly applied; however, we do not expect to 61 * encounter practical situations that require such conversions. 62 * 63 * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than 64 * 4294967295 - i.e. less than the maximum value of png_uint_32. 65 */ 66 alias png_alloc_size_t = size_t; 67 68 69 /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler 70 * implementations of Intel CPU specific support of user-mode segmented address 71 * spaces, where 16-bit pointers address more than 65536 bytes of memory using 72 * separate 'segment' registers. The implementation requires two different 73 * types of pointer (only one of which includes the segment value.) 74 * 75 * If required this support is available in version 1.2 of libpng and may be 76 * available in versions through 1.5, although the correctness of the code has 77 * not been verified recently. 78 */ 79 80 81 /* Typedef for floating-point numbers that are converted 82 * to fixed-point with a multiple of 100,000, e.g., gamma 83 */ 84 alias png_fixed_point = png_int_32; 85 86 /* Add typedefs for pointers */ 87 alias png_voidp = void *; 88 alias png_const_voidp = const(void) *; 89 alias png_bytep = png_byte *; 90 alias png_const_bytep = const(png_byte) *; 91 alias png_uint_32p = png_uint_32 *; 92 alias png_const_uint_32p = const(png_uint_32) *; 93 alias png_int_32p = png_int_32 *; 94 alias png_const_int_32p = const(png_int_32) *; 95 alias png_uint_16p = png_uint_16 *; 96 alias png_const_uint_16p = const(png_uint_16) *; 97 alias png_int_16p = png_int_16 *; 98 alias png_const_int_16p = const(png_int_16) *; 99 alias png_charp = char *; 100 alias png_const_charp = const(char) *; 101 alias png_fixed_point_p = png_fixed_point *; 102 alias png_const_fixed_point_p = const(png_fixed_point) *; 103 alias png_size_tp = size_t *; 104 alias png_const_size_tp = const(size_t) *; 105 106 107 108 alias png_FILE_p = FILE *; 109 110 alias png_doublep = double *; 111 alias png_const_doublep = const(double) *; 112 113 /* Pointers to pointers; i.e. arrays */ 114 alias png_bytepp = png_byte * *; 115 alias png_uint_32pp = png_uint_32 * *; 116 alias png_int_32pp = png_int_32 * *; 117 alias png_uint_16pp = png_uint_16 * *; 118 alias png_int_16pp = png_int_16 * *; 119 alias png_const_charpp = const(char) * *; 120 alias png_charpp = char * *; 121 alias png_fixed_point_pp = png_fixed_point * *; 122 alias png_doublepp = double * *; 123 124 /* Pointers to pointers to pointers; i.e., pointer to array */ 125 alias png_charppp = char * * *; 126