diff options
author | Andrey Kiselev <dron@ak4719.spb.edu> | 2004-01-29 08:47:36 +0000 |
---|---|---|
committer | Andrey Kiselev <dron@ak4719.spb.edu> | 2004-01-29 08:47:36 +0000 |
commit | ec58068a3b670a29767d90ba8241f8eca0f73330 (patch) | |
tree | 1c459a3f6c18a2ab962667d6152e01c05cf4e3f5 /libtiff/tif_close.c | |
parent | 8df43a8f558d22cb1f069e02204fef99bf0bd24c (diff) | |
download | libtiff-git-ec58068a3b670a29767d90ba8241f8eca0f73330.tar.gz |
TIFFCleanup() renamed to _TIFFCleanup(). declaration moved to tiffiop.h.
Diffstat (limited to 'libtiff/tif_close.c')
-rw-r--r-- | libtiff/tif_close.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/libtiff/tif_close.c b/libtiff/tif_close.c index a03c590c..fa7273f2 100644 --- a/libtiff/tif_close.c +++ b/libtiff/tif_close.c @@ -1,4 +1,4 @@ -/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_close.c,v 1.6 2004-01-28 17:57:09 dron Exp $ */ +/* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_close.c,v 1.7 2004-01-29 08:47:36 dron Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -29,8 +29,21 @@ */ #include "tiffiop.h" +/************************************************************************/ +/* _TIFFCleanup() */ +/************************************************************************/ + +/** + * Auxiliary function to free the TIFF structure. Given structure will be + * completetly freed, so you should save opened file handle and pointer + * to the close procedure in external variables before calling + * _TIFFCleanup(), if you will need these ones to close the file. + * + * @param tif A TIFF pointer. + */ + void -TIFFCleanup(TIFF* tif) +_TIFFCleanup(TIFF* tif) { if (tif->tif_mode != O_RDONLY) /* @@ -80,13 +93,27 @@ TIFFCleanup(TIFF* tif) _TIFFfree(tif); } +/************************************************************************/ +/* TIFFClose() */ +/************************************************************************/ + +/** + * Close a previously opened TIFF file. + * + * TIFFClose closes a file that was previously opened with TIFFOpen(). + * Any buffered data are flushed to the file, including the contents of + * the current directory (if modified); and all resources are reclaimed. + * + * @param tif A TIFF pointer. + */ + void TIFFClose(TIFF* tif) { TIFFCloseProc closeproc = tif->tif_closeproc; - int fd = (int)tif->tif_clientdata; + thandle_t fd = tif->tif_clientdata; - TIFFCleanup(tif); + _TIFFCleanup(tif); (void) (*closeproc)(fd); } |