| /* ************************************************************************** */ |
| /* * For conditions of distribution and use, * */ |
| /* * see copyright notice in libmng.h * */ |
| /* ************************************************************************** */ |
| /* * * */ |
| /* * project : libmng * */ |
| /* * file : libmng_chunk_prc.c copyright (c) 2000-2005 G.Juyn * */ |
| /* * version : 1.0.10 * */ |
| /* * * */ |
| /* * purpose : Chunk initialization & cleanup (implementation) * */ |
| /* * * */ |
| /* * author : G.Juyn * */ |
| /* * * */ |
| /* * comment : implementation of the chunk initialization & cleanup * */ |
| /* * routines * */ |
| /* * * */ |
| /* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */ |
| /* * - changed strict-ANSI stuff * */ |
| /* * 0.5.1 - 05/12/2000 - G.Juyn * */ |
| /* * - changed trace to macro for callback error-reporting * */ |
| /* * * */ |
| /* * 0.9.1 - 07/19/2000 - G.Juyn * */ |
| /* * - fixed creation-code * */ |
| /* * * */ |
| /* * 0.9.2 - 07/31/2000 - G.Juyn * */ |
| /* * - put add_chunk() inside MNG_INCLUDE_WRITE_PROCS wrapper * */ |
| /* * 0.9.2 - 08/01/2000 - G.Juyn * */ |
| /* * - wrapper for add_chunk() changed * */ |
| /* * 0.9.2 - 08/05/2000 - G.Juyn * */ |
| /* * - changed file-prefixes * */ |
| /* * * */ |
| /* * 0.9.3 - 08/26/2000 - G.Juyn * */ |
| /* * - added MAGN chunk * */ |
| /* * 0.9.3 - 10/16/2000 - G.Juyn * */ |
| /* * - added support for JDAA * */ |
| /* * * */ |
| /* * 1.0.5 - 08/19/2002 - G.Juyn * */ |
| /* * - B597134 - libmng pollutes the linker namespace * */ |
| /* * - added HLAPI function to copy chunks * */ |
| /* * 1.0.5 - 09/14/2002 - G.Juyn * */ |
| /* * - added event handling for dynamic MNG * */ |
| /* * 1.0.5 - 10/04/2002 - G.Juyn * */ |
| /* * - fixed chunk-storage for evNT chunk * */ |
| /* * 1.0.5 - 10/17/2002 - G.Juyn * */ |
| /* * - fixed issue in freeing evNT chunk * */ |
| /* * * */ |
| /* * 1.0.6 - 07/07/2003 - G.R-P * */ |
| /* * - added MNG_SKIPCHUNK_cHNK footprint optimizations * */ |
| /* * - added MNG_NO_DELTA_PNG reduction feature * */ |
| /* * 1.0.6 - 07/14/2003 - G.R-P * */ |
| /* * - added MNG_NO_LOOP_SIGNALS_SUPPORTED conditional * */ |
| /* * 1.0.6 - 07/29/2003 - G.R-P * */ |
| /* * - added conditionals around PAST chunk support * */ |
| /* * 1.0.6 - 08/17/2003 - G.R-P * */ |
| /* * - added conditionals around non-VLC chunk support * */ |
| /* * * */ |
| /* * 1.0.7 - 03/24/2004 - G.R-P * */ |
| /* * - fixed SKIPCHUNK_eXPI -> fPRI typo * */ |
| /* * * */ |
| /* * 1.0.9 - 09/25/2004 - G.Juyn * */ |
| /* * - replaced MNG_TWEAK_LARGE_FILES with permanent solution * */ |
| /* * 1.0.9 - 12/05/2004 - G.Juyn * */ |
| /* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */ |
| /* * 1.0.9 - 12/06/2004 - G.Juyn * */ |
| /* * - added conditional MNG_OPTIMIZE_CHUNKASSIGN * */ |
| /* * 1.0.9 - 12/20/2004 - G.Juyn * */ |
| /* * - cleaned up macro-invocations (thanks to D. Airlie) * */ |
| /* * * */ |
| /* * 1.0.10 - 07/30/2005 - G.Juyn * */ |
| /* * - fixed problem with CLON object during readdisplay() * */ |
| /* * 1.0.10 - 04/08/2007 - G.Juyn * */ |
| /* * - added support for mPNG proposal * */ |
| /* * 1.0.10 - 04/12/2007 - G.Juyn * */ |
| /* * - added support for ANG proposal * */ |
| /* * * */ |
| /* ************************************************************************** */ |
| |
| #include "libmng.h" |
| #include "libmng_data.h" |
| #include "libmng_error.h" |
| #include "libmng_trace.h" |
| #ifdef __BORLANDC__ |
| #pragma hdrstop |
| #endif |
| #include "libmng_memory.h" |
| #include "libmng_chunks.h" |
| #include "libmng_chunk_prc.h" |
| |
| #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI) |
| #pragma option -A /* force ANSI-C */ |
| #endif |
| |
| /* ************************************************************************** */ |
| /* * * */ |
| /* * General chunk routines * */ |
| /* * * */ |
| /* ************************************************************************** */ |
| |
| void mng_add_chunk (mng_datap pData, |
| mng_chunkp pChunk) |
| { |
| if (!pData->pFirstchunk) /* list is still empty ? */ |
| { |
| pData->pFirstchunk = pChunk; /* then this becomes the first */ |
| |
| #ifdef MNG_SUPPORT_WRITE |
| if (!pData->iFirstchunkadded) |
| { |
| pData->iFirstchunkadded = ((mng_chunk_headerp)pChunk)->iChunkname; |
| #endif |
| |
| if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_IHDR) |
| pData->eImagetype = mng_it_png; |
| else |
| #ifdef MNG_INCLUDE_JNG |
| if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_JHDR) |
| pData->eImagetype = mng_it_jng; |
| else |
| #endif |
| pData->eImagetype = mng_it_mng; |
| |
| pData->eSigtype = pData->eImagetype; |
| #ifdef MNG_SUPPORT_WRITE |
| } |
| #endif |
| } |
| else |
| { /* else we make appropriate links */ |
| ((mng_chunk_headerp)pChunk)->pPrev = pData->pLastchunk; |
| ((mng_chunk_headerp)pData->pLastchunk)->pNext = pChunk; |
| } |
| |
| pData->pLastchunk = pChunk; /* and it's always the last */ |
| |
| return; |
| } |
| |
| /* ************************************************************************** */ |
| /* * * */ |
| /* * Chunk specific initialization routines * */ |
| /* * * */ |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_OPTIMIZE_CHUNKINITFREE |
| INIT_CHUNK_HDR (mng_init_general) |
| { |
| MNG_ALLOC (pData, *ppChunk, ((mng_chunk_headerp)pHeader)->iChunksize); |
| MNG_COPY (*ppChunk, pHeader, sizeof (mng_chunk_header)); |
| return MNG_NOERROR; |
| } |
| |
| #else /* MNG_OPTIMIZE_CHUNKINITFREE */ |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_ihdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IHDR, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_ihdr)); |
| ((mng_ihdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_plte) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PLTE, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_plte)); |
| ((mng_pltep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PLTE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_idat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IDAT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_idat)); |
| ((mng_idatp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IDAT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_iend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IEND, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_iend)); |
| ((mng_iendp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_trns) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TRNS, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_trns)); |
| ((mng_trnsp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TRNS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_gAMA |
| INIT_CHUNK_HDR (mng_init_gama) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_GAMA, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_gama)); |
| ((mng_gamap)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_GAMA, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_cHRM |
| INIT_CHUNK_HDR (mng_init_chrm) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CHRM, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_chrm)); |
| ((mng_chrmp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CHRM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_sRGB |
| INIT_CHUNK_HDR (mng_init_srgb) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SRGB, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_srgb)); |
| ((mng_srgbp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SRGB, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_iCCP |
| INIT_CHUNK_HDR (mng_init_iccp) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ICCP, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_iccp)); |
| ((mng_iccpp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ICCP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_tEXt |
| INIT_CHUNK_HDR (mng_init_text) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TEXT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_text)); |
| ((mng_textp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TEXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_zTXt |
| INIT_CHUNK_HDR (mng_init_ztxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ZTXT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_ztxt)); |
| ((mng_ztxtp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ZTXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_iTXt |
| INIT_CHUNK_HDR (mng_init_itxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ITXT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_itxt)); |
| ((mng_itxtp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ITXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_bKGD |
| INIT_CHUNK_HDR (mng_init_bkgd) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BKGD, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_bkgd)); |
| ((mng_bkgdp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BKGD, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_pHYs |
| INIT_CHUNK_HDR (mng_init_phys) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PHYS, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_phys)); |
| ((mng_physp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PHYS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_sBIT |
| INIT_CHUNK_HDR (mng_init_sbit) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SBIT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_sbit)); |
| ((mng_sbitp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SBIT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_sPLT |
| INIT_CHUNK_HDR (mng_init_splt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SPLT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_splt)); |
| ((mng_spltp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SPLT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_hIST |
| INIT_CHUNK_HDR (mng_init_hist) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_HIST, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_hist)); |
| ((mng_histp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_HIST, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_tIME |
| INIT_CHUNK_HDR (mng_init_time) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TIME, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_time)); |
| ((mng_timep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TIME, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_mhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MHDR, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_mhdr)); |
| ((mng_mhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_mend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MEND, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_mend)); |
| ((mng_mendp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_LOOP |
| INIT_CHUNK_HDR (mng_init_loop) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_LOOP, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_loop)); |
| ((mng_loopp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_LOOP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_endl) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ENDL, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_endl)); |
| ((mng_endlp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ENDL, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_DEFI |
| INIT_CHUNK_HDR (mng_init_defi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DEFI, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_defi)); |
| ((mng_defip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DEFI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_BASI |
| INIT_CHUNK_HDR (mng_init_basi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BASI, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_basi)); |
| ((mng_basip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BASI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_CLON |
| INIT_CHUNK_HDR (mng_init_clon) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CLON, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_clon)); |
| ((mng_clonp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CLON, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_PAST |
| INIT_CHUNK_HDR (mng_init_past) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PAST, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_past)); |
| ((mng_pastp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PAST, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_DISC |
| INIT_CHUNK_HDR (mng_init_disc) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DISC, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_disc)); |
| ((mng_discp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DISC, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_BACK |
| INIT_CHUNK_HDR (mng_init_back) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BACK, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_back)); |
| ((mng_backp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_BACK, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_FRAM |
| INIT_CHUNK_HDR (mng_init_fram) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_FRAM, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_fram)); |
| ((mng_framp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_FRAM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_MOVE |
| INIT_CHUNK_HDR (mng_init_move) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MOVE, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_move)); |
| ((mng_movep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MOVE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_CLIP |
| INIT_CHUNK_HDR (mng_init_clip) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CLIP, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_clip)); |
| ((mng_clipp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_CLIP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_SHOW |
| INIT_CHUNK_HDR (mng_init_show) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SHOW, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_show)); |
| ((mng_showp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SHOW, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_TERM |
| INIT_CHUNK_HDR (mng_init_term) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TERM, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_term)); |
| ((mng_termp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_TERM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_SAVE |
| INIT_CHUNK_HDR (mng_init_save) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SAVE, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_save)); |
| ((mng_savep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SAVE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_SEEK |
| INIT_CHUNK_HDR (mng_init_seek) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SEEK, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_seek)); |
| ((mng_seekp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_SEEK, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_eXPI |
| INIT_CHUNK_HDR (mng_init_expi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_EXPI, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_expi)); |
| ((mng_expip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_EXPI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_fPRI |
| INIT_CHUNK_HDR (mng_init_fpri) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_FPRI, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_fpri)); |
| ((mng_fprip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_FPRI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_nEED |
| INIT_CHUNK_HDR (mng_init_need) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_NEED, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_need)); |
| ((mng_needp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_NEED, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_pHYg |
| INIT_CHUNK_HDR (mng_init_phyg) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PHYG, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_phyg)); |
| ((mng_phygp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PHYG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| INIT_CHUNK_HDR (mng_init_jhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JHDR, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_jhdr)); |
| ((mng_jhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| INIT_CHUNK_HDR (mng_init_jdaa) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JDAA, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_jdaa)); |
| ((mng_jdaap)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JDAA, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| INIT_CHUNK_HDR (mng_init_jdat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JDAT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_jdat)); |
| ((mng_jdatp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JDAT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| INIT_CHUNK_HDR (mng_init_jsep) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JSEP, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_jsep)); |
| ((mng_jsepp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_JSEP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| INIT_CHUNK_HDR (mng_init_dhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DHDR, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_dhdr)); |
| ((mng_dhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| INIT_CHUNK_HDR (mng_init_prom) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PROM, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_prom)); |
| ((mng_promp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PROM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| INIT_CHUNK_HDR (mng_init_ipng) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IPNG, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_ipng)); |
| ((mng_ipngp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IPNG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| INIT_CHUNK_HDR (mng_init_pplt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PPLT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_pplt)); |
| ((mng_ppltp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_PPLT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| #ifdef MNG_INCLUDE_JNG |
| INIT_CHUNK_HDR (mng_init_ijng) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IJNG, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_ijng)); |
| ((mng_ijngp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_IJNG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| INIT_CHUNK_HDR (mng_init_drop) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DROP, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_drop)); |
| ((mng_dropp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DROP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| #ifndef MNG_SKIPCHUNK_DBYK |
| INIT_CHUNK_HDR (mng_init_dbyk) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DBYK, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_dbyk)); |
| ((mng_dbykp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_DBYK, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| #ifndef MNG_SKIPCHUNK_ORDR |
| INIT_CHUNK_HDR (mng_init_ordr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ORDR, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_ordr)); |
| ((mng_ordrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_ORDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_MAGN |
| INIT_CHUNK_HDR (mng_init_magn) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MAGN, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_magn)); |
| ((mng_magnp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_MAGN, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_evNT |
| INIT_CHUNK_HDR (mng_init_evnt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_EVNT, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_evnt)); |
| ((mng_evntp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_EVNT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| INIT_CHUNK_HDR (mng_init_unknown) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_UNKNOWN, MNG_LC_START); |
| #endif |
| |
| MNG_ALLOC (pData, *ppChunk, sizeof (mng_unknown_chunk)); |
| ((mng_unknown_chunkp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_INIT_UNKNOWN, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| #endif /* MNG_OPTIMIZE_CHUNKINITFREE */ |
| |
| /* ************************************************************************** */ |
| /* * * */ |
| /* * Chunk specific cleanup routines * */ |
| /* * * */ |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_general) |
| { |
| MNG_FREEX (pData, pHeader, ((mng_chunk_headerp)pHeader)->iChunksize); |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_ihdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IHDR, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_ihdr)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_plte) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PLTE, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_plte)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PLTE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| FREE_CHUNK_HDR (mng_free_idat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IDAT, MNG_LC_START); |
| #endif |
| |
| if (((mng_idatp)pHeader)->iDatasize) |
| MNG_FREEX (pData, ((mng_idatp)pHeader)->pData, |
| ((mng_idatp)pHeader)->iDatasize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_idat)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IDAT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_iend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IEND, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_iend)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_trns) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TRNS, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_trns)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TRNS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_gAMA |
| FREE_CHUNK_HDR (mng_free_gama) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_GAMA, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_gama)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_GAMA, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_cHRM |
| FREE_CHUNK_HDR (mng_free_chrm) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CHRM, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_chrm)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CHRM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_sRGB |
| FREE_CHUNK_HDR (mng_free_srgb) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SRGB, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_srgb)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SRGB, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_iCCP |
| FREE_CHUNK_HDR (mng_free_iccp) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ICCP, MNG_LC_START); |
| #endif |
| |
| if (((mng_iccpp)pHeader)->iNamesize) |
| MNG_FREEX (pData, ((mng_iccpp)pHeader)->zName, |
| ((mng_iccpp)pHeader)->iNamesize + 1); |
| |
| if (((mng_iccpp)pHeader)->iProfilesize) |
| MNG_FREEX (pData, ((mng_iccpp)pHeader)->pProfile, |
| ((mng_iccpp)pHeader)->iProfilesize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_iccp)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ICCP, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_tEXt |
| FREE_CHUNK_HDR (mng_free_text) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TEXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_textp)pHeader)->iKeywordsize) |
| MNG_FREEX (pData, ((mng_textp)pHeader)->zKeyword, |
| ((mng_textp)pHeader)->iKeywordsize + 1); |
| |
| if (((mng_textp)pHeader)->iTextsize) |
| MNG_FREEX (pData, ((mng_textp)pHeader)->zText, |
| ((mng_textp)pHeader)->iTextsize + 1); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_text)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TEXT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_zTXt |
| FREE_CHUNK_HDR (mng_free_ztxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ZTXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_ztxtp)pHeader)->iKeywordsize) |
| MNG_FREEX (pData, ((mng_ztxtp)pHeader)->zKeyword, |
| ((mng_ztxtp)pHeader)->iKeywordsize + 1); |
| |
| if (((mng_ztxtp)pHeader)->iTextsize) |
| MNG_FREEX (pData, ((mng_ztxtp)pHeader)->zText, |
| ((mng_ztxtp)pHeader)->iTextsize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_ztxt)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ZTXT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| #ifndef MNG_SKIPCHUNK_iTXt |
| FREE_CHUNK_HDR (mng_free_itxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ITXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_itxtp)pHeader)->iKeywordsize) |
| MNG_FREEX (pData, ((mng_itxtp)pHeader)->zKeyword, |
| ((mng_itxtp)pHeader)->iKeywordsize + 1); |
| |
| if (((mng_itxtp)pHeader)->iLanguagesize) |
| MNG_FREEX (pData, ((mng_itxtp)pHeader)->zLanguage, |
| ((mng_itxtp)pHeader)->iLanguagesize + 1); |
| |
| if (((mng_itxtp)pHeader)->iTranslationsize) |
| MNG_FREEX (pData, ((mng_itxtp)pHeader)->zTranslation, |
| ((mng_itxtp)pHeader)->iTranslationsize + 1); |
| |
| if (((mng_itxtp)pHeader)->iTextsize) |
| MNG_FREEX (pData, ((mng_itxtp)pHeader)->zText, |
| ((mng_itxtp)pHeader)->iTextsize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_itxt)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ITXT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| #ifdef MNG_INCLUDE_MPNG_PROPOSAL |
| FREE_CHUNK_HDR (mng_free_mpng) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MPNG, MNG_LC_START); |
| #endif |
| |
| if (((mng_mpngp)pHeader)->iFramessize) |
| MNG_FREEX (pData, ((mng_mpngp)pHeader)->pFrames, |
| ((mng_mpngp)pHeader)->iFramessize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_mpng)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MPNG, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| #ifdef MNG_INCLUDE_ANG_PROPOSAL |
| FREE_CHUNK_HDR (mng_free_adat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ADAT, MNG_LC_START); |
| #endif |
| |
| if (((mng_adatp)pHeader)->iTilessize) |
| MNG_FREEX (pData, ((mng_adatp)pHeader)->pTiles, ((mng_adatp)pHeader)->iTilessize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_adat)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ADAT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_bKGD |
| FREE_CHUNK_HDR (mng_free_bkgd) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BKGD, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_bkgd)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BKGD, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_pHYs |
| FREE_CHUNK_HDR (mng_free_phys) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PHYS, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_phys)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PHYS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_sBIT |
| FREE_CHUNK_HDR (mng_free_sbit) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SBIT, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_sbit)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SBIT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_sPLT |
| FREE_CHUNK_HDR (mng_free_splt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SPLT, MNG_LC_START); |
| #endif |
| |
| if (((mng_spltp)pHeader)->iNamesize) |
| MNG_FREEX (pData, ((mng_spltp)pHeader)->zName, |
| ((mng_spltp)pHeader)->iNamesize + 1); |
| |
| if (((mng_spltp)pHeader)->iEntrycount) |
| MNG_FREEX (pData, ((mng_spltp)pHeader)->pEntries, |
| ((mng_spltp)pHeader)->iEntrycount * |
| (((mng_spltp)pHeader)->iSampledepth * 3 + sizeof (mng_uint16)) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_splt)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SPLT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_hIST |
| FREE_CHUNK_HDR (mng_free_hist) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_HIST, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_hist)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_HIST, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_tIME |
| FREE_CHUNK_HDR (mng_free_time) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TIME, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_time)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TIME, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_mhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MHDR, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_mhdr)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_mend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MEND, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_mend)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_LOOP |
| FREE_CHUNK_HDR (mng_free_loop) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_LOOP, MNG_LC_START); |
| #endif |
| |
| #ifndef MNG_NO_LOOP_SIGNALS_SUPPORTED |
| if (((mng_loopp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_loopp)pHeader)->pSignals, |
| ((mng_loopp)pHeader)->iCount * sizeof (mng_uint32) ); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_loop)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_LOOP, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| FREE_CHUNK_HDR (mng_free_endl) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ENDL, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_endl)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ENDL, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_DEFI |
| FREE_CHUNK_HDR (mng_free_defi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DEFI, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_defi)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DEFI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_BASI |
| FREE_CHUNK_HDR (mng_free_basi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BASI, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_basi)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BASI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_CLON |
| FREE_CHUNK_HDR (mng_free_clon) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CLON, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_clon)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CLON, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_PAST |
| FREE_CHUNK_HDR (mng_free_past) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PAST, MNG_LC_START); |
| #endif |
| |
| if (((mng_pastp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_pastp)pHeader)->pSources, |
| ((mng_pastp)pHeader)->iCount * sizeof (mng_past_source) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_past)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PAST, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_DISC |
| FREE_CHUNK_HDR (mng_free_disc) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DISC, MNG_LC_START); |
| #endif |
| |
| if (((mng_discp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_discp)pHeader)->pObjectids, |
| ((mng_discp)pHeader)->iCount * sizeof (mng_uint16) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_disc)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DISC, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_BACK |
| FREE_CHUNK_HDR (mng_free_back) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BACK, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_back)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_BACK, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_FRAM |
| FREE_CHUNK_HDR (mng_free_fram) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_FRAM, MNG_LC_START); |
| #endif |
| |
| if (((mng_framp)pHeader)->iNamesize) |
| MNG_FREEX (pData, ((mng_framp)pHeader)->zName, |
| ((mng_framp)pHeader)->iNamesize + 1); |
| |
| if (((mng_framp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_framp)pHeader)->pSyncids, |
| ((mng_framp)pHeader)->iCount * sizeof (mng_uint32) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_fram)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_FRAM, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_MOVE |
| FREE_CHUNK_HDR (mng_free_move) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MOVE, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_move)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MOVE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_CLIP |
| FREE_CHUNK_HDR (mng_free_clip) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CLIP, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_clip)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_CLIP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_SHOW |
| FREE_CHUNK_HDR (mng_free_show) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SHOW, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_show)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SHOW, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_TERM |
| FREE_CHUNK_HDR (mng_free_term) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TERM, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_term)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_TERM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_SAVE |
| FREE_CHUNK_HDR (mng_free_save) |
| { |
| mng_save_entryp pEntry = ((mng_savep)pHeader)->pEntries; |
| mng_uint32 iX; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SAVE, MNG_LC_START); |
| #endif |
| |
| for (iX = 0; iX < ((mng_savep)pHeader)->iCount; iX++) |
| { |
| if (pEntry->iNamesize) |
| MNG_FREEX (pData, pEntry->zName, pEntry->iNamesize); |
| |
| pEntry = pEntry + sizeof (mng_save_entry); |
| } |
| |
| if (((mng_savep)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_savep)pHeader)->pEntries, |
| ((mng_savep)pHeader)->iCount * sizeof (mng_save_entry) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_save)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SAVE, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_SEEK |
| FREE_CHUNK_HDR (mng_free_seek) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SEEK, MNG_LC_START); |
| #endif |
| |
| if (((mng_seekp)pHeader)->iNamesize) |
| MNG_FREEX (pData, ((mng_seekp)pHeader)->zName, |
| ((mng_seekp)pHeader)->iNamesize + 1); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_seek)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_SEEK, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_eXPI |
| FREE_CHUNK_HDR (mng_free_expi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_EXPI, MNG_LC_START); |
| #endif |
| |
| if (((mng_expip)pHeader)->iNamesize) |
| MNG_FREEX (pData, ((mng_expip)pHeader)->zName, |
| ((mng_expip)pHeader)->iNamesize + 1); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_expi)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_EXPI, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_fPRI |
| FREE_CHUNK_HDR (mng_free_fpri) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_FPRI, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_fpri)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_FPRI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_nEED |
| FREE_CHUNK_HDR (mng_free_need) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_NEED, MNG_LC_START); |
| #endif |
| |
| if (((mng_needp)pHeader)->iKeywordssize) |
| MNG_FREEX (pData, ((mng_needp)pHeader)->zKeywords, |
| ((mng_needp)pHeader)->iKeywordssize + 1); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_need)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_NEED, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_pHYg |
| FREE_CHUNK_HDR (mng_free_phyg) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PHYG, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_phyg)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PHYG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifdef MNG_INCLUDE_JNG |
| FREE_CHUNK_HDR (mng_free_jhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JHDR, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_jhdr)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| FREE_CHUNK_HDR (mng_free_jdaa) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JDAA, MNG_LC_START); |
| #endif |
| |
| if (((mng_jdaap)pHeader)->iDatasize) |
| MNG_FREEX (pData, ((mng_jdaap)pHeader)->pData, |
| ((mng_jdaap)pHeader)->iDatasize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_jdaa)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JDAA, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_JNG |
| FREE_CHUNK_HDR (mng_free_jdat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JDAT, MNG_LC_START); |
| #endif |
| |
| if (((mng_jdatp)pHeader)->iDatasize) |
| MNG_FREEX (pData, ((mng_jdatp)pHeader)->pData, |
| ((mng_jdatp)pHeader)->iDatasize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_jdat)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JDAT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifdef MNG_INCLUDE_JNG |
| FREE_CHUNK_HDR (mng_free_jsep) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JSEP, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_jsep)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_JSEP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif /* MNG_INCLUDE_JNG */ |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_NO_DELTA_PNG |
| FREE_CHUNK_HDR (mng_free_dhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DHDR, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_dhdr)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_NO_DELTA_PNG |
| FREE_CHUNK_HDR (mng_free_prom) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PROM, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_prom)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PROM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_NO_DELTA_PNG |
| FREE_CHUNK_HDR (mng_free_ipng) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IPNG, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_ipng)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IPNG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_NO_DELTA_PNG |
| FREE_CHUNK_HDR (mng_free_pplt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PPLT, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_pplt)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_PPLT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_NO_DELTA_PNG |
| #ifdef MNG_INCLUDE_JNG |
| FREE_CHUNK_HDR (mng_free_ijng) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IJNG, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_ijng)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_IJNG, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| FREE_CHUNK_HDR (mng_free_drop) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DROP, MNG_LC_START); |
| #endif |
| |
| if (((mng_dropp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_dropp)pHeader)->pChunknames, |
| ((mng_dropp)pHeader)->iCount * sizeof (mng_chunkid) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_drop)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DROP, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| #ifndef MNG_SKIPCHUNK_DBYK |
| FREE_CHUNK_HDR (mng_free_dbyk) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DBYK, MNG_LC_START); |
| #endif |
| |
| if (((mng_dbykp)pHeader)->iKeywordssize) |
| MNG_FREEX (pData, ((mng_dbykp)pHeader)->zKeywords, |
| ((mng_dbykp)pHeader)->iKeywordssize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_dbyk)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_DBYK, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_NO_DELTA_PNG |
| #ifndef MNG_SKIPCHUNK_ORDR |
| FREE_CHUNK_HDR (mng_free_ordr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ORDR, MNG_LC_START); |
| #endif |
| |
| if (((mng_ordrp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_ordrp)pHeader)->pEntries, |
| ((mng_ordrp)pHeader)->iCount * sizeof (mng_ordr_entry) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_ordr)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_ORDR, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| #ifndef MNG_SKIPCHUNK_MAGN |
| FREE_CHUNK_HDR (mng_free_magn) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MAGN, MNG_LC_START); |
| #endif |
| |
| MNG_FREEX (pData, pHeader, sizeof (mng_magn)); |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_MAGN, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_evNT |
| FREE_CHUNK_HDR (mng_free_evnt) |
| { |
| mng_evnt_entryp pEntry = ((mng_evntp)pHeader)->pEntries; |
| mng_uint32 iX; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_EVNT, MNG_LC_START); |
| #endif |
| |
| for (iX = 0; iX < ((mng_evntp)pHeader)->iCount; iX++) |
| { |
| if (pEntry->iSegmentnamesize) |
| MNG_FREEX (pData, pEntry->zSegmentname, pEntry->iSegmentnamesize+1); |
| |
| pEntry++; |
| } |
| |
| if (((mng_evntp)pHeader)->iCount) |
| MNG_FREEX (pData, ((mng_evntp)pHeader)->pEntries, |
| ((mng_evntp)pHeader)->iCount * sizeof (mng_evnt_entry) ); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_evnt)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_EVNT, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| FREE_CHUNK_HDR (mng_free_unknown) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_UNKNOWN, MNG_LC_START); |
| #endif |
| |
| if (((mng_unknown_chunkp)pHeader)->iDatasize) |
| MNG_FREEX (pData, ((mng_unknown_chunkp)pHeader)->pData, |
| ((mng_unknown_chunkp)pHeader)->iDatasize); |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| MNG_FREEX (pData, pHeader, sizeof (mng_unknown_chunk)); |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_FREE_UNKNOWN, MNG_LC_END); |
| #endif |
| |
| #ifndef MNG_OPTIMIZE_CHUNKINITFREE |
| return MNG_NOERROR; |
| #else |
| return mng_free_general(pData, pHeader); |
| #endif |
| } |
| |
| /* ************************************************************************** */ |
| /* * * */ |
| /* * Chunk specific copy routines * */ |
| /* * * */ |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_INCLUDE_WRITE_PROCS |
| |
| /* ************************************************************************** */ |
| |
| #ifdef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_general) |
| { |
| mng_ptr pSrc = (mng_uint8p)pChunkfrom + sizeof (mng_chunk_header); |
| mng_ptr pDst = (mng_uint8p)pChunkto + sizeof (mng_chunk_header); |
| mng_size_t iLen = ((mng_chunk_headerp)pChunkfrom)->iChunksize - sizeof (mng_chunk_header); |
| |
| MNG_COPY (pDst, pSrc, iLen); |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_ihdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IHDR, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_IHDR) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_ihdrp)pChunkto)->iWidth = ((mng_ihdrp)pChunkfrom)->iWidth; |
| ((mng_ihdrp)pChunkto)->iHeight = ((mng_ihdrp)pChunkfrom)->iHeight; |
| ((mng_ihdrp)pChunkto)->iBitdepth = ((mng_ihdrp)pChunkfrom)->iBitdepth; |
| ((mng_ihdrp)pChunkto)->iColortype = ((mng_ihdrp)pChunkfrom)->iColortype; |
| ((mng_ihdrp)pChunkto)->iCompression = ((mng_ihdrp)pChunkfrom)->iCompression; |
| ((mng_ihdrp)pChunkto)->iFilter = ((mng_ihdrp)pChunkfrom)->iFilter; |
| ((mng_ihdrp)pChunkto)->iInterlace = ((mng_ihdrp)pChunkfrom)->iInterlace; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_plte) |
| { |
| mng_uint32 iX; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_PLTE, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_PLTE) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_pltep)pChunkto)->bEmpty = ((mng_pltep)pChunkfrom)->bEmpty; |
| ((mng_pltep)pChunkto)->iEntrycount = ((mng_pltep)pChunkfrom)->iEntrycount; |
| |
| for (iX = 0; iX < ((mng_pltep)pChunkto)->iEntrycount; iX++) |
| ((mng_pltep)pChunkto)->aEntries [iX] = ((mng_pltep)pChunkfrom)->aEntries [iX]; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_PLTE, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| ASSIGN_CHUNK_HDR (mng_assign_idat) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IDAT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_IDAT) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_idatp)pChunkto)->bEmpty = ((mng_idatp)pChunkfrom)->bEmpty; |
| ((mng_idatp)pChunkto)->iDatasize = ((mng_idatp)pChunkfrom)->iDatasize; |
| |
| if (((mng_idatp)pChunkto)->iDatasize) |
| { |
| MNG_ALLOC (pData, ((mng_idatp)pChunkto)->pData, ((mng_idatp)pChunkto)->iDatasize); |
| MNG_COPY (((mng_idatp)pChunkto)->pData, ((mng_idatp)pChunkfrom)->pData, |
| ((mng_idatp)pChunkto)->iDatasize); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IDAT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_iend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IEND, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_IEND) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_IEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_trns) |
| { |
| mng_uint32 iX; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TRNS, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_tRNS) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_trnsp)pChunkto)->bEmpty = ((mng_trnsp)pChunkfrom)->bEmpty; |
| ((mng_trnsp)pChunkto)->bGlobal = ((mng_trnsp)pChunkfrom)->bGlobal; |
| ((mng_trnsp)pChunkto)->iType = ((mng_trnsp)pChunkfrom)->iType; |
| ((mng_trnsp)pChunkto)->iCount = ((mng_trnsp)pChunkfrom)->iCount; |
| ((mng_trnsp)pChunkto)->iGray = ((mng_trnsp)pChunkfrom)->iGray; |
| ((mng_trnsp)pChunkto)->iRed = ((mng_trnsp)pChunkfrom)->iRed; |
| ((mng_trnsp)pChunkto)->iGreen = ((mng_trnsp)pChunkfrom)->iGreen; |
| ((mng_trnsp)pChunkto)->iBlue = ((mng_trnsp)pChunkfrom)->iBlue; |
| ((mng_trnsp)pChunkto)->iRawlen = ((mng_trnsp)pChunkfrom)->iRawlen; |
| |
| for (iX = 0; iX < ((mng_trnsp)pChunkto)->iCount; iX++) |
| ((mng_trnsp)pChunkto)->aEntries [iX] = ((mng_trnsp)pChunkfrom)->aEntries [iX]; |
| |
| for (iX = 0; iX < ((mng_trnsp)pChunkto)->iRawlen; iX++) |
| ((mng_trnsp)pChunkto)->aRawdata [iX] = ((mng_trnsp)pChunkfrom)->aRawdata [iX]; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TRNS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_gAMA |
| ASSIGN_CHUNK_HDR (mng_assign_gama) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_GAMA, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_gAMA) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_gamap)pChunkto)->bEmpty = ((mng_gamap)pChunkfrom)->bEmpty; |
| ((mng_gamap)pChunkto)->iGamma = ((mng_gamap)pChunkfrom)->iGamma; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_GAMA, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_cHRM |
| ASSIGN_CHUNK_HDR (mng_assign_chrm) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_CHRM, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_cHRM) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_chrmp)pChunkto)->bEmpty = ((mng_chrmp)pChunkfrom)->bEmpty; |
| ((mng_chrmp)pChunkto)->iWhitepointx = ((mng_chrmp)pChunkfrom)->iWhitepointx; |
| ((mng_chrmp)pChunkto)->iWhitepointy = ((mng_chrmp)pChunkfrom)->iWhitepointy; |
| ((mng_chrmp)pChunkto)->iRedx = ((mng_chrmp)pChunkfrom)->iRedx; |
| ((mng_chrmp)pChunkto)->iRedy = ((mng_chrmp)pChunkfrom)->iRedy; |
| ((mng_chrmp)pChunkto)->iGreenx = ((mng_chrmp)pChunkfrom)->iGreenx; |
| ((mng_chrmp)pChunkto)->iGreeny = ((mng_chrmp)pChunkfrom)->iGreeny; |
| ((mng_chrmp)pChunkto)->iBluex = ((mng_chrmp)pChunkfrom)->iBluex; |
| ((mng_chrmp)pChunkto)->iBluey = ((mng_chrmp)pChunkfrom)->iBluey; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_CHRM, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_sRGB |
| ASSIGN_CHUNK_HDR (mng_assign_srgb) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SRGB, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_sRGB) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_srgbp)pChunkto)->iRenderingintent = ((mng_srgbp)pChunkfrom)->iRenderingintent; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SRGB, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_iCCP |
| ASSIGN_CHUNK_HDR (mng_assign_iccp) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ICCP, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_iCCP) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_iccpp)pChunkto)->bEmpty = ((mng_iccpp)pChunkfrom)->bEmpty; |
| ((mng_iccpp)pChunkto)->iNamesize = ((mng_iccpp)pChunkfrom)->iNamesize; |
| ((mng_iccpp)pChunkto)->iCompression = ((mng_iccpp)pChunkfrom)->iCompression; |
| ((mng_iccpp)pChunkto)->iProfilesize = ((mng_iccpp)pChunkfrom)->iProfilesize; |
| |
| if (((mng_iccpp)pChunkto)->iNamesize) |
| { |
| MNG_ALLOC (pData, ((mng_iccpp)pChunkto)->zName, ((mng_iccpp)pChunkto)->iNamesize); |
| MNG_COPY (((mng_iccpp)pChunkto)->zName, ((mng_iccpp)pChunkfrom)->zName, |
| ((mng_iccpp)pChunkto)->iNamesize); |
| } |
| |
| if (((mng_iccpp)pChunkto)->iProfilesize) |
| { |
| MNG_ALLOC (pData, ((mng_iccpp)pChunkto)->pProfile, ((mng_iccpp)pChunkto)->iProfilesize); |
| MNG_COPY (((mng_iccpp)pChunkto)->pProfile, ((mng_iccpp)pChunkfrom)->pProfile, |
| ((mng_iccpp)pChunkto)->iProfilesize); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ICCP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_tEXt |
| ASSIGN_CHUNK_HDR (mng_assign_text) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TEXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_tEXt) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_textp)pChunkto)->iKeywordsize = ((mng_textp)pChunkfrom)->iKeywordsize; |
| ((mng_textp)pChunkto)->iTextsize = ((mng_textp)pChunkfrom)->iTextsize; |
| |
| if (((mng_textp)pChunkto)->iKeywordsize) |
| { |
| MNG_ALLOC (pData, ((mng_itxtp)pChunkto)->zKeyword, ((mng_textp)pChunkto)->iKeywordsize); |
| MNG_COPY (((mng_itxtp)pChunkto)->zKeyword, ((mng_textp)pChunkfrom)->zKeyword, |
| ((mng_itxtp)pChunkto)->iKeywordsize); |
| } |
| |
| if (((mng_textp)pChunkto)->iTextsize) |
| { |
| MNG_ALLOC (pData, ((mng_textp)pChunkto)->zText, ((mng_textp)pChunkto)->iTextsize); |
| MNG_COPY (((mng_textp)pChunkto)->zText, ((mng_textp)pChunkfrom)->zText, |
| ((mng_textp)pChunkto)->iTextsize); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TEXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_zTXt |
| ASSIGN_CHUNK_HDR (mng_assign_ztxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ZTXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_zTXt) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_ztxtp)pChunkto)->iKeywordsize = ((mng_ztxtp)pChunkfrom)->iKeywordsize; |
| ((mng_ztxtp)pChunkto)->iCompression = ((mng_ztxtp)pChunkfrom)->iCompression; |
| ((mng_ztxtp)pChunkto)->iTextsize = ((mng_ztxtp)pChunkfrom)->iTextsize; |
| |
| if (((mng_ztxtp)pChunkto)->iKeywordsize) |
| { |
| MNG_ALLOC (pData, ((mng_ztxtp)pChunkto)->zKeyword, ((mng_ztxtp)pChunkto)->iKeywordsize); |
| MNG_COPY (((mng_ztxtp)pChunkto)->zKeyword, ((mng_ztxtp)pChunkfrom)->zKeyword, |
| ((mng_ztxtp)pChunkto)->iKeywordsize); |
| } |
| |
| if (((mng_ztxtp)pChunkto)->iTextsize) |
| { |
| MNG_ALLOC (pData, ((mng_ztxtp)pChunkto)->zText, ((mng_ztxtp)pChunkto)->iTextsize); |
| MNG_COPY (((mng_ztxtp)pChunkto)->zText, ((mng_ztxtp)pChunkfrom)->zText, |
| ((mng_ztxtp)pChunkto)->iTextsize); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ZTXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_iTXt |
| ASSIGN_CHUNK_HDR (mng_assign_itxt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ITXT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_iTXt) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_itxtp)pChunkto)->iKeywordsize = ((mng_itxtp)pChunkfrom)->iKeywordsize; |
| ((mng_itxtp)pChunkto)->iCompressionflag = ((mng_itxtp)pChunkfrom)->iCompressionflag; |
| ((mng_itxtp)pChunkto)->iCompressionmethod = ((mng_itxtp)pChunkfrom)->iCompressionmethod; |
| ((mng_itxtp)pChunkto)->iLanguagesize = ((mng_itxtp)pChunkfrom)->iLanguagesize; |
| ((mng_itxtp)pChunkto)->iTranslationsize = ((mng_itxtp)pChunkfrom)->iTranslationsize; |
| ((mng_itxtp)pChunkto)->iTextsize = ((mng_itxtp)pChunkfrom)->iTextsize; |
| |
| if (((mng_itxtp)pChunkto)->iKeywordsize) |
| { |
| MNG_ALLOC (pData, ((mng_itxtp)pChunkto)->zKeyword, ((mng_itxtp)pChunkto)->iKeywordsize); |
| MNG_COPY (((mng_itxtp)pChunkto)->zKeyword, ((mng_itxtp)pChunkfrom)->zKeyword, |
| ((mng_itxtp)pChunkto)->iKeywordsize); |
| } |
| |
| if (((mng_itxtp)pChunkto)->iTextsize) |
| { |
| MNG_ALLOC (pData, ((mng_itxtp)pChunkto)->zLanguage, ((mng_itxtp)pChunkto)->iLanguagesize); |
| MNG_COPY (((mng_itxtp)pChunkto)->zLanguage, ((mng_itxtp)pChunkfrom)->zLanguage, |
| ((mng_itxtp)pChunkto)->iLanguagesize); |
| } |
| |
| if (((mng_itxtp)pChunkto)->iTextsize) |
| { |
| MNG_ALLOC (pData, ((mng_itxtp)pChunkto)->zTranslation, ((mng_itxtp)pChunkto)->iTranslationsize); |
| MNG_COPY (((mng_itxtp)pChunkto)->zTranslation, ((mng_itxtp)pChunkfrom)->zTranslation, |
| ((mng_itxtp)pChunkto)->iTranslationsize); |
| } |
| |
| if (((mng_itxtp)pChunkto)->iTextsize) |
| { |
| MNG_ALLOC (pData, ((mng_itxtp)pChunkto)->zText, ((mng_itxtp)pChunkto)->iTextsize); |
| MNG_COPY (((mng_itxtp)pChunkto)->zText, ((mng_itxtp)pChunkfrom)->zText, |
| ((mng_itxtp)pChunkto)->iTextsize); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ITXT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_bKGD |
| ASSIGN_CHUNK_HDR (mng_assign_bkgd) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_BKGD, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_bKGD) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_bkgdp)pChunkto)->bEmpty = ((mng_bkgdp)pChunkfrom)->bEmpty; |
| ((mng_bkgdp)pChunkto)->iType = ((mng_bkgdp)pChunkfrom)->iType; |
| ((mng_bkgdp)pChunkto)->iIndex = ((mng_bkgdp)pChunkfrom)->iIndex; |
| ((mng_bkgdp)pChunkto)->iGray = ((mng_bkgdp)pChunkfrom)->iGray; |
| ((mng_bkgdp)pChunkto)->iRed = ((mng_bkgdp)pChunkfrom)->iRed; |
| ((mng_bkgdp)pChunkto)->iGreen = ((mng_bkgdp)pChunkfrom)->iGreen; |
| ((mng_bkgdp)pChunkto)->iBlue = ((mng_bkgdp)pChunkfrom)->iBlue; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_BKGD, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_pHYs |
| ASSIGN_CHUNK_HDR (mng_assign_phys) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_PHYS, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_pHYs) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_physp)pChunkto)->bEmpty = ((mng_physp)pChunkfrom)->bEmpty; |
| ((mng_physp)pChunkto)->iSizex = ((mng_physp)pChunkfrom)->iSizex; |
| ((mng_physp)pChunkto)->iSizey = ((mng_physp)pChunkfrom)->iSizey; |
| ((mng_physp)pChunkto)->iUnit = ((mng_physp)pChunkfrom)->iUnit; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_PHYS, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_sBIT |
| ASSIGN_CHUNK_HDR (mng_assign_sbit) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SBIT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_sBIT) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_sbitp)pChunkto)->bEmpty = ((mng_sbitp)pChunkfrom)->bEmpty; |
| ((mng_sbitp)pChunkto)->iType = ((mng_sbitp)pChunkfrom)->iType; |
| ((mng_sbitp)pChunkto)->aBits [0] = ((mng_sbitp)pChunkfrom)->aBits [0]; |
| ((mng_sbitp)pChunkto)->aBits [1] = ((mng_sbitp)pChunkfrom)->aBits [1]; |
| ((mng_sbitp)pChunkto)->aBits [2] = ((mng_sbitp)pChunkfrom)->aBits [2]; |
| ((mng_sbitp)pChunkto)->aBits [3] = ((mng_sbitp)pChunkfrom)->aBits [3]; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SBIT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_sPLT |
| ASSIGN_CHUNK_HDR (mng_assign_splt) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SPLT, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_sPLT) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_spltp)pChunkto)->bEmpty = ((mng_spltp)pChunkfrom)->bEmpty; |
| ((mng_spltp)pChunkto)->iNamesize = ((mng_spltp)pChunkfrom)->iNamesize; |
| ((mng_spltp)pChunkto)->iSampledepth = ((mng_spltp)pChunkfrom)->iSampledepth; |
| ((mng_spltp)pChunkto)->iEntrycount = ((mng_spltp)pChunkfrom)->iEntrycount; |
| ((mng_spltp)pChunkto)->pEntries = ((mng_spltp)pChunkfrom)->pEntries; |
| |
| if (((mng_spltp)pChunkto)->iNamesize) |
| { |
| MNG_ALLOC (pData, ((mng_spltp)pChunkto)->zName, ((mng_spltp)pChunkto)->iNamesize); |
| MNG_COPY (((mng_spltp)pChunkto)->zName, ((mng_spltp)pChunkfrom)->zName, |
| ((mng_spltp)pChunkto)->iNamesize); |
| } |
| |
| if (((mng_spltp)pChunkto)->iEntrycount) |
| { |
| mng_uint32 iLen = ((mng_spltp)pChunkto)->iEntrycount * |
| (((mng_spltp)pChunkto)->iSampledepth * 3 + sizeof (mng_uint16)); |
| |
| MNG_ALLOC (pData, ((mng_spltp)pChunkto)->pEntries, iLen); |
| MNG_COPY (((mng_spltp)pChunkto)->pEntries, ((mng_spltp)pChunkfrom)->pEntries, iLen); |
| } |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_SPLT, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_hIST |
| ASSIGN_CHUNK_HDR (mng_assign_hist) |
| { |
| mng_uint32 iX; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_HIST, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_hIST) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_histp)pChunkto)->iEntrycount = ((mng_histp)pChunkfrom)->iEntrycount; |
| |
| for (iX = 0; iX < ((mng_histp)pChunkto)->iEntrycount; iX++) |
| ((mng_histp)pChunkto)->aEntries [iX] = ((mng_histp)pChunkfrom)->aEntries [iX]; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_HIST, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_tIME |
| ASSIGN_CHUNK_HDR (mng_assign_time) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TIME, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_tIME) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_timep)pChunkto)->iYear = ((mng_timep)pChunkfrom)->iYear; |
| ((mng_timep)pChunkto)->iMonth = ((mng_timep)pChunkfrom)->iMonth; |
| ((mng_timep)pChunkto)->iDay = ((mng_timep)pChunkfrom)->iDay; |
| ((mng_timep)pChunkto)->iHour = ((mng_timep)pChunkfrom)->iHour; |
| ((mng_timep)pChunkto)->iMinute = ((mng_timep)pChunkfrom)->iMinute; |
| ((mng_timep)pChunkto)->iSecond = ((mng_timep)pChunkfrom)->iSecond; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_TIME, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_mhdr) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_MHDR, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_MHDR) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_mhdrp)pChunkto)->iWidth = ((mng_mhdrp)pChunkfrom)->iWidth; |
| ((mng_mhdrp)pChunkto)->iHeight = ((mng_mhdrp)pChunkfrom)->iHeight; |
| ((mng_mhdrp)pChunkto)->iTicks = ((mng_mhdrp)pChunkfrom)->iTicks; |
| ((mng_mhdrp)pChunkto)->iLayercount = ((mng_mhdrp)pChunkfrom)->iLayercount; |
| ((mng_mhdrp)pChunkto)->iFramecount = ((mng_mhdrp)pChunkfrom)->iFramecount; |
| ((mng_mhdrp)pChunkto)->iPlaytime = ((mng_mhdrp)pChunkfrom)->iPlaytime; |
| ((mng_mhdrp)pChunkto)->iSimplicity = ((mng_mhdrp)pChunkfrom)->iSimplicity; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_MHDR, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_mend) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_MEND, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_MEND) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_MEND, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_SKIPCHUNK_LOOP |
| ASSIGN_CHUNK_HDR (mng_assign_loop) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_LOOP, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_LOOP) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_loopp)pChunkto)->iLevel = ((mng_loopp)pChunkfrom)->iLevel; |
| ((mng_loopp)pChunkto)->iRepeat = ((mng_loopp)pChunkfrom)->iRepeat; |
| ((mng_loopp)pChunkto)->iTermination = ((mng_loopp)pChunkfrom)->iTermination; |
| ((mng_loopp)pChunkto)->iItermin = ((mng_loopp)pChunkfrom)->iItermin; |
| ((mng_loopp)pChunkto)->iItermax = ((mng_loopp)pChunkfrom)->iItermax; |
| ((mng_loopp)pChunkto)->iCount = ((mng_loopp)pChunkfrom)->iCount; |
| |
| #ifndef MNG_NO_LOOP_SIGNALS_SUPPORTED |
| if (((mng_loopp)pChunkto)->iCount) |
| { |
| mng_uint32 iLen = ((mng_loopp)pChunkto)->iCount * sizeof (mng_uint32); |
| MNG_ALLOC (pData, ((mng_loopp)pChunkto)->pSignals, iLen); |
| MNG_COPY (((mng_loopp)pChunkto)->pSignals, ((mng_loopp)pChunkfrom)->pSignals, iLen); |
| } |
| #endif |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_LOOP, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| ASSIGN_CHUNK_HDR (mng_assign_endl) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ENDL, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_ENDL) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_endlp)pChunkto)->iLevel = ((mng_endlp)pChunkfrom)->iLevel; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_ENDL, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_DEFI |
| ASSIGN_CHUNK_HDR (mng_assign_defi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_DEFI, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_DEFI) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_defip)pChunkto)->iObjectid = ((mng_defip)pChunkfrom)->iObjectid; |
| ((mng_defip)pChunkto)->bHasdonotshow = ((mng_defip)pChunkfrom)->bHasdonotshow; |
| ((mng_defip)pChunkto)->iDonotshow = ((mng_defip)pChunkfrom)->iDonotshow; |
| ((mng_defip)pChunkto)->bHasconcrete = ((mng_defip)pChunkfrom)->bHasconcrete; |
| ((mng_defip)pChunkto)->iConcrete = ((mng_defip)pChunkfrom)->iConcrete; |
| ((mng_defip)pChunkto)->bHasloca = ((mng_defip)pChunkfrom)->bHasloca; |
| ((mng_defip)pChunkto)->iXlocation = ((mng_defip)pChunkfrom)->iXlocation; |
| ((mng_defip)pChunkto)->iYlocation = ((mng_defip)pChunkfrom)->iYlocation; |
| ((mng_defip)pChunkto)->bHasclip = ((mng_defip)pChunkfrom)->bHasclip; |
| ((mng_defip)pChunkto)->iLeftcb = ((mng_defip)pChunkfrom)->iLeftcb; |
| ((mng_defip)pChunkto)->iRightcb = ((mng_defip)pChunkfrom)->iRightcb; |
| ((mng_defip)pChunkto)->iTopcb = ((mng_defip)pChunkfrom)->iTopcb; |
| ((mng_defip)pChunkto)->iBottomcb = ((mng_defip)pChunkfrom)->iBottomcb; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_DEFI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_BASI |
| ASSIGN_CHUNK_HDR (mng_assign_basi) |
| { |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_BASI, MNG_LC_START); |
| #endif |
| |
| if (((mng_chunk_headerp)pChunkfrom)->iChunkname != MNG_UINT_BASI) |
| MNG_ERROR (pData, MNG_WRONGCHUNK); /* ouch */ |
| |
| ((mng_basip)pChunkto)->iWidth = ((mng_basip)pChunkfrom)->iWidth; |
| ((mng_basip)pChunkto)->iHeight = ((mng_basip)pChunkfrom)->iHeight; |
| ((mng_basip)pChunkto)->iBitdepth = ((mng_basip)pChunkfrom)->iBitdepth; |
| ((mng_basip)pChunkto)->iColortype = ((mng_basip)pChunkfrom)->iColortype; |
| ((mng_basip)pChunkto)->iCompression = ((mng_basip)pChunkfrom)->iCompression; |
| ((mng_basip)pChunkto)->iFilter = ((mng_basip)pChunkfrom)->iFilter; |
| ((mng_basip)pChunkto)->iInterlace = ((mng_basip)pChunkfrom)->iInterlace; |
| ((mng_basip)pChunkto)->iRed = ((mng_basip)pChunkfrom)->iRed; |
| ((mng_basip)pChunkto)->iGreen = ((mng_basip)pChunkfrom)->iGreen; |
| ((mng_basip)pChunkto)->iBlue = ((mng_basip)pChunkfrom)->iBlue; |
| ((mng_basip)pChunkto)->iAlpha = ((mng_basip)pChunkfrom)->iAlpha; |
| ((mng_basip)pChunkto)->iViewable = ((mng_basip)pChunkfrom)->iViewable; |
| |
| #ifdef MNG_SUPPORT_TRACE |
| MNG_TRACE (pData, MNG_FN_ASSIGN_BASI, MNG_LC_END); |
| #endif |
| |
| return MNG_NOERROR; |
| } |
| #endif |
| #endif |
| |
| /* ************************************************************************** */ |
| |
| #ifndef MNG_OPTIMIZE_CHUNKASSIGN |
| #ifndef MNG_SKIPCHUNK_CLON |
| ASSIGN_CHUNK_HDR (mng
|