PageRenderTime 57ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/src/FreeImage/Source/LibMNG/libmng_chunk_prc.c

https://bitbucket.org/cabalistic/ogredeps/
C | 2618 lines | 1818 code | 598 blank | 202 comment | 41 complexity | 0ec3a3da5ddcd4d7a05a47beaa4cd4c7 MD5 | raw file
Possible License(s): LGPL-3.0, BSD-3-Clause, CPL-1.0, Unlicense, GPL-2.0, GPL-3.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, BSD-2-Clause, LGPL-2.1
  1. /* ************************************************************************** */
  2. /* * For conditions of distribution and use, * */
  3. /* * see copyright notice in libmng.h * */
  4. /* ************************************************************************** */
  5. /* * * */
  6. /* * project : libmng * */
  7. /* * file : libmng_chunk_prc.c copyright (c) 2000-2005 G.Juyn * */
  8. /* * version : 1.0.10 * */
  9. /* * * */
  10. /* * purpose : Chunk initialization & cleanup (implementation) * */
  11. /* * * */
  12. /* * author : G.Juyn * */
  13. /* * * */
  14. /* * comment : implementation of the chunk initialization & cleanup * */
  15. /* * routines * */
  16. /* * * */
  17. /* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
  18. /* * - changed strict-ANSI stuff * */
  19. /* * 0.5.1 - 05/12/2000 - G.Juyn * */
  20. /* * - changed trace to macro for callback error-reporting * */
  21. /* * * */
  22. /* * 0.9.1 - 07/19/2000 - G.Juyn * */
  23. /* * - fixed creation-code * */
  24. /* * * */
  25. /* * 0.9.2 - 07/31/2000 - G.Juyn * */
  26. /* * - put add_chunk() inside MNG_INCLUDE_WRITE_PROCS wrapper * */
  27. /* * 0.9.2 - 08/01/2000 - G.Juyn * */
  28. /* * - wrapper for add_chunk() changed * */
  29. /* * 0.9.2 - 08/05/2000 - G.Juyn * */
  30. /* * - changed file-prefixes * */
  31. /* * * */
  32. /* * 0.9.3 - 08/26/2000 - G.Juyn * */
  33. /* * - added MAGN chunk * */
  34. /* * 0.9.3 - 10/16/2000 - G.Juyn * */
  35. /* * - added support for JDAA * */
  36. /* * * */
  37. /* * 1.0.5 - 08/19/2002 - G.Juyn * */
  38. /* * - B597134 - libmng pollutes the linker namespace * */
  39. /* * - added HLAPI function to copy chunks * */
  40. /* * 1.0.5 - 09/14/2002 - G.Juyn * */
  41. /* * - added event handling for dynamic MNG * */
  42. /* * 1.0.5 - 10/04/2002 - G.Juyn * */
  43. /* * - fixed chunk-storage for evNT chunk * */
  44. /* * 1.0.5 - 10/17/2002 - G.Juyn * */
  45. /* * - fixed issue in freeing evNT chunk * */
  46. /* * * */
  47. /* * 1.0.6 - 07/07/2003 - G.R-P * */
  48. /* * - added MNG_SKIPCHUNK_cHNK footprint optimizations * */
  49. /* * - added MNG_NO_DELTA_PNG reduction feature * */
  50. /* * 1.0.6 - 07/14/2003 - G.R-P * */
  51. /* * - added MNG_NO_LOOP_SIGNALS_SUPPORTED conditional * */
  52. /* * 1.0.6 - 07/29/2003 - G.R-P * */
  53. /* * - added conditionals around PAST chunk support * */
  54. /* * 1.0.6 - 08/17/2003 - G.R-P * */
  55. /* * - added conditionals around non-VLC chunk support * */
  56. /* * * */
  57. /* * 1.0.7 - 03/24/2004 - G.R-P * */
  58. /* * - fixed SKIPCHUNK_eXPI -> fPRI typo * */
  59. /* * * */
  60. /* * 1.0.9 - 09/25/2004 - G.Juyn * */
  61. /* * - replaced MNG_TWEAK_LARGE_FILES with permanent solution * */
  62. /* * 1.0.9 - 12/05/2004 - G.Juyn * */
  63. /* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */
  64. /* * 1.0.9 - 12/06/2004 - G.Juyn * */
  65. /* * - added conditional MNG_OPTIMIZE_CHUNKASSIGN * */
  66. /* * 1.0.9 - 12/20/2004 - G.Juyn * */
  67. /* * - cleaned up macro-invocations (thanks to D. Airlie) * */
  68. /* * * */
  69. /* * 1.0.10 - 07/30/2005 - G.Juyn * */
  70. /* * - fixed problem with CLON object during readdisplay() * */
  71. /* * 1.0.10 - 04/08/2007 - G.Juyn * */
  72. /* * - added support for mPNG proposal * */
  73. /* * 1.0.10 - 04/12/2007 - G.Juyn * */
  74. /* * - added support for ANG proposal * */
  75. /* * * */
  76. /* ************************************************************************** */
  77. #include "libmng.h"
  78. #include "libmng_data.h"
  79. #include "libmng_error.h"
  80. #include "libmng_trace.h"
  81. #ifdef __BORLANDC__
  82. #pragma hdrstop
  83. #endif
  84. #include "libmng_memory.h"
  85. #include "libmng_chunks.h"
  86. #include "libmng_chunk_prc.h"
  87. #if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
  88. #pragma option -A /* force ANSI-C */
  89. #endif
  90. /* ************************************************************************** */
  91. /* * * */
  92. /* * General chunk routines * */
  93. /* * * */
  94. /* ************************************************************************** */
  95. void mng_add_chunk (mng_datap pData,
  96. mng_chunkp pChunk)
  97. {
  98. if (!pData->pFirstchunk) /* list is still empty ? */
  99. {
  100. pData->pFirstchunk = pChunk; /* then this becomes the first */
  101. #ifdef MNG_SUPPORT_WRITE
  102. if (!pData->iFirstchunkadded)
  103. {
  104. pData->iFirstchunkadded = ((mng_chunk_headerp)pChunk)->iChunkname;
  105. #endif
  106. if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_IHDR)
  107. pData->eImagetype = mng_it_png;
  108. else
  109. #ifdef MNG_INCLUDE_JNG
  110. if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_JHDR)
  111. pData->eImagetype = mng_it_jng;
  112. else
  113. #endif
  114. pData->eImagetype = mng_it_mng;
  115. pData->eSigtype = pData->eImagetype;
  116. #ifdef MNG_SUPPORT_WRITE
  117. }
  118. #endif
  119. }
  120. else
  121. { /* else we make appropriate links */
  122. ((mng_chunk_headerp)pChunk)->pPrev = pData->pLastchunk;
  123. ((mng_chunk_headerp)pData->pLastchunk)->pNext = pChunk;
  124. }
  125. pData->pLastchunk = pChunk; /* and it's always the last */
  126. return;
  127. }
  128. /* ************************************************************************** */
  129. /* * * */
  130. /* * Chunk specific initialization routines * */
  131. /* * * */
  132. /* ************************************************************************** */
  133. #ifdef MNG_OPTIMIZE_CHUNKINITFREE
  134. INIT_CHUNK_HDR (mng_init_general)
  135. {
  136. MNG_ALLOC (pData, *ppChunk, ((mng_chunk_headerp)pHeader)->iChunksize);
  137. MNG_COPY (*ppChunk, pHeader, sizeof (mng_chunk_header));
  138. return MNG_NOERROR;
  139. }
  140. #else /* MNG_OPTIMIZE_CHUNKINITFREE */
  141. /* ************************************************************************** */
  142. INIT_CHUNK_HDR (mng_init_ihdr)
  143. {
  144. #ifdef MNG_SUPPORT_TRACE
  145. MNG_TRACE (pData, MNG_FN_INIT_IHDR, MNG_LC_START);
  146. #endif
  147. MNG_ALLOC (pData, *ppChunk, sizeof (mng_ihdr));
  148. ((mng_ihdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  149. #ifdef MNG_SUPPORT_TRACE
  150. MNG_TRACE (pData, MNG_FN_INIT_IHDR, MNG_LC_END);
  151. #endif
  152. return MNG_NOERROR;
  153. }
  154. /* ************************************************************************** */
  155. INIT_CHUNK_HDR (mng_init_plte)
  156. {
  157. #ifdef MNG_SUPPORT_TRACE
  158. MNG_TRACE (pData, MNG_FN_INIT_PLTE, MNG_LC_START);
  159. #endif
  160. MNG_ALLOC (pData, *ppChunk, sizeof (mng_plte));
  161. ((mng_pltep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  162. #ifdef MNG_SUPPORT_TRACE
  163. MNG_TRACE (pData, MNG_FN_INIT_PLTE, MNG_LC_END);
  164. #endif
  165. return MNG_NOERROR;
  166. }
  167. /* ************************************************************************** */
  168. INIT_CHUNK_HDR (mng_init_idat)
  169. {
  170. #ifdef MNG_SUPPORT_TRACE
  171. MNG_TRACE (pData, MNG_FN_INIT_IDAT, MNG_LC_START);
  172. #endif
  173. MNG_ALLOC (pData, *ppChunk, sizeof (mng_idat));
  174. ((mng_idatp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  175. #ifdef MNG_SUPPORT_TRACE
  176. MNG_TRACE (pData, MNG_FN_INIT_IDAT, MNG_LC_END);
  177. #endif
  178. return MNG_NOERROR;
  179. }
  180. /* ************************************************************************** */
  181. INIT_CHUNK_HDR (mng_init_iend)
  182. {
  183. #ifdef MNG_SUPPORT_TRACE
  184. MNG_TRACE (pData, MNG_FN_INIT_IEND, MNG_LC_START);
  185. #endif
  186. MNG_ALLOC (pData, *ppChunk, sizeof (mng_iend));
  187. ((mng_iendp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  188. #ifdef MNG_SUPPORT_TRACE
  189. MNG_TRACE (pData, MNG_FN_INIT_IEND, MNG_LC_END);
  190. #endif
  191. return MNG_NOERROR;
  192. }
  193. /* ************************************************************************** */
  194. INIT_CHUNK_HDR (mng_init_trns)
  195. {
  196. #ifdef MNG_SUPPORT_TRACE
  197. MNG_TRACE (pData, MNG_FN_INIT_TRNS, MNG_LC_START);
  198. #endif
  199. MNG_ALLOC (pData, *ppChunk, sizeof (mng_trns));
  200. ((mng_trnsp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  201. #ifdef MNG_SUPPORT_TRACE
  202. MNG_TRACE (pData, MNG_FN_INIT_TRNS, MNG_LC_END);
  203. #endif
  204. return MNG_NOERROR;
  205. }
  206. /* ************************************************************************** */
  207. #ifndef MNG_SKIPCHUNK_gAMA
  208. INIT_CHUNK_HDR (mng_init_gama)
  209. {
  210. #ifdef MNG_SUPPORT_TRACE
  211. MNG_TRACE (pData, MNG_FN_INIT_GAMA, MNG_LC_START);
  212. #endif
  213. MNG_ALLOC (pData, *ppChunk, sizeof (mng_gama));
  214. ((mng_gamap)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  215. #ifdef MNG_SUPPORT_TRACE
  216. MNG_TRACE (pData, MNG_FN_INIT_GAMA, MNG_LC_END);
  217. #endif
  218. return MNG_NOERROR;
  219. }
  220. #endif
  221. /* ************************************************************************** */
  222. #ifndef MNG_SKIPCHUNK_cHRM
  223. INIT_CHUNK_HDR (mng_init_chrm)
  224. {
  225. #ifdef MNG_SUPPORT_TRACE
  226. MNG_TRACE (pData, MNG_FN_INIT_CHRM, MNG_LC_START);
  227. #endif
  228. MNG_ALLOC (pData, *ppChunk, sizeof (mng_chrm));
  229. ((mng_chrmp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  230. #ifdef MNG_SUPPORT_TRACE
  231. MNG_TRACE (pData, MNG_FN_INIT_CHRM, MNG_LC_END);
  232. #endif
  233. return MNG_NOERROR;
  234. }
  235. #endif
  236. /* ************************************************************************** */
  237. #ifndef MNG_SKIPCHUNK_sRGB
  238. INIT_CHUNK_HDR (mng_init_srgb)
  239. {
  240. #ifdef MNG_SUPPORT_TRACE
  241. MNG_TRACE (pData, MNG_FN_INIT_SRGB, MNG_LC_START);
  242. #endif
  243. MNG_ALLOC (pData, *ppChunk, sizeof (mng_srgb));
  244. ((mng_srgbp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  245. #ifdef MNG_SUPPORT_TRACE
  246. MNG_TRACE (pData, MNG_FN_INIT_SRGB, MNG_LC_END);
  247. #endif
  248. return MNG_NOERROR;
  249. }
  250. #endif
  251. /* ************************************************************************** */
  252. #ifndef MNG_SKIPCHUNK_iCCP
  253. INIT_CHUNK_HDR (mng_init_iccp)
  254. {
  255. #ifdef MNG_SUPPORT_TRACE
  256. MNG_TRACE (pData, MNG_FN_INIT_ICCP, MNG_LC_START);
  257. #endif
  258. MNG_ALLOC (pData, *ppChunk, sizeof (mng_iccp));
  259. ((mng_iccpp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  260. #ifdef MNG_SUPPORT_TRACE
  261. MNG_TRACE (pData, MNG_FN_INIT_ICCP, MNG_LC_END);
  262. #endif
  263. return MNG_NOERROR;
  264. }
  265. #endif
  266. /* ************************************************************************** */
  267. #ifndef MNG_SKIPCHUNK_tEXt
  268. INIT_CHUNK_HDR (mng_init_text)
  269. {
  270. #ifdef MNG_SUPPORT_TRACE
  271. MNG_TRACE (pData, MNG_FN_INIT_TEXT, MNG_LC_START);
  272. #endif
  273. MNG_ALLOC (pData, *ppChunk, sizeof (mng_text));
  274. ((mng_textp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  275. #ifdef MNG_SUPPORT_TRACE
  276. MNG_TRACE (pData, MNG_FN_INIT_TEXT, MNG_LC_END);
  277. #endif
  278. return MNG_NOERROR;
  279. }
  280. #endif
  281. /* ************************************************************************** */
  282. #ifndef MNG_SKIPCHUNK_zTXt
  283. INIT_CHUNK_HDR (mng_init_ztxt)
  284. {
  285. #ifdef MNG_SUPPORT_TRACE
  286. MNG_TRACE (pData, MNG_FN_INIT_ZTXT, MNG_LC_START);
  287. #endif
  288. MNG_ALLOC (pData, *ppChunk, sizeof (mng_ztxt));
  289. ((mng_ztxtp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  290. #ifdef MNG_SUPPORT_TRACE
  291. MNG_TRACE (pData, MNG_FN_INIT_ZTXT, MNG_LC_END);
  292. #endif
  293. return MNG_NOERROR;
  294. }
  295. #endif
  296. /* ************************************************************************** */
  297. #ifndef MNG_SKIPCHUNK_iTXt
  298. INIT_CHUNK_HDR (mng_init_itxt)
  299. {
  300. #ifdef MNG_SUPPORT_TRACE
  301. MNG_TRACE (pData, MNG_FN_INIT_ITXT, MNG_LC_START);
  302. #endif
  303. MNG_ALLOC (pData, *ppChunk, sizeof (mng_itxt));
  304. ((mng_itxtp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  305. #ifdef MNG_SUPPORT_TRACE
  306. MNG_TRACE (pData, MNG_FN_INIT_ITXT, MNG_LC_END);
  307. #endif
  308. return MNG_NOERROR;
  309. }
  310. #endif
  311. /* ************************************************************************** */
  312. #ifndef MNG_SKIPCHUNK_bKGD
  313. INIT_CHUNK_HDR (mng_init_bkgd)
  314. {
  315. #ifdef MNG_SUPPORT_TRACE
  316. MNG_TRACE (pData, MNG_FN_INIT_BKGD, MNG_LC_START);
  317. #endif
  318. MNG_ALLOC (pData, *ppChunk, sizeof (mng_bkgd));
  319. ((mng_bkgdp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  320. #ifdef MNG_SUPPORT_TRACE
  321. MNG_TRACE (pData, MNG_FN_INIT_BKGD, MNG_LC_END);
  322. #endif
  323. return MNG_NOERROR;
  324. }
  325. #endif
  326. /* ************************************************************************** */
  327. #ifndef MNG_SKIPCHUNK_pHYs
  328. INIT_CHUNK_HDR (mng_init_phys)
  329. {
  330. #ifdef MNG_SUPPORT_TRACE
  331. MNG_TRACE (pData, MNG_FN_INIT_PHYS, MNG_LC_START);
  332. #endif
  333. MNG_ALLOC (pData, *ppChunk, sizeof (mng_phys));
  334. ((mng_physp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  335. #ifdef MNG_SUPPORT_TRACE
  336. MNG_TRACE (pData, MNG_FN_INIT_PHYS, MNG_LC_END);
  337. #endif
  338. return MNG_NOERROR;
  339. }
  340. #endif
  341. /* ************************************************************************** */
  342. #ifndef MNG_SKIPCHUNK_sBIT
  343. INIT_CHUNK_HDR (mng_init_sbit)
  344. {
  345. #ifdef MNG_SUPPORT_TRACE
  346. MNG_TRACE (pData, MNG_FN_INIT_SBIT, MNG_LC_START);
  347. #endif
  348. MNG_ALLOC (pData, *ppChunk, sizeof (mng_sbit));
  349. ((mng_sbitp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  350. #ifdef MNG_SUPPORT_TRACE
  351. MNG_TRACE (pData, MNG_FN_INIT_SBIT, MNG_LC_END);
  352. #endif
  353. return MNG_NOERROR;
  354. }
  355. #endif
  356. /* ************************************************************************** */
  357. #ifndef MNG_SKIPCHUNK_sPLT
  358. INIT_CHUNK_HDR (mng_init_splt)
  359. {
  360. #ifdef MNG_SUPPORT_TRACE
  361. MNG_TRACE (pData, MNG_FN_INIT_SPLT, MNG_LC_START);
  362. #endif
  363. MNG_ALLOC (pData, *ppChunk, sizeof (mng_splt));
  364. ((mng_spltp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  365. #ifdef MNG_SUPPORT_TRACE
  366. MNG_TRACE (pData, MNG_FN_INIT_SPLT, MNG_LC_END);
  367. #endif
  368. return MNG_NOERROR;
  369. }
  370. #endif
  371. /* ************************************************************************** */
  372. #ifndef MNG_SKIPCHUNK_hIST
  373. INIT_CHUNK_HDR (mng_init_hist)
  374. {
  375. #ifdef MNG_SUPPORT_TRACE
  376. MNG_TRACE (pData, MNG_FN_INIT_HIST, MNG_LC_START);
  377. #endif
  378. MNG_ALLOC (pData, *ppChunk, sizeof (mng_hist));
  379. ((mng_histp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  380. #ifdef MNG_SUPPORT_TRACE
  381. MNG_TRACE (pData, MNG_FN_INIT_HIST, MNG_LC_END);
  382. #endif
  383. return MNG_NOERROR;
  384. }
  385. #endif
  386. /* ************************************************************************** */
  387. #ifndef MNG_SKIPCHUNK_tIME
  388. INIT_CHUNK_HDR (mng_init_time)
  389. {
  390. #ifdef MNG_SUPPORT_TRACE
  391. MNG_TRACE (pData, MNG_FN_INIT_TIME, MNG_LC_START);
  392. #endif
  393. MNG_ALLOC (pData, *ppChunk, sizeof (mng_time));
  394. ((mng_timep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  395. #ifdef MNG_SUPPORT_TRACE
  396. MNG_TRACE (pData, MNG_FN_INIT_TIME, MNG_LC_END);
  397. #endif
  398. return MNG_NOERROR;
  399. }
  400. #endif
  401. /* ************************************************************************** */
  402. INIT_CHUNK_HDR (mng_init_mhdr)
  403. {
  404. #ifdef MNG_SUPPORT_TRACE
  405. MNG_TRACE (pData, MNG_FN_INIT_MHDR, MNG_LC_START);
  406. #endif
  407. MNG_ALLOC (pData, *ppChunk, sizeof (mng_mhdr));
  408. ((mng_mhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  409. #ifdef MNG_SUPPORT_TRACE
  410. MNG_TRACE (pData, MNG_FN_INIT_MHDR, MNG_LC_END);
  411. #endif
  412. return MNG_NOERROR;
  413. }
  414. /* ************************************************************************** */
  415. INIT_CHUNK_HDR (mng_init_mend)
  416. {
  417. #ifdef MNG_SUPPORT_TRACE
  418. MNG_TRACE (pData, MNG_FN_INIT_MEND, MNG_LC_START);
  419. #endif
  420. MNG_ALLOC (pData, *ppChunk, sizeof (mng_mend));
  421. ((mng_mendp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  422. #ifdef MNG_SUPPORT_TRACE
  423. MNG_TRACE (pData, MNG_FN_INIT_MEND, MNG_LC_END);
  424. #endif
  425. return MNG_NOERROR;
  426. }
  427. /* ************************************************************************** */
  428. #ifndef MNG_SKIPCHUNK_LOOP
  429. INIT_CHUNK_HDR (mng_init_loop)
  430. {
  431. #ifdef MNG_SUPPORT_TRACE
  432. MNG_TRACE (pData, MNG_FN_INIT_LOOP, MNG_LC_START);
  433. #endif
  434. MNG_ALLOC (pData, *ppChunk, sizeof (mng_loop));
  435. ((mng_loopp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  436. #ifdef MNG_SUPPORT_TRACE
  437. MNG_TRACE (pData, MNG_FN_INIT_LOOP, MNG_LC_END);
  438. #endif
  439. return MNG_NOERROR;
  440. }
  441. /* ************************************************************************** */
  442. INIT_CHUNK_HDR (mng_init_endl)
  443. {
  444. #ifdef MNG_SUPPORT_TRACE
  445. MNG_TRACE (pData, MNG_FN_INIT_ENDL, MNG_LC_START);
  446. #endif
  447. MNG_ALLOC (pData, *ppChunk, sizeof (mng_endl));
  448. ((mng_endlp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  449. #ifdef MNG_SUPPORT_TRACE
  450. MNG_TRACE (pData, MNG_FN_INIT_ENDL, MNG_LC_END);
  451. #endif
  452. return MNG_NOERROR;
  453. }
  454. #endif
  455. /* ************************************************************************** */
  456. #ifndef MNG_SKIPCHUNK_DEFI
  457. INIT_CHUNK_HDR (mng_init_defi)
  458. {
  459. #ifdef MNG_SUPPORT_TRACE
  460. MNG_TRACE (pData, MNG_FN_INIT_DEFI, MNG_LC_START);
  461. #endif
  462. MNG_ALLOC (pData, *ppChunk, sizeof (mng_defi));
  463. ((mng_defip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  464. #ifdef MNG_SUPPORT_TRACE
  465. MNG_TRACE (pData, MNG_FN_INIT_DEFI, MNG_LC_END);
  466. #endif
  467. return MNG_NOERROR;
  468. }
  469. #endif
  470. /* ************************************************************************** */
  471. #ifndef MNG_SKIPCHUNK_BASI
  472. INIT_CHUNK_HDR (mng_init_basi)
  473. {
  474. #ifdef MNG_SUPPORT_TRACE
  475. MNG_TRACE (pData, MNG_FN_INIT_BASI, MNG_LC_START);
  476. #endif
  477. MNG_ALLOC (pData, *ppChunk, sizeof (mng_basi));
  478. ((mng_basip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  479. #ifdef MNG_SUPPORT_TRACE
  480. MNG_TRACE (pData, MNG_FN_INIT_BASI, MNG_LC_END);
  481. #endif
  482. return MNG_NOERROR;
  483. }
  484. #endif
  485. /* ************************************************************************** */
  486. #ifndef MNG_SKIPCHUNK_CLON
  487. INIT_CHUNK_HDR (mng_init_clon)
  488. {
  489. #ifdef MNG_SUPPORT_TRACE
  490. MNG_TRACE (pData, MNG_FN_INIT_CLON, MNG_LC_START);
  491. #endif
  492. MNG_ALLOC (pData, *ppChunk, sizeof (mng_clon));
  493. ((mng_clonp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  494. #ifdef MNG_SUPPORT_TRACE
  495. MNG_TRACE (pData, MNG_FN_INIT_CLON, MNG_LC_END);
  496. #endif
  497. return MNG_NOERROR;
  498. }
  499. #endif
  500. /* ************************************************************************** */
  501. #ifndef MNG_SKIPCHUNK_PAST
  502. INIT_CHUNK_HDR (mng_init_past)
  503. {
  504. #ifdef MNG_SUPPORT_TRACE
  505. MNG_TRACE (pData, MNG_FN_INIT_PAST, MNG_LC_START);
  506. #endif
  507. MNG_ALLOC (pData, *ppChunk, sizeof (mng_past));
  508. ((mng_pastp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  509. #ifdef MNG_SUPPORT_TRACE
  510. MNG_TRACE (pData, MNG_FN_INIT_PAST, MNG_LC_END);
  511. #endif
  512. return MNG_NOERROR;
  513. }
  514. #endif
  515. /* ************************************************************************** */
  516. #ifndef MNG_SKIPCHUNK_DISC
  517. INIT_CHUNK_HDR (mng_init_disc)
  518. {
  519. #ifdef MNG_SUPPORT_TRACE
  520. MNG_TRACE (pData, MNG_FN_INIT_DISC, MNG_LC_START);
  521. #endif
  522. MNG_ALLOC (pData, *ppChunk, sizeof (mng_disc));
  523. ((mng_discp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  524. #ifdef MNG_SUPPORT_TRACE
  525. MNG_TRACE (pData, MNG_FN_INIT_DISC, MNG_LC_END);
  526. #endif
  527. return MNG_NOERROR;
  528. }
  529. #endif
  530. /* ************************************************************************** */
  531. #ifndef MNG_SKIPCHUNK_BACK
  532. INIT_CHUNK_HDR (mng_init_back)
  533. {
  534. #ifdef MNG_SUPPORT_TRACE
  535. MNG_TRACE (pData, MNG_FN_INIT_BACK, MNG_LC_START);
  536. #endif
  537. MNG_ALLOC (pData, *ppChunk, sizeof (mng_back));
  538. ((mng_backp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  539. #ifdef MNG_SUPPORT_TRACE
  540. MNG_TRACE (pData, MNG_FN_INIT_BACK, MNG_LC_END);
  541. #endif
  542. return MNG_NOERROR;
  543. }
  544. #endif
  545. /* ************************************************************************** */
  546. #ifndef MNG_SKIPCHUNK_FRAM
  547. INIT_CHUNK_HDR (mng_init_fram)
  548. {
  549. #ifdef MNG_SUPPORT_TRACE
  550. MNG_TRACE (pData, MNG_FN_INIT_FRAM, MNG_LC_START);
  551. #endif
  552. MNG_ALLOC (pData, *ppChunk, sizeof (mng_fram));
  553. ((mng_framp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  554. #ifdef MNG_SUPPORT_TRACE
  555. MNG_TRACE (pData, MNG_FN_INIT_FRAM, MNG_LC_END);
  556. #endif
  557. return MNG_NOERROR;
  558. }
  559. #endif
  560. /* ************************************************************************** */
  561. #ifndef MNG_SKIPCHUNK_MOVE
  562. INIT_CHUNK_HDR (mng_init_move)
  563. {
  564. #ifdef MNG_SUPPORT_TRACE
  565. MNG_TRACE (pData, MNG_FN_INIT_MOVE, MNG_LC_START);
  566. #endif
  567. MNG_ALLOC (pData, *ppChunk, sizeof (mng_move));
  568. ((mng_movep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  569. #ifdef MNG_SUPPORT_TRACE
  570. MNG_TRACE (pData, MNG_FN_INIT_MOVE, MNG_LC_END);
  571. #endif
  572. return MNG_NOERROR;
  573. }
  574. #endif
  575. /* ************************************************************************** */
  576. #ifndef MNG_SKIPCHUNK_CLIP
  577. INIT_CHUNK_HDR (mng_init_clip)
  578. {
  579. #ifdef MNG_SUPPORT_TRACE
  580. MNG_TRACE (pData, MNG_FN_INIT_CLIP, MNG_LC_START);
  581. #endif
  582. MNG_ALLOC (pData, *ppChunk, sizeof (mng_clip));
  583. ((mng_clipp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  584. #ifdef MNG_SUPPORT_TRACE
  585. MNG_TRACE (pData, MNG_FN_INIT_CLIP, MNG_LC_END);
  586. #endif
  587. return MNG_NOERROR;
  588. }
  589. #endif
  590. /* ************************************************************************** */
  591. #ifndef MNG_SKIPCHUNK_SHOW
  592. INIT_CHUNK_HDR (mng_init_show)
  593. {
  594. #ifdef MNG_SUPPORT_TRACE
  595. MNG_TRACE (pData, MNG_FN_INIT_SHOW, MNG_LC_START);
  596. #endif
  597. MNG_ALLOC (pData, *ppChunk, sizeof (mng_show));
  598. ((mng_showp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  599. #ifdef MNG_SUPPORT_TRACE
  600. MNG_TRACE (pData, MNG_FN_INIT_SHOW, MNG_LC_END);
  601. #endif
  602. return MNG_NOERROR;
  603. }
  604. #endif
  605. /* ************************************************************************** */
  606. #ifndef MNG_SKIPCHUNK_TERM
  607. INIT_CHUNK_HDR (mng_init_term)
  608. {
  609. #ifdef MNG_SUPPORT_TRACE
  610. MNG_TRACE (pData, MNG_FN_INIT_TERM, MNG_LC_START);
  611. #endif
  612. MNG_ALLOC (pData, *ppChunk, sizeof (mng_term));
  613. ((mng_termp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  614. #ifdef MNG_SUPPORT_TRACE
  615. MNG_TRACE (pData, MNG_FN_INIT_TERM, MNG_LC_END);
  616. #endif
  617. return MNG_NOERROR;
  618. }
  619. #endif
  620. /* ************************************************************************** */
  621. #ifndef MNG_SKIPCHUNK_SAVE
  622. INIT_CHUNK_HDR (mng_init_save)
  623. {
  624. #ifdef MNG_SUPPORT_TRACE
  625. MNG_TRACE (pData, MNG_FN_INIT_SAVE, MNG_LC_START);
  626. #endif
  627. MNG_ALLOC (pData, *ppChunk, sizeof (mng_save));
  628. ((mng_savep)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  629. #ifdef MNG_SUPPORT_TRACE
  630. MNG_TRACE (pData, MNG_FN_INIT_SAVE, MNG_LC_END);
  631. #endif
  632. return MNG_NOERROR;
  633. }
  634. #endif
  635. /* ************************************************************************** */
  636. #ifndef MNG_SKIPCHUNK_SEEK
  637. INIT_CHUNK_HDR (mng_init_seek)
  638. {
  639. #ifdef MNG_SUPPORT_TRACE
  640. MNG_TRACE (pData, MNG_FN_INIT_SEEK, MNG_LC_START);
  641. #endif
  642. MNG_ALLOC (pData, *ppChunk, sizeof (mng_seek));
  643. ((mng_seekp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  644. #ifdef MNG_SUPPORT_TRACE
  645. MNG_TRACE (pData, MNG_FN_INIT_SEEK, MNG_LC_END);
  646. #endif
  647. return MNG_NOERROR;
  648. }
  649. #endif
  650. /* ************************************************************************** */
  651. #ifndef MNG_SKIPCHUNK_eXPI
  652. INIT_CHUNK_HDR (mng_init_expi)
  653. {
  654. #ifdef MNG_SUPPORT_TRACE
  655. MNG_TRACE (pData, MNG_FN_INIT_EXPI, MNG_LC_START);
  656. #endif
  657. MNG_ALLOC (pData, *ppChunk, sizeof (mng_expi));
  658. ((mng_expip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  659. #ifdef MNG_SUPPORT_TRACE
  660. MNG_TRACE (pData, MNG_FN_INIT_EXPI, MNG_LC_END);
  661. #endif
  662. return MNG_NOERROR;
  663. }
  664. #endif
  665. /* ************************************************************************** */
  666. #ifndef MNG_SKIPCHUNK_fPRI
  667. INIT_CHUNK_HDR (mng_init_fpri)
  668. {
  669. #ifdef MNG_SUPPORT_TRACE
  670. MNG_TRACE (pData, MNG_FN_INIT_FPRI, MNG_LC_START);
  671. #endif
  672. MNG_ALLOC (pData, *ppChunk, sizeof (mng_fpri));
  673. ((mng_fprip)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  674. #ifdef MNG_SUPPORT_TRACE
  675. MNG_TRACE (pData, MNG_FN_INIT_FPRI, MNG_LC_END);
  676. #endif
  677. return MNG_NOERROR;
  678. }
  679. #endif
  680. /* ************************************************************************** */
  681. #ifndef MNG_SKIPCHUNK_nEED
  682. INIT_CHUNK_HDR (mng_init_need)
  683. {
  684. #ifdef MNG_SUPPORT_TRACE
  685. MNG_TRACE (pData, MNG_FN_INIT_NEED, MNG_LC_START);
  686. #endif
  687. MNG_ALLOC (pData, *ppChunk, sizeof (mng_need));
  688. ((mng_needp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  689. #ifdef MNG_SUPPORT_TRACE
  690. MNG_TRACE (pData, MNG_FN_INIT_NEED, MNG_LC_END);
  691. #endif
  692. return MNG_NOERROR;
  693. }
  694. #endif
  695. /* ************************************************************************** */
  696. #ifndef MNG_SKIPCHUNK_pHYg
  697. INIT_CHUNK_HDR (mng_init_phyg)
  698. {
  699. #ifdef MNG_SUPPORT_TRACE
  700. MNG_TRACE (pData, MNG_FN_INIT_PHYG, MNG_LC_START);
  701. #endif
  702. MNG_ALLOC (pData, *ppChunk, sizeof (mng_phyg));
  703. ((mng_phygp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  704. #ifdef MNG_SUPPORT_TRACE
  705. MNG_TRACE (pData, MNG_FN_INIT_PHYG, MNG_LC_END);
  706. #endif
  707. return MNG_NOERROR;
  708. }
  709. #endif
  710. /* ************************************************************************** */
  711. #ifdef MNG_INCLUDE_JNG
  712. INIT_CHUNK_HDR (mng_init_jhdr)
  713. {
  714. #ifdef MNG_SUPPORT_TRACE
  715. MNG_TRACE (pData, MNG_FN_INIT_JHDR, MNG_LC_START);
  716. #endif
  717. MNG_ALLOC (pData, *ppChunk, sizeof (mng_jhdr));
  718. ((mng_jhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  719. #ifdef MNG_SUPPORT_TRACE
  720. MNG_TRACE (pData, MNG_FN_INIT_JHDR, MNG_LC_END);
  721. #endif
  722. return MNG_NOERROR;
  723. }
  724. #endif /* MNG_INCLUDE_JNG */
  725. /* ************************************************************************** */
  726. #ifdef MNG_INCLUDE_JNG
  727. INIT_CHUNK_HDR (mng_init_jdaa)
  728. {
  729. #ifdef MNG_SUPPORT_TRACE
  730. MNG_TRACE (pData, MNG_FN_INIT_JDAA, MNG_LC_START);
  731. #endif
  732. MNG_ALLOC (pData, *ppChunk, sizeof (mng_jdaa));
  733. ((mng_jdaap)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  734. #ifdef MNG_SUPPORT_TRACE
  735. MNG_TRACE (pData, MNG_FN_INIT_JDAA, MNG_LC_END);
  736. #endif
  737. return MNG_NOERROR;
  738. }
  739. #endif /* MNG_INCLUDE_JNG */
  740. /* ************************************************************************** */
  741. #ifdef MNG_INCLUDE_JNG
  742. INIT_CHUNK_HDR (mng_init_jdat)
  743. {
  744. #ifdef MNG_SUPPORT_TRACE
  745. MNG_TRACE (pData, MNG_FN_INIT_JDAT, MNG_LC_START);
  746. #endif
  747. MNG_ALLOC (pData, *ppChunk, sizeof (mng_jdat));
  748. ((mng_jdatp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  749. #ifdef MNG_SUPPORT_TRACE
  750. MNG_TRACE (pData, MNG_FN_INIT_JDAT, MNG_LC_END);
  751. #endif
  752. return MNG_NOERROR;
  753. }
  754. #endif /* MNG_INCLUDE_JNG */
  755. /* ************************************************************************** */
  756. #ifdef MNG_INCLUDE_JNG
  757. INIT_CHUNK_HDR (mng_init_jsep)
  758. {
  759. #ifdef MNG_SUPPORT_TRACE
  760. MNG_TRACE (pData, MNG_FN_INIT_JSEP, MNG_LC_START);
  761. #endif
  762. MNG_ALLOC (pData, *ppChunk, sizeof (mng_jsep));
  763. ((mng_jsepp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  764. #ifdef MNG_SUPPORT_TRACE
  765. MNG_TRACE (pData, MNG_FN_INIT_JSEP, MNG_LC_END);
  766. #endif
  767. return MNG_NOERROR;
  768. }
  769. #endif /* MNG_INCLUDE_JNG */
  770. /* ************************************************************************** */
  771. #ifndef MNG_NO_DELTA_PNG
  772. INIT_CHUNK_HDR (mng_init_dhdr)
  773. {
  774. #ifdef MNG_SUPPORT_TRACE
  775. MNG_TRACE (pData, MNG_FN_INIT_DHDR, MNG_LC_START);
  776. #endif
  777. MNG_ALLOC (pData, *ppChunk, sizeof (mng_dhdr));
  778. ((mng_dhdrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  779. #ifdef MNG_SUPPORT_TRACE
  780. MNG_TRACE (pData, MNG_FN_INIT_DHDR, MNG_LC_END);
  781. #endif
  782. return MNG_NOERROR;
  783. }
  784. #endif
  785. /* ************************************************************************** */
  786. #ifndef MNG_NO_DELTA_PNG
  787. INIT_CHUNK_HDR (mng_init_prom)
  788. {
  789. #ifdef MNG_SUPPORT_TRACE
  790. MNG_TRACE (pData, MNG_FN_INIT_PROM, MNG_LC_START);
  791. #endif
  792. MNG_ALLOC (pData, *ppChunk, sizeof (mng_prom));
  793. ((mng_promp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  794. #ifdef MNG_SUPPORT_TRACE
  795. MNG_TRACE (pData, MNG_FN_INIT_PROM, MNG_LC_END);
  796. #endif
  797. return MNG_NOERROR;
  798. }
  799. #endif
  800. /* ************************************************************************** */
  801. #ifndef MNG_NO_DELTA_PNG
  802. INIT_CHUNK_HDR (mng_init_ipng)
  803. {
  804. #ifdef MNG_SUPPORT_TRACE
  805. MNG_TRACE (pData, MNG_FN_INIT_IPNG, MNG_LC_START);
  806. #endif
  807. MNG_ALLOC (pData, *ppChunk, sizeof (mng_ipng));
  808. ((mng_ipngp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  809. #ifdef MNG_SUPPORT_TRACE
  810. MNG_TRACE (pData, MNG_FN_INIT_IPNG, MNG_LC_END);
  811. #endif
  812. return MNG_NOERROR;
  813. }
  814. #endif
  815. /* ************************************************************************** */
  816. #ifndef MNG_NO_DELTA_PNG
  817. INIT_CHUNK_HDR (mng_init_pplt)
  818. {
  819. #ifdef MNG_SUPPORT_TRACE
  820. MNG_TRACE (pData, MNG_FN_INIT_PPLT, MNG_LC_START);
  821. #endif
  822. MNG_ALLOC (pData, *ppChunk, sizeof (mng_pplt));
  823. ((mng_ppltp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  824. #ifdef MNG_SUPPORT_TRACE
  825. MNG_TRACE (pData, MNG_FN_INIT_PPLT, MNG_LC_END);
  826. #endif
  827. return MNG_NOERROR;
  828. }
  829. #endif
  830. /* ************************************************************************** */
  831. #ifndef MNG_NO_DELTA_PNG
  832. #ifdef MNG_INCLUDE_JNG
  833. INIT_CHUNK_HDR (mng_init_ijng)
  834. {
  835. #ifdef MNG_SUPPORT_TRACE
  836. MNG_TRACE (pData, MNG_FN_INIT_IJNG, MNG_LC_START);
  837. #endif
  838. MNG_ALLOC (pData, *ppChunk, sizeof (mng_ijng));
  839. ((mng_ijngp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  840. #ifdef MNG_SUPPORT_TRACE
  841. MNG_TRACE (pData, MNG_FN_INIT_IJNG, MNG_LC_END);
  842. #endif
  843. return MNG_NOERROR;
  844. }
  845. #endif
  846. #endif
  847. /* ************************************************************************** */
  848. #ifndef MNG_NO_DELTA_PNG
  849. INIT_CHUNK_HDR (mng_init_drop)
  850. {
  851. #ifdef MNG_SUPPORT_TRACE
  852. MNG_TRACE (pData, MNG_FN_INIT_DROP, MNG_LC_START);
  853. #endif
  854. MNG_ALLOC (pData, *ppChunk, sizeof (mng_drop));
  855. ((mng_dropp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  856. #ifdef MNG_SUPPORT_TRACE
  857. MNG_TRACE (pData, MNG_FN_INIT_DROP, MNG_LC_END);
  858. #endif
  859. return MNG_NOERROR;
  860. }
  861. #endif
  862. /* ************************************************************************** */
  863. #ifndef MNG_NO_DELTA_PNG
  864. #ifndef MNG_SKIPCHUNK_DBYK
  865. INIT_CHUNK_HDR (mng_init_dbyk)
  866. {
  867. #ifdef MNG_SUPPORT_TRACE
  868. MNG_TRACE (pData, MNG_FN_INIT_DBYK, MNG_LC_START);
  869. #endif
  870. MNG_ALLOC (pData, *ppChunk, sizeof (mng_dbyk));
  871. ((mng_dbykp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  872. #ifdef MNG_SUPPORT_TRACE
  873. MNG_TRACE (pData, MNG_FN_INIT_DBYK, MNG_LC_END);
  874. #endif
  875. return MNG_NOERROR;
  876. }
  877. #endif
  878. #endif
  879. /* ************************************************************************** */
  880. #ifndef MNG_NO_DELTA_PNG
  881. #ifndef MNG_SKIPCHUNK_ORDR
  882. INIT_CHUNK_HDR (mng_init_ordr)
  883. {
  884. #ifdef MNG_SUPPORT_TRACE
  885. MNG_TRACE (pData, MNG_FN_INIT_ORDR, MNG_LC_START);
  886. #endif
  887. MNG_ALLOC (pData, *ppChunk, sizeof (mng_ordr));
  888. ((mng_ordrp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  889. #ifdef MNG_SUPPORT_TRACE
  890. MNG_TRACE (pData, MNG_FN_INIT_ORDR, MNG_LC_END);
  891. #endif
  892. return MNG_NOERROR;
  893. }
  894. #endif
  895. #endif
  896. /* ************************************************************************** */
  897. #ifndef MNG_SKIPCHUNK_MAGN
  898. INIT_CHUNK_HDR (mng_init_magn)
  899. {
  900. #ifdef MNG_SUPPORT_TRACE
  901. MNG_TRACE (pData, MNG_FN_INIT_MAGN, MNG_LC_START);
  902. #endif
  903. MNG_ALLOC (pData, *ppChunk, sizeof (mng_magn));
  904. ((mng_magnp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  905. #ifdef MNG_SUPPORT_TRACE
  906. MNG_TRACE (pData, MNG_FN_INIT_MAGN, MNG_LC_END);
  907. #endif
  908. return MNG_NOERROR;
  909. }
  910. #endif
  911. /* ************************************************************************** */
  912. #ifndef MNG_SKIPCHUNK_evNT
  913. INIT_CHUNK_HDR (mng_init_evnt)
  914. {
  915. #ifdef MNG_SUPPORT_TRACE
  916. MNG_TRACE (pData, MNG_FN_INIT_EVNT, MNG_LC_START);
  917. #endif
  918. MNG_ALLOC (pData, *ppChunk, sizeof (mng_evnt));
  919. ((mng_evntp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  920. #ifdef MNG_SUPPORT_TRACE
  921. MNG_TRACE (pData, MNG_FN_INIT_EVNT, MNG_LC_END);
  922. #endif
  923. return MNG_NOERROR;
  924. }
  925. #endif
  926. /* ************************************************************************** */
  927. INIT_CHUNK_HDR (mng_init_unknown)
  928. {
  929. #ifdef MNG_SUPPORT_TRACE
  930. MNG_TRACE (pData, MNG_FN_INIT_UNKNOWN, MNG_LC_START);
  931. #endif
  932. MNG_ALLOC (pData, *ppChunk, sizeof (mng_unknown_chunk));
  933. ((mng_unknown_chunkp)*ppChunk)->sHeader = *((mng_chunk_headerp)pHeader);
  934. #ifdef MNG_SUPPORT_TRACE
  935. MNG_TRACE (pData, MNG_FN_INIT_UNKNOWN, MNG_LC_END);
  936. #endif
  937. return MNG_NOERROR;
  938. }
  939. /* ************************************************************************** */
  940. #endif /* MNG_OPTIMIZE_CHUNKINITFREE */
  941. /* ************************************************************************** */
  942. /* * * */
  943. /* * Chunk specific cleanup routines * */
  944. /* * * */
  945. /* ************************************************************************** */
  946. #ifdef MNG_OPTIMIZE_CHUNKINITFREE
  947. FREE_CHUNK_HDR (mng_free_general)
  948. {
  949. MNG_FREEX (pData, pHeader, ((mng_chunk_headerp)pHeader)->iChunksize);
  950. return MNG_NOERROR;
  951. }
  952. #endif
  953. /* ************************************************************************** */
  954. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  955. FREE_CHUNK_HDR (mng_free_ihdr)
  956. {
  957. #ifdef MNG_SUPPORT_TRACE
  958. MNG_TRACE (pData, MNG_FN_FREE_IHDR, MNG_LC_START);
  959. #endif
  960. MNG_FREEX (pData, pHeader, sizeof (mng_ihdr));
  961. #ifdef MNG_SUPPORT_TRACE
  962. MNG_TRACE (pData, MNG_FN_FREE_IHDR, MNG_LC_END);
  963. #endif
  964. return MNG_NOERROR;
  965. }
  966. #endif
  967. /* ************************************************************************** */
  968. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  969. FREE_CHUNK_HDR (mng_free_plte)
  970. {
  971. #ifdef MNG_SUPPORT_TRACE
  972. MNG_TRACE (pData, MNG_FN_FREE_PLTE, MNG_LC_START);
  973. #endif
  974. MNG_FREEX (pData, pHeader, sizeof (mng_plte));
  975. #ifdef MNG_SUPPORT_TRACE
  976. MNG_TRACE (pData, MNG_FN_FREE_PLTE, MNG_LC_END);
  977. #endif
  978. return MNG_NOERROR;
  979. }
  980. #endif
  981. /* ************************************************************************** */
  982. FREE_CHUNK_HDR (mng_free_idat)
  983. {
  984. #ifdef MNG_SUPPORT_TRACE
  985. MNG_TRACE (pData, MNG_FN_FREE_IDAT, MNG_LC_START);
  986. #endif
  987. if (((mng_idatp)pHeader)->iDatasize)
  988. MNG_FREEX (pData, ((mng_idatp)pHeader)->pData,
  989. ((mng_idatp)pHeader)->iDatasize);
  990. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  991. MNG_FREEX (pData, pHeader, sizeof (mng_idat));
  992. #endif
  993. #ifdef MNG_SUPPORT_TRACE
  994. MNG_TRACE (pData, MNG_FN_FREE_IDAT, MNG_LC_END);
  995. #endif
  996. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  997. return MNG_NOERROR;
  998. #else
  999. return mng_free_general(pData, pHeader);
  1000. #endif
  1001. }
  1002. /* ************************************************************************** */
  1003. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1004. FREE_CHUNK_HDR (mng_free_iend)
  1005. {
  1006. #ifdef MNG_SUPPORT_TRACE
  1007. MNG_TRACE (pData, MNG_FN_FREE_IEND, MNG_LC_START);
  1008. #endif
  1009. MNG_FREEX (pData, pHeader, sizeof (mng_iend));
  1010. #ifdef MNG_SUPPORT_TRACE
  1011. MNG_TRACE (pData, MNG_FN_FREE_IEND, MNG_LC_END);
  1012. #endif
  1013. return MNG_NOERROR;
  1014. }
  1015. #endif
  1016. /* ************************************************************************** */
  1017. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1018. FREE_CHUNK_HDR (mng_free_trns)
  1019. {
  1020. #ifdef MNG_SUPPORT_TRACE
  1021. MNG_TRACE (pData, MNG_FN_FREE_TRNS, MNG_LC_START);
  1022. #endif
  1023. MNG_FREEX (pData, pHeader, sizeof (mng_trns));
  1024. #ifdef MNG_SUPPORT_TRACE
  1025. MNG_TRACE (pData, MNG_FN_FREE_TRNS, MNG_LC_END);
  1026. #endif
  1027. return MNG_NOERROR;
  1028. }
  1029. #endif
  1030. /* ************************************************************************** */
  1031. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1032. #ifndef MNG_SKIPCHUNK_gAMA
  1033. FREE_CHUNK_HDR (mng_free_gama)
  1034. {
  1035. #ifdef MNG_SUPPORT_TRACE
  1036. MNG_TRACE (pData, MNG_FN_FREE_GAMA, MNG_LC_START);
  1037. #endif
  1038. MNG_FREEX (pData, pHeader, sizeof (mng_gama));
  1039. #ifdef MNG_SUPPORT_TRACE
  1040. MNG_TRACE (pData, MNG_FN_FREE_GAMA, MNG_LC_END);
  1041. #endif
  1042. return MNG_NOERROR;
  1043. }
  1044. #endif
  1045. #endif
  1046. /* ************************************************************************** */
  1047. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1048. #ifndef MNG_SKIPCHUNK_cHRM
  1049. FREE_CHUNK_HDR (mng_free_chrm)
  1050. {
  1051. #ifdef MNG_SUPPORT_TRACE
  1052. MNG_TRACE (pData, MNG_FN_FREE_CHRM, MNG_LC_START);
  1053. #endif
  1054. MNG_FREEX (pData, pHeader, sizeof (mng_chrm));
  1055. #ifdef MNG_SUPPORT_TRACE
  1056. MNG_TRACE (pData, MNG_FN_FREE_CHRM, MNG_LC_END);
  1057. #endif
  1058. return MNG_NOERROR;
  1059. }
  1060. #endif
  1061. #endif
  1062. /* ************************************************************************** */
  1063. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1064. #ifndef MNG_SKIPCHUNK_sRGB
  1065. FREE_CHUNK_HDR (mng_free_srgb)
  1066. {
  1067. #ifdef MNG_SUPPORT_TRACE
  1068. MNG_TRACE (pData, MNG_FN_FREE_SRGB, MNG_LC_START);
  1069. #endif
  1070. MNG_FREEX (pData, pHeader, sizeof (mng_srgb));
  1071. #ifdef MNG_SUPPORT_TRACE
  1072. MNG_TRACE (pData, MNG_FN_FREE_SRGB, MNG_LC_END);
  1073. #endif
  1074. return MNG_NOERROR;
  1075. }
  1076. #endif
  1077. #endif
  1078. /* ************************************************************************** */
  1079. #ifndef MNG_SKIPCHUNK_iCCP
  1080. FREE_CHUNK_HDR (mng_free_iccp)
  1081. {
  1082. #ifdef MNG_SUPPORT_TRACE
  1083. MNG_TRACE (pData, MNG_FN_FREE_ICCP, MNG_LC_START);
  1084. #endif
  1085. if (((mng_iccpp)pHeader)->iNamesize)
  1086. MNG_FREEX (pData, ((mng_iccpp)pHeader)->zName,
  1087. ((mng_iccpp)pHeader)->iNamesize + 1);
  1088. if (((mng_iccpp)pHeader)->iProfilesize)
  1089. MNG_FREEX (pData, ((mng_iccpp)pHeader)->pProfile,
  1090. ((mng_iccpp)pHeader)->iProfilesize);
  1091. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1092. MNG_FREEX (pData, pHeader, sizeof (mng_iccp));
  1093. #endif
  1094. #ifdef MNG_SUPPORT_TRACE
  1095. MNG_TRACE (pData, MNG_FN_FREE_ICCP, MNG_LC_END);
  1096. #endif
  1097. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1098. return MNG_NOERROR;
  1099. #else
  1100. return mng_free_general(pData, pHeader);
  1101. #endif
  1102. }
  1103. #endif
  1104. /* ************************************************************************** */
  1105. #ifndef MNG_SKIPCHUNK_tEXt
  1106. FREE_CHUNK_HDR (mng_free_text)
  1107. {
  1108. #ifdef MNG_SUPPORT_TRACE
  1109. MNG_TRACE (pData, MNG_FN_FREE_TEXT, MNG_LC_START);
  1110. #endif
  1111. if (((mng_textp)pHeader)->iKeywordsize)
  1112. MNG_FREEX (pData, ((mng_textp)pHeader)->zKeyword,
  1113. ((mng_textp)pHeader)->iKeywordsize + 1);
  1114. if (((mng_textp)pHeader)->iTextsize)
  1115. MNG_FREEX (pData, ((mng_textp)pHeader)->zText,
  1116. ((mng_textp)pHeader)->iTextsize + 1);
  1117. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1118. MNG_FREEX (pData, pHeader, sizeof (mng_text));
  1119. #endif
  1120. #ifdef MNG_SUPPORT_TRACE
  1121. MNG_TRACE (pData, MNG_FN_FREE_TEXT, MNG_LC_END);
  1122. #endif
  1123. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1124. return MNG_NOERROR;
  1125. #else
  1126. return mng_free_general(pData, pHeader);
  1127. #endif
  1128. }
  1129. #endif
  1130. /* ************************************************************************** */
  1131. #ifndef MNG_SKIPCHUNK_zTXt
  1132. FREE_CHUNK_HDR (mng_free_ztxt)
  1133. {
  1134. #ifdef MNG_SUPPORT_TRACE
  1135. MNG_TRACE (pData, MNG_FN_FREE_ZTXT, MNG_LC_START);
  1136. #endif
  1137. if (((mng_ztxtp)pHeader)->iKeywordsize)
  1138. MNG_FREEX (pData, ((mng_ztxtp)pHeader)->zKeyword,
  1139. ((mng_ztxtp)pHeader)->iKeywordsize + 1);
  1140. if (((mng_ztxtp)pHeader)->iTextsize)
  1141. MNG_FREEX (pData, ((mng_ztxtp)pHeader)->zText,
  1142. ((mng_ztxtp)pHeader)->iTextsize);
  1143. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1144. MNG_FREEX (pData, pHeader, sizeof (mng_ztxt));
  1145. #endif
  1146. #ifdef MNG_SUPPORT_TRACE
  1147. MNG_TRACE (pData, MNG_FN_FREE_ZTXT, MNG_LC_END);
  1148. #endif
  1149. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1150. return MNG_NOERROR;
  1151. #else
  1152. return mng_free_general(pData, pHeader);
  1153. #endif
  1154. }
  1155. #endif
  1156. /* ************************************************************************** */
  1157. #ifndef MNG_SKIPCHUNK_iTXt
  1158. FREE_CHUNK_HDR (mng_free_itxt)
  1159. {
  1160. #ifdef MNG_SUPPORT_TRACE
  1161. MNG_TRACE (pData, MNG_FN_FREE_ITXT, MNG_LC_START);
  1162. #endif
  1163. if (((mng_itxtp)pHeader)->iKeywordsize)
  1164. MNG_FREEX (pData, ((mng_itxtp)pHeader)->zKeyword,
  1165. ((mng_itxtp)pHeader)->iKeywordsize + 1);
  1166. if (((mng_itxtp)pHeader)->iLanguagesize)
  1167. MNG_FREEX (pData, ((mng_itxtp)pHeader)->zLanguage,
  1168. ((mng_itxtp)pHeader)->iLanguagesize + 1);
  1169. if (((mng_itxtp)pHeader)->iTranslationsize)
  1170. MNG_FREEX (pData, ((mng_itxtp)pHeader)->zTranslation,
  1171. ((mng_itxtp)pHeader)->iTranslationsize + 1);
  1172. if (((mng_itxtp)pHeader)->iTextsize)
  1173. MNG_FREEX (pData, ((mng_itxtp)pHeader)->zText,
  1174. ((mng_itxtp)pHeader)->iTextsize);
  1175. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1176. MNG_FREEX (pData, pHeader, sizeof (mng_itxt));
  1177. #endif
  1178. #ifdef MNG_SUPPORT_TRACE
  1179. MNG_TRACE (pData, MNG_FN_FREE_ITXT, MNG_LC_END);
  1180. #endif
  1181. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1182. return MNG_NOERROR;
  1183. #else
  1184. return mng_free_general(pData, pHeader);
  1185. #endif
  1186. }
  1187. #endif
  1188. /* ************************************************************************** */
  1189. #ifdef MNG_INCLUDE_MPNG_PROPOSAL
  1190. FREE_CHUNK_HDR (mng_free_mpng)
  1191. {
  1192. #ifdef MNG_SUPPORT_TRACE
  1193. MNG_TRACE (pData, MNG_FN_FREE_MPNG, MNG_LC_START);
  1194. #endif
  1195. if (((mng_mpngp)pHeader)->iFramessize)
  1196. MNG_FREEX (pData, ((mng_mpngp)pHeader)->pFrames,
  1197. ((mng_mpngp)pHeader)->iFramessize);
  1198. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1199. MNG_FREEX (pData, pHeader, sizeof (mng_mpng));
  1200. #endif
  1201. #ifdef MNG_SUPPORT_TRACE
  1202. MNG_TRACE (pData, MNG_FN_FREE_MPNG, MNG_LC_END);
  1203. #endif
  1204. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1205. return MNG_NOERROR;
  1206. #else
  1207. return mng_free_general(pData, pHeader);
  1208. #endif
  1209. }
  1210. #endif
  1211. /* ************************************************************************** */
  1212. #ifdef MNG_INCLUDE_ANG_PROPOSAL
  1213. FREE_CHUNK_HDR (mng_free_adat)
  1214. {
  1215. #ifdef MNG_SUPPORT_TRACE
  1216. MNG_TRACE (pData, MNG_FN_FREE_ADAT, MNG_LC_START);
  1217. #endif
  1218. if (((mng_adatp)pHeader)->iTilessize)
  1219. MNG_FREEX (pData, ((mng_adatp)pHeader)->pTiles, ((mng_adatp)pHeader)->iTilessize);
  1220. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1221. MNG_FREEX (pData, pHeader, sizeof (mng_adat));
  1222. #endif
  1223. #ifdef MNG_SUPPORT_TRACE
  1224. MNG_TRACE (pData, MNG_FN_FREE_ADAT, MNG_LC_END);
  1225. #endif
  1226. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1227. return MNG_NOERROR;
  1228. #else
  1229. return mng_free_general(pData, pHeader);
  1230. #endif
  1231. }
  1232. #endif
  1233. /* ************************************************************************** */
  1234. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1235. #ifndef MNG_SKIPCHUNK_bKGD
  1236. FREE_CHUNK_HDR (mng_free_bkgd)
  1237. {
  1238. #ifdef MNG_SUPPORT_TRACE
  1239. MNG_TRACE (pData, MNG_FN_FREE_BKGD, MNG_LC_START);
  1240. #endif
  1241. MNG_FREEX (pData, pHeader, sizeof (mng_bkgd));
  1242. #ifdef MNG_SUPPORT_TRACE
  1243. MNG_TRACE (pData, MNG_FN_FREE_BKGD, MNG_LC_END);
  1244. #endif
  1245. return MNG_NOERROR;
  1246. }
  1247. #endif
  1248. #endif
  1249. /* ************************************************************************** */
  1250. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1251. #ifndef MNG_SKIPCHUNK_pHYs
  1252. FREE_CHUNK_HDR (mng_free_phys)
  1253. {
  1254. #ifdef MNG_SUPPORT_TRACE
  1255. MNG_TRACE (pData, MNG_FN_FREE_PHYS, MNG_LC_START);
  1256. #endif
  1257. MNG_FREEX (pData, pHeader, sizeof (mng_phys));
  1258. #ifdef MNG_SUPPORT_TRACE
  1259. MNG_TRACE (pData, MNG_FN_FREE_PHYS, MNG_LC_END);
  1260. #endif
  1261. return MNG_NOERROR;
  1262. }
  1263. #endif
  1264. #endif
  1265. /* ************************************************************************** */
  1266. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1267. #ifndef MNG_SKIPCHUNK_sBIT
  1268. FREE_CHUNK_HDR (mng_free_sbit)
  1269. {
  1270. #ifdef MNG_SUPPORT_TRACE
  1271. MNG_TRACE (pData, MNG_FN_FREE_SBIT, MNG_LC_START);
  1272. #endif
  1273. MNG_FREEX (pData, pHeader, sizeof (mng_sbit));
  1274. #ifdef MNG_SUPPORT_TRACE
  1275. MNG_TRACE (pData, MNG_FN_FREE_SBIT, MNG_LC_END);
  1276. #endif
  1277. return MNG_NOERROR;
  1278. }
  1279. #endif
  1280. #endif
  1281. /* ************************************************************************** */
  1282. #ifndef MNG_SKIPCHUNK_sPLT
  1283. FREE_CHUNK_HDR (mng_free_splt)
  1284. {
  1285. #ifdef MNG_SUPPORT_TRACE
  1286. MNG_TRACE (pData, MNG_FN_FREE_SPLT, MNG_LC_START);
  1287. #endif
  1288. if (((mng_spltp)pHeader)->iNamesize)
  1289. MNG_FREEX (pData, ((mng_spltp)pHeader)->zName,
  1290. ((mng_spltp)pHeader)->iNamesize + 1);
  1291. if (((mng_spltp)pHeader)->iEntrycount)
  1292. MNG_FREEX (pData, ((mng_spltp)pHeader)->pEntries,
  1293. ((mng_spltp)pHeader)->iEntrycount *
  1294. (((mng_spltp)pHeader)->iSampledepth * 3 + sizeof (mng_uint16)) );
  1295. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1296. MNG_FREEX (pData, pHeader, sizeof (mng_splt));
  1297. #endif
  1298. #ifdef MNG_SUPPORT_TRACE
  1299. MNG_TRACE (pData, MNG_FN_FREE_SPLT, MNG_LC_END);
  1300. #endif
  1301. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1302. return MNG_NOERROR;
  1303. #else
  1304. return mng_free_general(pData, pHeader);
  1305. #endif
  1306. }
  1307. #endif
  1308. /* ************************************************************************** */
  1309. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1310. #ifndef MNG_SKIPCHUNK_hIST
  1311. FREE_CHUNK_HDR (mng_free_hist)
  1312. {
  1313. #ifdef MNG_SUPPORT_TRACE
  1314. MNG_TRACE (pData, MNG_FN_FREE_HIST, MNG_LC_START);
  1315. #endif
  1316. MNG_FREEX (pData, pHeader, sizeof (mng_hist));
  1317. #ifdef MNG_SUPPORT_TRACE
  1318. MNG_TRACE (pData, MNG_FN_FREE_HIST, MNG_LC_END);
  1319. #endif
  1320. return MNG_NOERROR;
  1321. }
  1322. #endif
  1323. #endif
  1324. /* ************************************************************************** */
  1325. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1326. #ifndef MNG_SKIPCHUNK_tIME
  1327. FREE_CHUNK_HDR (mng_free_time)
  1328. {
  1329. #ifdef MNG_SUPPORT_TRACE
  1330. MNG_TRACE (pData, MNG_FN_FREE_TIME, MNG_LC_START);
  1331. #endif
  1332. MNG_FREEX (pData, pHeader, sizeof (mng_time));
  1333. #ifdef MNG_SUPPORT_TRACE
  1334. MNG_TRACE (pData, MNG_FN_FREE_TIME, MNG_LC_END);
  1335. #endif
  1336. return MNG_NOERROR;
  1337. }
  1338. #endif
  1339. #endif
  1340. /* ************************************************************************** */
  1341. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1342. FREE_CHUNK_HDR (mng_free_mhdr)
  1343. {
  1344. #ifdef MNG_SUPPORT_TRACE
  1345. MNG_TRACE (pData, MNG_FN_FREE_MHDR, MNG_LC_START);
  1346. #endif
  1347. MNG_FREEX (pData, pHeader, sizeof (mng_mhdr));
  1348. #ifdef MNG_SUPPORT_TRACE
  1349. MNG_TRACE (pData, MNG_FN_FREE_MHDR, MNG_LC_END);
  1350. #endif
  1351. return MNG_NOERROR;
  1352. }
  1353. #endif
  1354. /* ************************************************************************** */
  1355. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1356. FREE_CHUNK_HDR (mng_free_mend)
  1357. {
  1358. #ifdef MNG_SUPPORT_TRACE
  1359. MNG_TRACE (pData, MNG_FN_FREE_MEND, MNG_LC_START);
  1360. #endif
  1361. MNG_FREEX (pData, pHeader, sizeof (mng_mend));
  1362. #ifdef MNG_SUPPORT_TRACE
  1363. MNG_TRACE (pData, MNG_FN_FREE_MEND, MNG_LC_END);
  1364. #endif
  1365. return MNG_NOERROR;
  1366. }
  1367. #endif
  1368. /* ************************************************************************** */
  1369. #ifndef MNG_SKIPCHUNK_LOOP
  1370. FREE_CHUNK_HDR (mng_free_loop)
  1371. {
  1372. #ifdef MNG_SUPPORT_TRACE
  1373. MNG_TRACE (pData, MNG_FN_FREE_LOOP, MNG_LC_START);
  1374. #endif
  1375. #ifndef MNG_NO_LOOP_SIGNALS_SUPPORTED
  1376. if (((mng_loopp)pHeader)->iCount)
  1377. MNG_FREEX (pData, ((mng_loopp)pHeader)->pSignals,
  1378. ((mng_loopp)pHeader)->iCount * sizeof (mng_uint32) );
  1379. #endif
  1380. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1381. MNG_FREEX (pData, pHeader, sizeof (mng_loop));
  1382. #endif
  1383. #ifdef MNG_SUPPORT_TRACE
  1384. MNG_TRACE (pData, MNG_FN_FREE_LOOP, MNG_LC_END);
  1385. #endif
  1386. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1387. return MNG_NOERROR;
  1388. #else
  1389. return mng_free_general(pData, pHeader);
  1390. #endif
  1391. }
  1392. /* ************************************************************************** */
  1393. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1394. FREE_CHUNK_HDR (mng_free_endl)
  1395. {
  1396. #ifdef MNG_SUPPORT_TRACE
  1397. MNG_TRACE (pData, MNG_FN_FREE_ENDL, MNG_LC_START);
  1398. #endif
  1399. MNG_FREEX (pData, pHeader, sizeof (mng_endl));
  1400. #ifdef MNG_SUPPORT_TRACE
  1401. MNG_TRACE (pData, MNG_FN_FREE_ENDL, MNG_LC_END);
  1402. #endif
  1403. return MNG_NOERROR;
  1404. }
  1405. #endif
  1406. #endif
  1407. /* ************************************************************************** */
  1408. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1409. #ifndef MNG_SKIPCHUNK_DEFI
  1410. FREE_CHUNK_HDR (mng_free_defi)
  1411. {
  1412. #ifdef MNG_SUPPORT_TRACE
  1413. MNG_TRACE (pData, MNG_FN_FREE_DEFI, MNG_LC_START);
  1414. #endif
  1415. MNG_FREEX (pData, pHeader, sizeof (mng_defi));
  1416. #ifdef MNG_SUPPORT_TRACE
  1417. MNG_TRACE (pData, MNG_FN_FREE_DEFI, MNG_LC_END);
  1418. #endif
  1419. return MNG_NOERROR;
  1420. }
  1421. #endif
  1422. #endif
  1423. /* ************************************************************************** */
  1424. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1425. #ifndef MNG_SKIPCHUNK_BASI
  1426. FREE_CHUNK_HDR (mng_free_basi)
  1427. {
  1428. #ifdef MNG_SUPPORT_TRACE
  1429. MNG_TRACE (pData, MNG_FN_FREE_BASI, MNG_LC_START);
  1430. #endif
  1431. MNG_FREEX (pData, pHeader, sizeof (mng_basi));
  1432. #ifdef MNG_SUPPORT_TRACE
  1433. MNG_TRACE (pData, MNG_FN_FREE_BASI, MNG_LC_END);
  1434. #endif
  1435. return MNG_NOERROR;
  1436. }
  1437. #endif
  1438. #endif
  1439. /* ************************************************************************** */
  1440. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1441. #ifndef MNG_SKIPCHUNK_CLON
  1442. FREE_CHUNK_HDR (mng_free_clon)
  1443. {
  1444. #ifdef MNG_SUPPORT_TRACE
  1445. MNG_TRACE (pData, MNG_FN_FREE_CLON, MNG_LC_START);
  1446. #endif
  1447. MNG_FREEX (pData, pHeader, sizeof (mng_clon));
  1448. #ifdef MNG_SUPPORT_TRACE
  1449. MNG_TRACE (pData, MNG_FN_FREE_CLON, MNG_LC_END);
  1450. #endif
  1451. return MNG_NOERROR;
  1452. }
  1453. #endif
  1454. #endif
  1455. /* ************************************************************************** */
  1456. #ifndef MNG_SKIPCHUNK_PAST
  1457. FREE_CHUNK_HDR (mng_free_past)
  1458. {
  1459. #ifdef MNG_SUPPORT_TRACE
  1460. MNG_TRACE (pData, MNG_FN_FREE_PAST, MNG_LC_START);
  1461. #endif
  1462. if (((mng_pastp)pHeader)->iCount)
  1463. MNG_FREEX (pData, ((mng_pastp)pHeader)->pSources,
  1464. ((mng_pastp)pHeader)->iCount * sizeof (mng_past_source) );
  1465. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1466. MNG_FREEX (pData, pHeader, sizeof (mng_past));
  1467. #endif
  1468. #ifdef MNG_SUPPORT_TRACE
  1469. MNG_TRACE (pData, MNG_FN_FREE_PAST, MNG_LC_END);
  1470. #endif
  1471. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1472. return MNG_NOERROR;
  1473. #else
  1474. return mng_free_general(pData, pHeader);
  1475. #endif
  1476. }
  1477. #endif
  1478. /* ************************************************************************** */
  1479. #ifndef MNG_SKIPCHUNK_DISC
  1480. FREE_CHUNK_HDR (mng_free_disc)
  1481. {
  1482. #ifdef MNG_SUPPORT_TRACE
  1483. MNG_TRACE (pData, MNG_FN_FREE_DISC, MNG_LC_START);
  1484. #endif
  1485. if (((mng_discp)pHeader)->iCount)
  1486. MNG_FREEX (pData, ((mng_discp)pHeader)->pObjectids,
  1487. ((mng_discp)pHeader)->iCount * sizeof (mng_uint16) );
  1488. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1489. MNG_FREEX (pData, pHeader, sizeof (mng_disc));
  1490. #endif
  1491. #ifdef MNG_SUPPORT_TRACE
  1492. MNG_TRACE (pData, MNG_FN_FREE_DISC, MNG_LC_END);
  1493. #endif
  1494. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1495. return MNG_NOERROR;
  1496. #else
  1497. return mng_free_general(pData, pHeader);
  1498. #endif
  1499. }
  1500. #endif
  1501. /* ************************************************************************** */
  1502. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1503. #ifndef MNG_SKIPCHUNK_BACK
  1504. FREE_CHUNK_HDR (mng_free_back)
  1505. {
  1506. #ifdef MNG_SUPPORT_TRACE
  1507. MNG_TRACE (pData, MNG_FN_FREE_BACK, MNG_LC_START);
  1508. #endif
  1509. MNG_FREEX (pData, pHeader, sizeof (mng_back));
  1510. #ifdef MNG_SUPPORT_TRACE
  1511. MNG_TRACE (pData, MNG_FN_FREE_BACK, MNG_LC_END);
  1512. #endif
  1513. return MNG_NOERROR;
  1514. }
  1515. #endif
  1516. #endif
  1517. /* ************************************************************************** */
  1518. #ifndef MNG_SKIPCHUNK_FRAM
  1519. FREE_CHUNK_HDR (mng_free_fram)
  1520. {
  1521. #ifdef MNG_SUPPORT_TRACE
  1522. MNG_TRACE (pData, MNG_FN_FREE_FRAM, MNG_LC_START);
  1523. #endif
  1524. if (((mng_framp)pHeader)->iNamesize)
  1525. MNG_FREEX (pData, ((mng_framp)pHeader)->zName,
  1526. ((mng_framp)pHeader)->iNamesize + 1);
  1527. if (((mng_framp)pHeader)->iCount)
  1528. MNG_FREEX (pData, ((mng_framp)pHeader)->pSyncids,
  1529. ((mng_framp)pHeader)->iCount * sizeof (mng_uint32) );
  1530. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1531. MNG_FREEX (pData, pHeader, sizeof (mng_fram));
  1532. #endif
  1533. #ifdef MNG_SUPPORT_TRACE
  1534. MNG_TRACE (pData, MNG_FN_FREE_FRAM, MNG_LC_END);
  1535. #endif
  1536. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1537. return MNG_NOERROR;
  1538. #else
  1539. return mng_free_general(pData, pHeader);
  1540. #endif
  1541. }
  1542. #endif
  1543. /* ************************************************************************** */
  1544. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1545. #ifndef MNG_SKIPCHUNK_MOVE
  1546. FREE_CHUNK_HDR (mng_free_move)
  1547. {
  1548. #ifdef MNG_SUPPORT_TRACE
  1549. MNG_TRACE (pData, MNG_FN_FREE_MOVE, MNG_LC_START);
  1550. #endif
  1551. MNG_FREEX (pData, pHeader, sizeof (mng_move));
  1552. #ifdef MNG_SUPPORT_TRACE
  1553. MNG_TRACE (pData, MNG_FN_FREE_MOVE, MNG_LC_END);
  1554. #endif
  1555. return MNG_NOERROR;
  1556. }
  1557. #endif
  1558. #endif
  1559. /* ************************************************************************** */
  1560. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1561. #ifndef MNG_SKIPCHUNK_CLIP
  1562. FREE_CHUNK_HDR (mng_free_clip)
  1563. {
  1564. #ifdef MNG_SUPPORT_TRACE
  1565. MNG_TRACE (pData, MNG_FN_FREE_CLIP, MNG_LC_START);
  1566. #endif
  1567. MNG_FREEX (pData, pHeader, sizeof (mng_clip));
  1568. #ifdef MNG_SUPPORT_TRACE
  1569. MNG_TRACE (pData, MNG_FN_FREE_CLIP, MNG_LC_END);
  1570. #endif
  1571. return MNG_NOERROR;
  1572. }
  1573. #endif
  1574. #endif
  1575. /* ************************************************************************** */
  1576. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1577. #ifndef MNG_SKIPCHUNK_SHOW
  1578. FREE_CHUNK_HDR (mng_free_show)
  1579. {
  1580. #ifdef MNG_SUPPORT_TRACE
  1581. MNG_TRACE (pData, MNG_FN_FREE_SHOW, MNG_LC_START);
  1582. #endif
  1583. MNG_FREEX (pData, pHeader, sizeof (mng_show));
  1584. #ifdef MNG_SUPPORT_TRACE
  1585. MNG_TRACE (pData, MNG_FN_FREE_SHOW, MNG_LC_END);
  1586. #endif
  1587. return MNG_NOERROR;
  1588. }
  1589. #endif
  1590. #endif
  1591. /* ************************************************************************** */
  1592. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1593. #ifndef MNG_SKIPCHUNK_TERM
  1594. FREE_CHUNK_HDR (mng_free_term)
  1595. {
  1596. #ifdef MNG_SUPPORT_TRACE
  1597. MNG_TRACE (pData, MNG_FN_FREE_TERM, MNG_LC_START);
  1598. #endif
  1599. MNG_FREEX (pData, pHeader, sizeof (mng_term));
  1600. #ifdef MNG_SUPPORT_TRACE
  1601. MNG_TRACE (pData, MNG_FN_FREE_TERM, MNG_LC_END);
  1602. #endif
  1603. return MNG_NOERROR;
  1604. }
  1605. #endif
  1606. #endif
  1607. /* ************************************************************************** */
  1608. #ifndef MNG_SKIPCHUNK_SAVE
  1609. FREE_CHUNK_HDR (mng_free_save)
  1610. {
  1611. mng_save_entryp pEntry = ((mng_savep)pHeader)->pEntries;
  1612. mng_uint32 iX;
  1613. #ifdef MNG_SUPPORT_TRACE
  1614. MNG_TRACE (pData, MNG_FN_FREE_SAVE, MNG_LC_START);
  1615. #endif
  1616. for (iX = 0; iX < ((mng_savep)pHeader)->iCount; iX++)
  1617. {
  1618. if (pEntry->iNamesize)
  1619. MNG_FREEX (pData, pEntry->zName, pEntry->iNamesize);
  1620. pEntry = pEntry + sizeof (mng_save_entry);
  1621. }
  1622. if (((mng_savep)pHeader)->iCount)
  1623. MNG_FREEX (pData, ((mng_savep)pHeader)->pEntries,
  1624. ((mng_savep)pHeader)->iCount * sizeof (mng_save_entry) );
  1625. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1626. MNG_FREEX (pData, pHeader, sizeof (mng_save));
  1627. #endif
  1628. #ifdef MNG_SUPPORT_TRACE
  1629. MNG_TRACE (pData, MNG_FN_FREE_SAVE, MNG_LC_END);
  1630. #endif
  1631. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1632. return MNG_NOERROR;
  1633. #else
  1634. return mng_free_general(pData, pHeader);
  1635. #endif
  1636. }
  1637. #endif
  1638. /* ************************************************************************** */
  1639. #ifndef MNG_SKIPCHUNK_SEEK
  1640. FREE_CHUNK_HDR (mng_free_seek)
  1641. {
  1642. #ifdef MNG_SUPPORT_TRACE
  1643. MNG_TRACE (pData, MNG_FN_FREE_SEEK, MNG_LC_START);
  1644. #endif
  1645. if (((mng_seekp)pHeader)->iNamesize)
  1646. MNG_FREEX (pData, ((mng_seekp)pHeader)->zName,
  1647. ((mng_seekp)pHeader)->iNamesize + 1);
  1648. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1649. MNG_FREEX (pData, pHeader, sizeof (mng_seek));
  1650. #endif
  1651. #ifdef MNG_SUPPORT_TRACE
  1652. MNG_TRACE (pData, MNG_FN_FREE_SEEK, MNG_LC_END);
  1653. #endif
  1654. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1655. return MNG_NOERROR;
  1656. #else
  1657. return mng_free_general(pData, pHeader);
  1658. #endif
  1659. }
  1660. #endif
  1661. /* ************************************************************************** */
  1662. #ifndef MNG_SKIPCHUNK_eXPI
  1663. FREE_CHUNK_HDR (mng_free_expi)
  1664. {
  1665. #ifdef MNG_SUPPORT_TRACE
  1666. MNG_TRACE (pData, MNG_FN_FREE_EXPI, MNG_LC_START);
  1667. #endif
  1668. if (((mng_expip)pHeader)->iNamesize)
  1669. MNG_FREEX (pData, ((mng_expip)pHeader)->zName,
  1670. ((mng_expip)pHeader)->iNamesize + 1);
  1671. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1672. MNG_FREEX (pData, pHeader, sizeof (mng_expi));
  1673. #endif
  1674. #ifdef MNG_SUPPORT_TRACE
  1675. MNG_TRACE (pData, MNG_FN_FREE_EXPI, MNG_LC_END);
  1676. #endif
  1677. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1678. return MNG_NOERROR;
  1679. #else
  1680. return mng_free_general(pData, pHeader);
  1681. #endif
  1682. }
  1683. #endif
  1684. /* ************************************************************************** */
  1685. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1686. #ifndef MNG_SKIPCHUNK_fPRI
  1687. FREE_CHUNK_HDR (mng_free_fpri)
  1688. {
  1689. #ifdef MNG_SUPPORT_TRACE
  1690. MNG_TRACE (pData, MNG_FN_FREE_FPRI, MNG_LC_START);
  1691. #endif
  1692. MNG_FREEX (pData, pHeader, sizeof (mng_fpri));
  1693. #ifdef MNG_SUPPORT_TRACE
  1694. MNG_TRACE (pData, MNG_FN_FREE_FPRI, MNG_LC_END);
  1695. #endif
  1696. return MNG_NOERROR;
  1697. }
  1698. #endif
  1699. #endif
  1700. /* ************************************************************************** */
  1701. #ifndef MNG_SKIPCHUNK_nEED
  1702. FREE_CHUNK_HDR (mng_free_need)
  1703. {
  1704. #ifdef MNG_SUPPORT_TRACE
  1705. MNG_TRACE (pData, MNG_FN_FREE_NEED, MNG_LC_START);
  1706. #endif
  1707. if (((mng_needp)pHeader)->iKeywordssize)
  1708. MNG_FREEX (pData, ((mng_needp)pHeader)->zKeywords,
  1709. ((mng_needp)pHeader)->iKeywordssize + 1);
  1710. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1711. MNG_FREEX (pData, pHeader, sizeof (mng_need));
  1712. #endif
  1713. #ifdef MNG_SUPPORT_TRACE
  1714. MNG_TRACE (pData, MNG_FN_FREE_NEED, MNG_LC_END);
  1715. #endif
  1716. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1717. return MNG_NOERROR;
  1718. #else
  1719. return mng_free_general(pData, pHeader);
  1720. #endif
  1721. }
  1722. #endif
  1723. /* ************************************************************************** */
  1724. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1725. #ifndef MNG_SKIPCHUNK_pHYg
  1726. FREE_CHUNK_HDR (mng_free_phyg)
  1727. {
  1728. #ifdef MNG_SUPPORT_TRACE
  1729. MNG_TRACE (pData, MNG_FN_FREE_PHYG, MNG_LC_START);
  1730. #endif
  1731. MNG_FREEX (pData, pHeader, sizeof (mng_phyg));
  1732. #ifdef MNG_SUPPORT_TRACE
  1733. MNG_TRACE (pData, MNG_FN_FREE_PHYG, MNG_LC_END);
  1734. #endif
  1735. return MNG_NOERROR;
  1736. }
  1737. #endif
  1738. #endif
  1739. /* ************************************************************************** */
  1740. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1741. #ifdef MNG_INCLUDE_JNG
  1742. FREE_CHUNK_HDR (mng_free_jhdr)
  1743. {
  1744. #ifdef MNG_SUPPORT_TRACE
  1745. MNG_TRACE (pData, MNG_FN_FREE_JHDR, MNG_LC_START);
  1746. #endif
  1747. MNG_FREEX (pData, pHeader, sizeof (mng_jhdr));
  1748. #ifdef MNG_SUPPORT_TRACE
  1749. MNG_TRACE (pData, MNG_FN_FREE_JHDR, MNG_LC_END);
  1750. #endif
  1751. return MNG_NOERROR;
  1752. }
  1753. #endif /* MNG_INCLUDE_JNG */
  1754. #endif
  1755. /* ************************************************************************** */
  1756. #ifdef MNG_INCLUDE_JNG
  1757. FREE_CHUNK_HDR (mng_free_jdaa)
  1758. {
  1759. #ifdef MNG_SUPPORT_TRACE
  1760. MNG_TRACE (pData, MNG_FN_FREE_JDAA, MNG_LC_START);
  1761. #endif
  1762. if (((mng_jdaap)pHeader)->iDatasize)
  1763. MNG_FREEX (pData, ((mng_jdaap)pHeader)->pData,
  1764. ((mng_jdaap)pHeader)->iDatasize);
  1765. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1766. MNG_FREEX (pData, pHeader, sizeof (mng_jdaa));
  1767. #endif
  1768. #ifdef MNG_SUPPORT_TRACE
  1769. MNG_TRACE (pData, MNG_FN_FREE_JDAA, MNG_LC_END);
  1770. #endif
  1771. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1772. return MNG_NOERROR;
  1773. #else
  1774. return mng_free_general(pData, pHeader);
  1775. #endif
  1776. }
  1777. #endif /* MNG_INCLUDE_JNG */
  1778. /* ************************************************************************** */
  1779. #ifdef MNG_INCLUDE_JNG
  1780. FREE_CHUNK_HDR (mng_free_jdat)
  1781. {
  1782. #ifdef MNG_SUPPORT_TRACE
  1783. MNG_TRACE (pData, MNG_FN_FREE_JDAT, MNG_LC_START);
  1784. #endif
  1785. if (((mng_jdatp)pHeader)->iDatasize)
  1786. MNG_FREEX (pData, ((mng_jdatp)pHeader)->pData,
  1787. ((mng_jdatp)pHeader)->iDatasize);
  1788. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1789. MNG_FREEX (pData, pHeader, sizeof (mng_jdat));
  1790. #endif
  1791. #ifdef MNG_SUPPORT_TRACE
  1792. MNG_TRACE (pData, MNG_FN_FREE_JDAT, MNG_LC_END);
  1793. #endif
  1794. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1795. return MNG_NOERROR;
  1796. #else
  1797. return mng_free_general(pData, pHeader);
  1798. #endif
  1799. }
  1800. #endif /* MNG_INCLUDE_JNG */
  1801. /* ************************************************************************** */
  1802. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1803. #ifdef MNG_INCLUDE_JNG
  1804. FREE_CHUNK_HDR (mng_free_jsep)
  1805. {
  1806. #ifdef MNG_SUPPORT_TRACE
  1807. MNG_TRACE (pData, MNG_FN_FREE_JSEP, MNG_LC_START);
  1808. #endif
  1809. MNG_FREEX (pData, pHeader, sizeof (mng_jsep));
  1810. #ifdef MNG_SUPPORT_TRACE
  1811. MNG_TRACE (pData, MNG_FN_FREE_JSEP, MNG_LC_END);
  1812. #endif
  1813. return MNG_NOERROR;
  1814. }
  1815. #endif /* MNG_INCLUDE_JNG */
  1816. #endif
  1817. /* ************************************************************************** */
  1818. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1819. #ifndef MNG_NO_DELTA_PNG
  1820. FREE_CHUNK_HDR (mng_free_dhdr)
  1821. {
  1822. #ifdef MNG_SUPPORT_TRACE
  1823. MNG_TRACE (pData, MNG_FN_FREE_DHDR, MNG_LC_START);
  1824. #endif
  1825. MNG_FREEX (pData, pHeader, sizeof (mng_dhdr));
  1826. #ifdef MNG_SUPPORT_TRACE
  1827. MNG_TRACE (pData, MNG_FN_FREE_DHDR, MNG_LC_END);
  1828. #endif
  1829. return MNG_NOERROR;
  1830. }
  1831. #endif
  1832. #endif
  1833. /* ************************************************************************** */
  1834. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1835. #ifndef MNG_NO_DELTA_PNG
  1836. FREE_CHUNK_HDR (mng_free_prom)
  1837. {
  1838. #ifdef MNG_SUPPORT_TRACE
  1839. MNG_TRACE (pData, MNG_FN_FREE_PROM, MNG_LC_START);
  1840. #endif
  1841. MNG_FREEX (pData, pHeader, sizeof (mng_prom));
  1842. #ifdef MNG_SUPPORT_TRACE
  1843. MNG_TRACE (pData, MNG_FN_FREE_PROM, MNG_LC_END);
  1844. #endif
  1845. return MNG_NOERROR;
  1846. }
  1847. #endif
  1848. #endif
  1849. /* ************************************************************************** */
  1850. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1851. #ifndef MNG_NO_DELTA_PNG
  1852. FREE_CHUNK_HDR (mng_free_ipng)
  1853. {
  1854. #ifdef MNG_SUPPORT_TRACE
  1855. MNG_TRACE (pData, MNG_FN_FREE_IPNG, MNG_LC_START);
  1856. #endif
  1857. MNG_FREEX (pData, pHeader, sizeof (mng_ipng));
  1858. #ifdef MNG_SUPPORT_TRACE
  1859. MNG_TRACE (pData, MNG_FN_FREE_IPNG, MNG_LC_END);
  1860. #endif
  1861. return MNG_NOERROR;
  1862. }
  1863. #endif
  1864. #endif
  1865. /* ************************************************************************** */
  1866. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1867. #ifndef MNG_NO_DELTA_PNG
  1868. FREE_CHUNK_HDR (mng_free_pplt)
  1869. {
  1870. #ifdef MNG_SUPPORT_TRACE
  1871. MNG_TRACE (pData, MNG_FN_FREE_PPLT, MNG_LC_START);
  1872. #endif
  1873. MNG_FREEX (pData, pHeader, sizeof (mng_pplt));
  1874. #ifdef MNG_SUPPORT_TRACE
  1875. MNG_TRACE (pData, MNG_FN_FREE_PPLT, MNG_LC_END);
  1876. #endif
  1877. return MNG_NOERROR;
  1878. }
  1879. #endif
  1880. #endif
  1881. /* ************************************************************************** */
  1882. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1883. #ifndef MNG_NO_DELTA_PNG
  1884. #ifdef MNG_INCLUDE_JNG
  1885. FREE_CHUNK_HDR (mng_free_ijng)
  1886. {
  1887. #ifdef MNG_SUPPORT_TRACE
  1888. MNG_TRACE (pData, MNG_FN_FREE_IJNG, MNG_LC_START);
  1889. #endif
  1890. MNG_FREEX (pData, pHeader, sizeof (mng_ijng));
  1891. #ifdef MNG_SUPPORT_TRACE
  1892. MNG_TRACE (pData, MNG_FN_FREE_IJNG, MNG_LC_END);
  1893. #endif
  1894. return MNG_NOERROR;
  1895. }
  1896. #endif
  1897. #endif
  1898. #endif
  1899. /* ************************************************************************** */
  1900. #ifndef MNG_NO_DELTA_PNG
  1901. FREE_CHUNK_HDR (mng_free_drop)
  1902. {
  1903. #ifdef MNG_SUPPORT_TRACE
  1904. MNG_TRACE (pData, MNG_FN_FREE_DROP, MNG_LC_START);
  1905. #endif
  1906. if (((mng_dropp)pHeader)->iCount)
  1907. MNG_FREEX (pData, ((mng_dropp)pHeader)->pChunknames,
  1908. ((mng_dropp)pHeader)->iCount * sizeof (mng_chunkid) );
  1909. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1910. MNG_FREEX (pData, pHeader, sizeof (mng_drop));
  1911. #endif
  1912. #ifdef MNG_SUPPORT_TRACE
  1913. MNG_TRACE (pData, MNG_FN_FREE_DROP, MNG_LC_END);
  1914. #endif
  1915. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1916. return MNG_NOERROR;
  1917. #else
  1918. return mng_free_general(pData, pHeader);
  1919. #endif
  1920. }
  1921. #endif
  1922. /* ************************************************************************** */
  1923. #ifndef MNG_NO_DELTA_PNG
  1924. #ifndef MNG_SKIPCHUNK_DBYK
  1925. FREE_CHUNK_HDR (mng_free_dbyk)
  1926. {
  1927. #ifdef MNG_SUPPORT_TRACE
  1928. MNG_TRACE (pData, MNG_FN_FREE_DBYK, MNG_LC_START);
  1929. #endif
  1930. if (((mng_dbykp)pHeader)->iKeywordssize)
  1931. MNG_FREEX (pData, ((mng_dbykp)pHeader)->zKeywords,
  1932. ((mng_dbykp)pHeader)->iKeywordssize);
  1933. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1934. MNG_FREEX (pData, pHeader, sizeof (mng_dbyk));
  1935. #endif
  1936. #ifdef MNG_SUPPORT_TRACE
  1937. MNG_TRACE (pData, MNG_FN_FREE_DBYK, MNG_LC_END);
  1938. #endif
  1939. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1940. return MNG_NOERROR;
  1941. #else
  1942. return mng_free_general(pData, pHeader);
  1943. #endif
  1944. }
  1945. #endif
  1946. #endif
  1947. /* ************************************************************************** */
  1948. #ifndef MNG_NO_DELTA_PNG
  1949. #ifndef MNG_SKIPCHUNK_ORDR
  1950. FREE_CHUNK_HDR (mng_free_ordr)
  1951. {
  1952. #ifdef MNG_SUPPORT_TRACE
  1953. MNG_TRACE (pData, MNG_FN_FREE_ORDR, MNG_LC_START);
  1954. #endif
  1955. if (((mng_ordrp)pHeader)->iCount)
  1956. MNG_FREEX (pData, ((mng_ordrp)pHeader)->pEntries,
  1957. ((mng_ordrp)pHeader)->iCount * sizeof (mng_ordr_entry) );
  1958. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1959. MNG_FREEX (pData, pHeader, sizeof (mng_ordr));
  1960. #endif
  1961. #ifdef MNG_SUPPORT_TRACE
  1962. MNG_TRACE (pData, MNG_FN_FREE_ORDR, MNG_LC_END);
  1963. #endif
  1964. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1965. return MNG_NOERROR;
  1966. #else
  1967. return mng_free_general(pData, pHeader);
  1968. #endif
  1969. }
  1970. #endif
  1971. #endif
  1972. /* ************************************************************************** */
  1973. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  1974. #ifndef MNG_SKIPCHUNK_MAGN
  1975. FREE_CHUNK_HDR (mng_free_magn)
  1976. {
  1977. #ifdef MNG_SUPPORT_TRACE
  1978. MNG_TRACE (pData, MNG_FN_FREE_MAGN, MNG_LC_START);
  1979. #endif
  1980. MNG_FREEX (pData, pHeader, sizeof (mng_magn));
  1981. #ifdef MNG_SUPPORT_TRACE
  1982. MNG_TRACE (pData, MNG_FN_FREE_MAGN, MNG_LC_END);
  1983. #endif
  1984. return MNG_NOERROR;
  1985. }
  1986. #endif
  1987. #endif
  1988. /* ************************************************************************** */
  1989. #ifndef MNG_SKIPCHUNK_evNT
  1990. FREE_CHUNK_HDR (mng_free_evnt)
  1991. {
  1992. mng_evnt_entryp pEntry = ((mng_evntp)pHeader)->pEntries;
  1993. mng_uint32 iX;
  1994. #ifdef MNG_SUPPORT_TRACE
  1995. MNG_TRACE (pData, MNG_FN_FREE_EVNT, MNG_LC_START);
  1996. #endif
  1997. for (iX = 0; iX < ((mng_evntp)pHeader)->iCount; iX++)
  1998. {
  1999. if (pEntry->iSegmentnamesize)
  2000. MNG_FREEX (pData, pEntry->zSegmentname, pEntry->iSegmentnamesize+1);
  2001. pEntry++;
  2002. }
  2003. if (((mng_evntp)pHeader)->iCount)
  2004. MNG_FREEX (pData, ((mng_evntp)pHeader)->pEntries,
  2005. ((mng_evntp)pHeader)->iCount * sizeof (mng_evnt_entry) );
  2006. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  2007. MNG_FREEX (pData, pHeader, sizeof (mng_evnt));
  2008. #endif
  2009. #ifdef MNG_SUPPORT_TRACE
  2010. MNG_TRACE (pData, MNG_FN_FREE_EVNT, MNG_LC_END);
  2011. #endif
  2012. #ifndef MNG_OPTIMIZE_CHUNKINITFREE
  2013. return MNG_NOERROR;
  2014. #else
  2015. return mng_free_general(pData, pHeader);
  2016. #endif
  2017. }
  2018. #endif
  2019. /* ************************************************************************** */
  2020. FREE_CHUNK_HDR (mng_free_unknown)