Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentif_flush.c
Go to the documentation of this file.
00001 /* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_flush.c,v 1.3.2.1 2010-06-08 18:50:42 bfriesen Exp $ */ 00002 00003 /* 00004 * Copyright (c) 1988-1997 Sam Leffler 00005 * Copyright (c) 1991-1997 Silicon Graphics, Inc. 00006 * 00007 * Permission to use, copy, modify, distribute, and sell this software and 00008 * its documentation for any purpose is hereby granted without fee, provided 00009 * that (i) the above copyright notices and this permission notice appear in 00010 * all copies of the software and related documentation, and (ii) the names of 00011 * Sam Leffler and Silicon Graphics may not be used in any advertising or 00012 * publicity relating to the software without the specific, prior written 00013 * permission of Sam Leffler and Silicon Graphics. 00014 * 00015 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 00016 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 00017 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 00018 * 00019 * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 00020 * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 00021 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 00022 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 00023 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 00024 * OF THIS SOFTWARE. 00025 */ 00026 00027 /* 00028 * TIFF Library. 00029 */ 00030 #include "tiffiop.h" 00031 00032 int 00033 TIFFFlush(TIFF* tif) 00034 { 00035 00036 if (tif->tif_mode != O_RDONLY) { 00037 if (!TIFFFlushData(tif)) 00038 return (0); 00039 if ((tif->tif_flags & TIFF_DIRTYDIRECT) && 00040 !TIFFWriteDirectory(tif)) 00041 return (0); 00042 } 00043 return (1); 00044 } 00045 00046 /* 00047 * Flush buffered data to the file. 00048 * 00049 * Frank Warmerdam'2000: I modified this to return 1 if TIFF_BEENWRITING 00050 * is not set, so that TIFFFlush() will proceed to write out the directory. 00051 * The documentation says returning 1 is an error indicator, but not having 00052 * been writing isn't exactly a an error. Hopefully this doesn't cause 00053 * problems for other people. 00054 */ 00055 int 00056 TIFFFlushData(TIFF* tif) 00057 { 00058 if ((tif->tif_flags & TIFF_BEENWRITING) == 0) 00059 return (0); 00060 if (tif->tif_flags & TIFF_POSTENCODE) { 00061 tif->tif_flags &= ~TIFF_POSTENCODE; 00062 if (!(*tif->tif_postencode)(tif)) 00063 return (0); 00064 } 00065 return (TIFFFlushData1(tif)); 00066 } 00067 00068 /* 00069 * Local Variables: 00070 * mode: c 00071 * c-basic-offset: 8 00072 * fill-column: 78 00073 * End: 00074 */ Generated on Sat May 26 2012 04:18:23 for ReactOS by
1.7.6.1
|