source: trunk/src/3rdparty/libmng/libmng_write.c

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

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

File size: 8.3 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_write.c copyright (c) 2000-2004 G.Juyn * */
8/* * version : 1.0.9 * */
9/* * * */
10/* * purpose : Write management (implementation) * */
11/* * * */
12/* * author : G.Juyn * */
13/* * * */
14/* * comment : implementation of the write management routines * */
15/* * * */
16/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
17/* * - changed strict-ANSI stuff * */
18/* * 0.5.1 - 05/12/2000 - G.Juyn * */
19/* * - changed trace to macro for callback error-reporting * */
20/* * 0.5.1 - 05/16/2000 - G.Juyn * */
21/* * - moved the actual write_graphic functionality from * */
22/* * mng_hlapi to its appropriate function here * */
23/* * * */
24/* * 0.9.1 - 07/19/2000 - G.Juyn * */
25/* * - fixed writing of signature * */
26/* * * */
27/* * 0.9.2 - 08/05/2000 - G.Juyn * */
28/* * - changed file-prefixes * */
29/* * * */
30/* * 1.0.5 - 08/19/2002 - G.Juyn * */
31/* * - B597134 - libmng pollutes the linker namespace * */
32/* * * */
33/* * 1.0.8 - 07/06/2004 - G.R-P * */
34/* * - added conditionals around openstream/closestream * */
35/* * - defend against using undefined Open/Closestream function * */
36/* * 1.0.8 - 08/02/2004 - G.Juyn * */
37/* * - added conditional to allow easier writing of large MNG's * */
38/* * * */
39/* * 1.0.9 - 09/25/2004 - G.Juyn * */
40/* * - replaced MNG_TWEAK_LARGE_FILES with permanent solution * */
41/* * 1.0.9 - 12/20/2004 - G.Juyn * */
42/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
43/* * * */
44/* ************************************************************************** */
45
46#include "libmng.h"
47#include "libmng_data.h"
48#include "libmng_error.h"
49#include "libmng_trace.h"
50#ifdef __BORLANDC__
51#pragma hdrstop
52#endif
53#include "libmng_memory.h"
54#include "libmng_chunks.h"
55#include "libmng_chunk_io.h"
56#include "libmng_write.h"
57
58#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
59#pragma option -A /* force ANSI-C */
60#endif
61
62/* ************************************************************************** */
63
64#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
65mng_retcode mng_drop_chunks (mng_datap pData)
66{
67 mng_chunkp pChunk;
68 mng_chunkp pNext;
69 mng_cleanupchunk fCleanup;
70
71#ifdef MNG_SUPPORT_TRACE
72 MNG_TRACE (pData, MNG_FN_DROP_CHUNKS, MNG_LC_START);