source: trunk/src/3rdparty/libmng/libmng_chunk_prc.h@ 122

Last change on this file since 122 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 13.6 KB
Line 
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.h copyright (c) 2000-2007 G.Juyn * */
8/* * version : 1.0.10 * */
9/* * * */
10/* * purpose : Chunk initialization & cleanup (definition) * */
11/* * * */
12/* * author : G.Juyn * */
13/* * * */
14/* * comment : definition of the chunk initialization & cleanup routines * */
15/* * * */
16/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
17/* * - changed strict-ANSI stuff * */
18/* * * */
19/* * 0.9.2 - 08/05/2000 - G.Juyn * */
20/* * - changed file-prefixes * */
21/* * * */
22/* * 0.9.3 - 08/26/2000 - G.Juyn * */
23/* * - added MAGN chunk * */
24/* * 0.9.3 - 10/16/2000 - G.Juyn * */
25/* * - added support for JDAA * */
26/* * * */
27/* * 1.0.5 - 08/19/2002 - G.Juyn * */
28/* * - B597134 - libmng pollutes the linker namespace * */
29/* * 1.0.5 - 09/14/2002 - G.Juyn * */
30/* * - added event handling for dynamic MNG * */
31/* * * */
32/* * 1.0.6 - 07/07/2003 - G.R-P * */
33/* * - added NO_DELTA_PNG support * */
34/* * 1.0.6 - 07/29/2003 - G.R-P * */
35/* * - added conditionals around PAST chunk support * */
36/* * * */
37/* * 1.0.9 - 12/05/2004 - G.Juyn * */
38/* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */
39/* * 1.0.9 - 12/06/2004 - G.Juyn * */
40/* * - added conditional MNG_OPTIMIZE_CHUNKASSIGN * */
41/* * * */
42/* * 1.0.10 - 04/08/2007 - G.Juyn * */
43/* * - added support for mPNG proposal * */
44/* * 1.0.10 - 04/12/2007 - G.Juyn * */
45/* * - added support for ANG proposal * */
46/* * * */
47/* ************************************************************************** */
48
49#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
50#pragma option -A /* force ANSI-C */
51#endif
52
53#ifndef _libmng_chunk_prc_h_
54#define _libmng_chunk_prc_h_
55
56/* ************************************************************************** */
57
58void mng_add_chunk (mng_datap pData,
59 mng_chunkp pChunk);
60
61/* ************************************************************************** */
62
63#define INIT_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
64 mng_chunkp pHeader, \
65 mng_chunkp* ppChunk)
66
67#ifdef MNG_OPTIMIZE_CHUNKINITFREE
68INIT_CHUNK_HDR (mng_init_general) ;
69#else
70INIT_CHUNK_HDR (mng_init_ihdr) ;
71INIT_CHUNK_HDR (mng_init_plte) ;
72INIT_CHUNK_HDR (mng_init_idat) ;
73INIT_CHUNK_HDR (mng_init_iend) ;
74INIT_CHUNK_HDR (mng_init_trns) ;
75INIT_CHUNK_HDR (mng_init_gama) ;
76INIT_CHUNK_HDR (mng_init_chrm) ;
77INIT_CHUNK_HDR (mng_init_srgb) ;
78INIT_CHUNK_HDR (mng_init_iccp) ;
79INIT_CHUNK_HDR (mng_init_text) ;
80INIT_CHUNK_HDR (mng_init_ztxt) ;
81INIT_CHUNK_HDR (mng_init_itxt) ;
82INIT_CHUNK_HDR (mng_init_bkgd) ;
83INIT_CHUNK_HDR (mng_init_phys) ;
84INIT_CHUNK_HDR (mng_init_sbit) ;
85INIT_CHUNK_HDR (mng_init_splt) ;
86INIT_CHUNK_HDR (mng_init_hist) ;
87INIT_CHUNK_HDR (mng_init_time) ;
88INIT_CHUNK_HDR (mng_init_mhdr) ;
89INIT_CHUNK_HDR (mng_init_mend) ;
90INIT_CHUNK_HDR (mng_init_loop) ;
91INIT_CHUNK_HDR (mng_init_endl) ;
92INIT_CHUNK_HDR (mng_init_defi) ;
93INIT_CHUNK_HDR (mng_init_basi) ;
94INIT_CHUNK_HDR (mng_init_clon) ;
95#ifndef MNG_SKIPCHUNK_PAST
96INIT_CHUNK_HDR (mng_init_past) ;
97#endif
98INIT_CHUNK_HDR (mng_init_disc) ;
99INIT_CHUNK_HDR (mng_init_back) ;
100INIT_CHUNK_HDR (mng_init_fram) ;
101INIT_CHUNK_HDR (mng_init_move) ;
102INIT_CHUNK_HDR (mng_init_clip) ;
103INIT_CHUNK_HDR (mng_init_show) ;
104INIT_CHUNK_HDR (mng_init_term) ;
105INIT_CHUNK_HDR (mng_init_save) ;
106INIT_CHUNK_HDR (mng_init_seek) ;
107INIT_CHUNK_HDR (mng_init_expi) ;
108INIT_CHUNK_HDR (mng_init_fpri) ;
109INIT_CHUNK_HDR (mng_init_need) ;
110INIT_CHUNK_HDR (mng_init_phyg) ;
111#ifdef MNG_INCLUDE_JNG
112INIT_CHUNK_HDR (mng_init_jhdr) ;
113INIT_CHUNK_HDR (mng_init_jdaa) ;
114INIT_CHUNK_HDR (mng_init_jdat) ;
115INIT_CHUNK_HDR (mng_init_jsep) ;
116#endif
117#ifndef MNG_NO_DELTA_PNG
118INIT_CHUNK_HDR (mng_init_dhdr) ;
119INIT_CHUNK_HDR (mng_init_prom) ;
120INIT_CHUNK_HDR (mng_init_ipng) ;
121INIT_CHUNK_HDR (mng_init_pplt) ;
122#ifdef MNG_INCLUDE_JNG
123INIT_CHUNK_HDR (mng_init_ijng) ;
124#endif
125INIT_CHUNK_HDR (mng_init_drop) ;
126INIT_CHUNK_HDR (mng_init_dbyk) ;
127INIT_CHUNK_HDR (mng_init_ordr) ;
128#endif
129INIT_CHUNK_HDR (mng_init_magn) ;
130INIT_CHUNK_HDR (mng_init_evnt) ;
131INIT_CHUNK_HDR (mng_init_unknown) ;
132#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
133
134/* ************************************************************************** */
135
136#define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
137 mng_chunkp pHeader)
138
139#ifdef MNG_OPTIMIZE_CHUNKINITFREE
140FREE_CHUNK_HDR (mng_free_general) ;
141#else /* MNG_OPTIMIZE_CHUNKINITFREE */
142FREE_CHUNK_HDR (mng_free_ihdr) ;
143FREE_CHUNK_HDR (mng_free_plte) ;
144FREE_CHUNK_HDR (mng_free_iend) ;
145FREE_CHUNK_HDR (mng_free_trns) ;
146FREE_CHUNK_HDR (mng_free_gama) ;
147FREE_CHUNK_HDR (mng_free_chrm) ;
148FREE_CHUNK_HDR (mng_free_srgb) ;
149FREE_CHUNK_HDR (mng_free_bkgd) ;
150FREE_CHUNK_HDR (mng_free_phys) ;
151FREE_CHUNK_HDR (mng_free_sbit) ;
152FREE_CHUNK_HDR (mng_free_hist) ;
153FREE_CHUNK_HDR (mng_free_time) ;
154FREE_CHUNK_HDR (mng_free_mhdr) ;
155FREE_CHUNK_HDR (mng_free_mend) ;
156FREE_CHUNK_HDR (mng_free_endl) ;
157FREE_CHUNK_HDR (mng_free_defi) ;
158FREE_CHUNK_HDR (mng_free_basi) ;
159FREE_CHUNK_HDR (mng_free_clon) ;
160FREE_CHUNK_HDR (mng_free_back) ;
161FREE_CHUNK_HDR (mng_free_move) ;
162FREE_CHUNK_HDR (mng_free_clip) ;
163FREE_CHUNK_HDR (mng_free_show) ;
164FREE_CHUNK_HDR (mng_free_term) ;
165FREE_CHUNK_HDR (mng_free_fpri) ;
166FREE_CHUNK_HDR (mng_free_phyg) ;
167#ifdef MNG_INCLUDE_JNG
168FREE_CHUNK_HDR (mng_free_jhdr) ;
169FREE_CHUNK_HDR (mng_free_jsep) ;
170#endif
171#ifndef MNG_NO_DELTA_PNG
172FREE_CHUNK_HDR (mng_free_dhdr) ;
173FREE_CHUNK_HDR (mng_free_prom) ;
174FREE_CHUNK_HDR (mng_free_ipng) ;
175FREE_CHUNK_HDR (mng_free_pplt) ;
176#ifdef MNG_INCLUDE_JNG
177FREE_CHUNK_HDR (mng_free_ijng) ;
178#endif
179#endif
180FREE_CHUNK_HDR (mng_free_magn) ;
181#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
182
183FREE_CHUNK_HDR (mng_free_idat) ;
184FREE_CHUNK_HDR (mng_free_iccp) ;
185FREE_CHUNK_HDR (mng_free_text) ;
186FREE_CHUNK_HDR (mng_free_ztxt) ;
187FREE_CHUNK_HDR (mng_free_itxt) ;
188FREE_CHUNK_HDR (mng_free_splt) ;
189FREE_CHUNK_HDR (mng_free_loop) ;
190#ifndef MNG_SKIPCHUNK_PAST
191FREE_CHUNK_HDR (mng_free_past) ;
192#endif
193FREE_CHUNK_HDR (mng_free_disc) ;
194FREE_CHUNK_HDR (mng_free_fram) ;
195FREE_CHUNK_HDR (mng_free_save) ;
196FREE_CHUNK_HDR (mng_free_seek) ;
197FREE_CHUNK_HDR (mng_free_expi) ;
198FREE_CHUNK_HDR (mng_free_need) ;
199#ifdef MNG_INCLUDE_JNG
200FREE_CHUNK_HDR (mng_free_jdaa) ;
201FREE_CHUNK_HDR (mng_free_jdat) ;
202#endif
203#ifndef MNG_NO_DELTA_PNG
204FREE_CHUNK_HDR (mng_free_drop) ;
205FREE_CHUNK_HDR (mng_free_dbyk) ;
206FREE_CHUNK_HDR (mng_free_ordr) ;
207#endif
208#ifdef MNG_INCLUDE_MPNG_PROPOSAL
209FREE_CHUNK_HDR (mng_free_mpng) ;
210#endif
211#ifdef MNG_INCLUDE_ANG_PROPOSAL
212FREE_CHUNK_HDR (mng_free_adat) ;
213#endif
214FREE_CHUNK_HDR (mng_free_evnt) ;
215FREE_CHUNK_HDR (mng_free_unknown) ;
216
217/* ************************************************************************** */
218
219#ifdef MNG_INCLUDE_WRITE_PROCS
220
221#define ASSIGN_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
222 mng_chunkp pChunkto, \
223 mng_chunkp pChunkfrom)
224
225#ifdef MNG_OPTIMIZE_CHUNKASSIGN
226ASSIGN_CHUNK_HDR (mng_assign_general) ;
227#else /* MNG_OPTIMIZE_CHUNKASSIGN */
228ASSIGN_CHUNK_HDR (mng_assign_ihdr) ;
229ASSIGN_CHUNK_HDR (mng_assign_plte) ;
230ASSIGN_CHUNK_HDR (mng_assign_iend) ;
231ASSIGN_CHUNK_HDR (mng_assign_trns) ;
232ASSIGN_CHUNK_HDR (mng_assign_gama) ;
233ASSIGN_CHUNK_HDR (mng_assign_chrm) ;
234ASSIGN_CHUNK_HDR (mng_assign_srgb) ;
235ASSIGN_CHUNK_HDR (mng_assign_bkgd) ;
236ASSIGN_CHUNK_HDR (mng_assign_phys) ;
237ASSIGN_CHUNK_HDR (mng_assign_sbit) ;
238ASSIGN_CHUNK_HDR (mng_assign_hist) ;
239ASSIGN_CHUNK_HDR (mng_assign_time) ;
240ASSIGN_CHUNK_HDR (mng_assign_mhdr) ;
241ASSIGN_CHUNK_HDR (mng_assign_mend) ;
242ASSIGN_CHUNK_HDR (mng_assign_endl) ;
243ASSIGN_CHUNK_HDR (mng_assign_defi) ;
244ASSIGN_CHUNK_HDR (mng_assign_basi) ;
245ASSIGN_CHUNK_HDR (mng_assign_clon) ;
246ASSIGN_CHUNK_HDR (mng_assign_back) ;
247ASSIGN_CHUNK_HDR (mng_assign_move) ;
248ASSIGN_CHUNK_HDR (mng_assign_clip) ;
249ASSIGN_CHUNK_HDR (mng_assign_show) ;
250ASSIGN_CHUNK_HDR (mng_assign_term) ;
251ASSIGN_CHUNK_HDR (mng_assign_fpri) ;
252ASSIGN_CHUNK_HDR (mng_assign_phyg) ;
253#ifdef MNG_INCLUDE_JNG
254ASSIGN_CHUNK_HDR (mng_assign_jhdr) ;
255ASSIGN_CHUNK_HDR (mng_assign_jsep) ;
256#endif
257#ifndef MNG_NO_DELTA_PNG
258ASSIGN_CHUNK_HDR (mng_assign_dhdr) ;
259ASSIGN_CHUNK_HDR (mng_assign_prom) ;
260ASSIGN_CHUNK_HDR (mng_assign_ipng) ;
261ASSIGN_CHUNK_HDR (mng_assign_pplt) ;
262#ifdef MNG_INCLUDE_JNG
263ASSIGN_CHUNK_HDR (mng_assign_ijng) ;
264#endif
265#endif
266ASSIGN_CHUNK_HDR (mng_assign_magn) ;
267#endif /* MNG_OPTIMIZE_CHUNKASSIGN */
268
269ASSIGN_CHUNK_HDR (mng_assign_idat) ;
270ASSIGN_CHUNK_HDR (mng_assign_iccp) ;
271ASSIGN_CHUNK_HDR (mng_assign_text) ;
272ASSIGN_CHUNK_HDR (mng_assign_ztxt) ;