summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libmng/libmng_chunk_prc.h
blob: 0cf0f3c1d587d03c7b26491dc9a32b46564c826a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
/* ************************************************************************** */
/* *             For conditions of distribution and use,                    * */
/* *                see copyright notice in libmng.h                        * */
/* ************************************************************************** */
/* *                                                                        * */
/* * project   : libmng                                                     * */
/* * file      : libmng_chunk_prc.h        copyright (c) 2000-2007 G.Juyn   * */
/* * version   : 1.0.10                                                     * */
/* *                                                                        * */
/* * purpose   : Chunk initialization & cleanup (definition)                * */
/* *                                                                        * */
/* * author    : G.Juyn                                                     * */
/* *                                                                        * */
/* * comment   : definition of the chunk initialization & cleanup routines  * */
/* *                                                                        * */
/* * changes   : 0.5.1 - 05/08/2000 - G.Juyn                                * */
/* *             - changed strict-ANSI stuff                                * */
/* *                                                                        * */
/* *             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           * */
/* *             1.0.5 - 09/14/2002 - G.Juyn                                * */
/* *             - added event handling for dynamic MNG                     * */
/* *                                                                        * */
/* *             1.0.6 - 07/07/2003 - G.R-P                                 * */
/* *             - added NO_DELTA_PNG support                               * */
/* *             1.0.6 - 07/29/2003 - G.R-P                                 * */
/* *             - added conditionals around PAST chunk support             * */
/* *                                                                        * */
/* *             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.10 - 04/08/2007 - G.Juyn                               * */
/* *             - added support for mPNG proposal                          * */
/* *             1.0.10 - 04/12/2007 - G.Juyn                               * */
/* *             - added support for ANG proposal                           * */
/* *                                                                        * */
/* ************************************************************************** */

#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
#pragma option -A                      /* force ANSI-C */
#endif

#ifndef _libmng_chunk_prc_h_
#define _libmng_chunk_prc_h_

/* ************************************************************************** */

void mng_add_chunk (mng_datap  pData,
                    mng_chunkp pChunk);

/* ************************************************************************** */

#define INIT_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
                                         mng_chunkp  pHeader,  \
                                         mng_chunkp* ppChunk)

#ifdef MNG_OPTIMIZE_CHUNKINITFREE
INIT_CHUNK_HDR (mng_init_general) ;
#else
INIT_CHUNK_HDR (mng_init_ihdr) ;
INIT_CHUNK_HDR (mng_init_plte) ;
INIT_CHUNK_HDR (mng_init_idat) ;
INIT_CHUNK_HDR (mng_init_iend) ;
INIT_CHUNK_HDR (mng_init_trns) ;
INIT_CHUNK_HDR (mng_init_gama) ;
INIT_CHUNK_HDR (mng_init_chrm) ;
INIT_CHUNK_HDR (mng_init_srgb) ;
INIT_CHUNK_HDR (mng_init_iccp) ;
INIT_CHUNK_HDR (mng_init_text) ;
INIT_CHUNK_HDR (mng_init_ztxt) ;
INIT_CHUNK_HDR (mng_init_itxt) ;
INIT_CHUNK_HDR (mng_init_bkgd) ;
INIT_CHUNK_HDR (mng_init_phys) ;
INIT_CHUNK_HDR (mng_init_sbit) ;
INIT_CHUNK_HDR (mng_init_splt) ;
INIT_CHUNK_HDR (mng_init_hist) ;
INIT_CHUNK_HDR (mng_init_time) ;
INIT_CHUNK_HDR (mng_init_mhdr) ;
INIT_CHUNK_HDR (mng_init_mend) ;
INIT_CHUNK_HDR (mng_init_loop) ;
INIT_CHUNK_HDR (mng_init_endl) ;
INIT_CHUNK_HDR (mng_init_defi) ;
INIT_CHUNK_HDR (mng_init_basi) ;
INIT_CHUNK_HDR (mng_init_clon) ;
#ifndef MNG_SKIPCHUNK_PAST
INIT_CHUNK_HDR (mng_init_past) ;
#endif
INIT_CHUNK_HDR (mng_init_disc) ;
INIT_CHUNK_HDR (mng_init_back) ;
INIT_CHUNK_HDR (mng_init_fram) ;
INIT_CHUNK_HDR (mng_init_move) ;
INIT_CHUNK_HDR (mng_init_clip) ;
INIT_CHUNK_HDR (mng_init_show) ;
INIT_CHUNK_HDR (mng_init_term) ;
INIT_CHUNK_HDR (mng_init_save) ;
INIT_CHUNK_HDR (mng_init_seek) ;
INIT_CHUNK_HDR (mng_init_expi) ;
INIT_CHUNK_HDR (mng_init_fpri) ;
INIT_CHUNK_HDR (mng_init_need) ;
INIT_CHUNK_HDR (mng_init_phyg) ;
#ifdef MNG_INCLUDE_JNG
INIT_CHUNK_HDR (mng_init_jhdr) ;
INIT_CHUNK_HDR (mng_init_jdaa) ;
INIT_CHUNK_HDR (mng_init_jdat) ;
INIT_CHUNK_HDR (mng_init_jsep) ;
#endif
#ifndef MNG_NO_DELTA_PNG
INIT_CHUNK_HDR (mng_init_dhdr) ;
INIT_CHUNK_HDR (mng_init_prom) ;
INIT_CHUNK_HDR (mng_init_ipng) ;
INIT_CHUNK_HDR (mng_init_pplt) ;
#ifdef MNG_INCLUDE_JNG
INIT_CHUNK_HDR (mng_init_ijng) ;
#endif
INIT_CHUNK_HDR (mng_init_drop) ;
INIT_CHUNK_HDR (mng_init_dbyk) ;
INIT_CHUNK_HDR (mng_init_ordr) ;
#endif
INIT_CHUNK_HDR (mng_init_magn) ;
INIT_CHUNK_HDR (mng_init_evnt) ;
INIT_CHUNK_HDR (mng_init_unknown) ;
#endif /* MNG_OPTIMIZE_CHUNKINITFREE */

/* ************************************************************************** */

#define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
                                         mng_chunkp  pHeader)

#ifdef MNG_OPTIMIZE_CHUNKINITFREE
FREE_CHUNK_HDR (mng_free_general) ;
#else /* MNG_OPTIMIZE_CHUNKINITFREE */
FREE_CHUNK_HDR (mng_free_ihdr) ;
FREE_CHUNK_HDR (mng_free_plte) ;
FREE_CHUNK_HDR (mng_free_iend) ;
FREE_CHUNK_HDR (mng_free_trns) ;
FREE_CHUNK_HDR (mng_free_gama) ;
FREE_CHUNK_HDR (mng_free_chrm) ;
FREE_CHUNK_HDR (mng_free_srgb) ;
FREE_CHUNK_HDR (mng_free_bkgd) ;
FREE_CHUNK_HDR (mng_free_phys) ;
FREE_CHUNK_HDR (mng_free_sbit) ;
FREE_CHUNK_HDR (mng_free_hist) ;
FREE_CHUNK_HDR (mng_free_time) ;
FREE_CHUNK_HDR (mng_free_mhdr) ;
FREE_CHUNK_HDR (mng_free_mend) ;
FREE_CHUNK_HDR (mng_free_endl) ;
FREE_CHUNK_HDR (mng_free_defi) ;
FREE_CHUNK_HDR (mng_free_basi) ;
FREE_CHUNK_HDR (mng_free_clon) ;
FREE_CHUNK_HDR (mng_free_back) ;
FREE_CHUNK_HDR (mng_free_move) ;
FREE_CHUNK_HDR (mng_free_clip) ;
FREE_CHUNK_HDR (mng_free_show) ;
FREE_CHUNK_HDR (mng_free_term) ;
FREE_CHUNK_HDR (mng_free_fpri) ;
FREE_CHUNK_HDR (mng_free_phyg) ;
#ifdef MNG_INCLUDE_JNG
FREE_CHUNK_HDR (mng_free_jhdr) ;
FREE_CHUNK_HDR (mng_free_jsep) ;
#endif
#ifndef MNG_NO_DELTA_PNG
FREE_CHUNK_HDR (mng_free_dhdr) ;
FREE_CHUNK_HDR (mng_free_prom) ;
FREE_CHUNK_HDR (mng_free_ipng) ;
FREE_CHUNK_HDR (mng_free_pplt) ;
#ifdef MNG_INCLUDE_JNG
FREE_CHUNK_HDR (mng_free_ijng) ;
#endif
#endif
FREE_CHUNK_HDR (mng_free_magn) ;
#endif /* MNG_OPTIMIZE_CHUNKINITFREE */

FREE_CHUNK_HDR (mng_free_idat) ;
FREE_CHUNK_HDR (mng_free_iccp) ;
FREE_CHUNK_HDR (mng_free_text) ;
FREE_CHUNK_HDR (mng_free_ztxt) ;
FREE_CHUNK_HDR (mng_free_itxt) ;
FREE_CHUNK_HDR (mng_free_splt) ;
FREE_CHUNK_HDR (mng_free_loop) ;
#ifndef MNG_SKIPCHUNK_PAST
FREE_CHUNK_HDR (mng_free_past) ;
#endif
FREE_CHUNK_HDR (mng_free_disc) ;
FREE_CHUNK_HDR (mng_free_fram) ;
FREE_CHUNK_HDR (mng_free_save) ;
FREE_CHUNK_HDR (mng_free_seek) ;
FREE_CHUNK_HDR (mng_free_expi) ;
FREE_CHUNK_HDR (mng_free_need) ;
#ifdef MNG_INCLUDE_JNG
FREE_CHUNK_HDR (mng_free_jdaa) ;
FREE_CHUNK_HDR (mng_free_jdat) ;
#endif
#ifndef MNG_NO_DELTA_PNG
FREE_CHUNK_HDR (mng_free_drop) ;
FREE_CHUNK_HDR (mng_free_dbyk) ;
FREE_CHUNK_HDR (mng_free_ordr) ;
#endif
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
FREE_CHUNK_HDR (mng_free_mpng) ;
#endif
#ifdef MNG_INCLUDE_ANG_PROPOSAL
FREE_CHUNK_HDR (mng_free_adat) ;
#endif
FREE_CHUNK_HDR (mng_free_evnt) ;
FREE_CHUNK_HDR (mng_free_unknown) ;

/* ************************************************************************** */

#ifdef MNG_INCLUDE_WRITE_PROCS

#define ASSIGN_CHUNK_HDR(n) mng_retcode n (mng_datap   pData,    \
                                           mng_chunkp  pChunkto, \
                                           mng_chunkp  pChunkfrom)

#ifdef MNG_OPTIMIZE_CHUNKASSIGN
ASSIGN_CHUNK_HDR (mng_assign_general) ;
#else /* MNG_OPTIMIZE_CHUNKASSIGN */
ASSIGN_CHUNK_HDR (mng_assign_ihdr) ;
ASSIGN_CHUNK_HDR (mng_assign_plte) ;
ASSIGN_CHUNK_HDR (mng_assign_iend) ;
ASSIGN_CHUNK_HDR (mng_assign_trns) ;
ASSIGN_CHUNK_HDR (mng_assign_gama) ;
ASSIGN_CHUNK_HDR (mng_assign_chrm) ;
ASSIGN_CHUNK_HDR (mng_assign_srgb) ;
ASSIGN_CHUNK_HDR (mng_assign_bkgd) ;
ASSIGN_CHUNK_HDR (mng_assign_phys) ;
ASSIGN_CHUNK_HDR (mng_assign_sbit) ;
ASSIGN_CHUNK_HDR (mng_assign_hist) ;
ASSIGN_CHUNK_HDR (mng_assign_time) ;
ASSIGN_CHUNK_HDR (mng_assign_mhdr) ;
ASSIGN_CHUNK_HDR (mng_assign_mend) ;
ASSIGN_CHUNK_HDR (mng_assign_endl) ;
ASSIGN_CHUNK_HDR (mng_assign_defi) ;
ASSIGN_CHUNK_HDR (mng_assign_basi) ;
ASSIGN_CHUNK_HDR (mng_assign_clon) ;
ASSIGN_CHUNK_HDR (mng_assign_back) ;
ASSIGN_CHUNK_HDR (mng_assign_move) ;
ASSIGN_CHUNK_HDR (mng_assign_clip) ;
ASSIGN_CHUNK_HDR (mng_assign_show) ;
ASSIGN_CHUNK_HDR (mng_assign_term) ;
ASSIGN_CHUNK_HDR (mng_assign_fpri) ;
ASSIGN_CHUNK_HDR (mng_assign_phyg) ;
#ifdef MNG_INCLUDE_JNG
ASSIGN_CHUNK_HDR (mng_assign_jhdr) ;
ASSIGN_CHUNK_HDR (mng_assign_jsep) ;
#endif
#ifndef MNG_NO_DELTA_PNG
ASSIGN_CHUNK_HDR (mng_assign_dhdr) ;
ASSIGN_CHUNK_HDR (mng_assign_prom) ;
ASSIGN_CHUNK_HDR (mng_assign_ipng) ;
ASSIGN_CHUNK_HDR (mng_assign_pplt) ;
#ifdef MNG_INCLUDE_JNG
ASSIGN_CHUNK_HDR (mng_assign_ijng) ;
#endif
#endif
ASSIGN_CHUNK_HDR (mng_assign_magn) ;
#endif /* MNG_OPTIMIZE_CHUNKASSIGN */

ASSIGN_CHUNK_HDR (mng_assign_idat) ;
ASSIGN_CHUNK_HDR (mng_assign_iccp) ;
ASSIGN_CHUNK_HDR (mng_assign_text) ;
ASSIGN_CHUNK_HDR (mng_assign_ztxt) ;
ASSIGN_CHUNK_HDR (mng_assign_itxt) ;
ASSIGN_CHUNK_HDR (mng_assign_splt) ;
ASSIGN_CHUNK_HDR (mng_assign_loop) ;
#ifndef MNG_SKIPCHUNK_PAST
ASSIGN_CHUNK_HDR (mng_assign_past) ;
#endif
ASSIGN_CHUNK_HDR (mng_assign_disc) ;
ASSIGN_CHUNK_HDR (mng_assign_fram) ;
ASSIGN_CHUNK_HDR (mng_assign_save) ;
ASSIGN_CHUNK_HDR (mng_assign_seek) ;
ASSIGN_CHUNK_HDR (mng_assign_need) ;
ASSIGN_CHUNK_HDR (mng_assign_expi) ;
#ifdef MNG_INCLUDE_JNG
ASSIGN_CHUNK_HDR (mng_assign_jdaa) ;
ASSIGN_CHUNK_HDR (mng_assign_jdat) ;
#endif
#ifndef MNG_NO_DELTA_PNG
ASSIGN_CHUNK_HDR (mng_assign_drop) ;
ASSIGN_CHUNK_HDR (mng_assign_dbyk) ;
ASSIGN_CHUNK_HDR (mng_assign_ordr) ;
#endif
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
ASSIGN_CHUNK_HDR (mng_assign_mpng) ;
#endif
#ifdef MNG_INCLUDE_ANG_PROPOSAL
ASSIGN_CHUNK_HDR (mng_assign_ahdr) ;
ASSIGN_CHUNK_HDR (mng_assign_adat) ;
#endif
ASSIGN_CHUNK_HDR (mng_assign_evnt) ;
ASSIGN_CHUNK_HDR (mng_assign_unknown) ;

/* ************************************************************************** */

#else /* MNG_INCLUDE_WRITE_PROCS */
#define mng_assign_general 0
#define mng_assign_ihdr 0
#define mng_assign_plte 0
#define mng_assign_idat 0
#define mng_assign_iend 0
#define mng_assign_trns 0
#define mng_assign_gama 0
#define mng_assign_chrm 0
#define mng_assign_srgb 0
#define mng_assign_iccp 0
#define mng_assign_text 0
#define mng_assign_ztxt 0
#define mng_assign_itxt 0
#define mng_assign_bkgd 0
#define mng_assign_phys 0
#define mng_assign_sbit 0
#define mng_assign_splt 0
#define mng_assign_hist 0
#define mng_assign_time 0
#define mng_assign_mhdr 0
#define mng_assign_mend 0
#define mng_assign_loop 0
#define mng_assign_endl 0
#define mng_assign_defi 0
#define mng_assign_basi 0
#define mng_assign_clon 0
#ifndef MNG_SKIPCHUNK_PAST
#define mng_assign_past 0
#endif
#define mng_assign_disc 0
#define mng_assign_back 0
#define mng_assign_fram 0
#define mng_assign_move 0
#define mng_assign_clip 0
#define mng_assign_show 0
#define mng_assign_term 0
#define mng_assign_save 0
#define mng_assign_seek 0
#define mng_assign_expi 0
#define mng_assign_fpri 0
#define mng_assign_phyg 0
#ifdef MNG_INCLUDE_JNG
#define mng_assign_jhdr 0
#define mng_assign_jdaa 0
#define mng_assign_jdat 0
#define mng_assign_jsep 0
#endif
#ifndef MNG_NO_DELTA_PNG
#define mng_assign_dhdr 0
#define mng_assign_prom 0
#define mng_assign_ipng 0
#define mng_assign_pplt 0
#ifdef MNG_INCLUDE_JNG
#define mng_assign_ijng 0
#endif
#define mng_assign_drop 0
#define mng_assign_dbyk 0
#define mng_assign_ordr 0
#endif
#define mng_assign_magn 0
#define mng_assign_need 0
#define mng_assign_mpng 0
#define mng_assign_ahdr 0
#define mng_assign_adat 0
#define mng_assign_evnt 0
#define mng_assign_unknown 0
#endif /* MNG_INCLUDE_WRITE_PROCS */

/* ************************************************************************** */

#endif /* _libmng_chunk_prc_h_ */

/* ************************************************************************** */
/* * end of file                                                            * */
/* ************************************************************************** */