roentgen b75cab
.\" $Id: TIFFSetDirectory.3tiff,v 1.2 2005-11-02 11:07:18 dron Exp $
roentgen b75cab
.\"
roentgen b75cab
.\" Copyright (c) 1988-1997 Sam Leffler
roentgen b75cab
.\" Copyright (c) 1991-1997 Silicon Graphics, Inc.
roentgen b75cab
.\"
roentgen b75cab
.\" Permission to use, copy, modify, distribute, and sell this software and 
roentgen b75cab
.\" its documentation for any purpose is hereby granted without fee, provided
roentgen b75cab
.\" that (i) the above copyright notices and this permission notice appear in
roentgen b75cab
.\" all copies of the software and related documentation, and (ii) the names of
roentgen b75cab
.\" Sam Leffler and Silicon Graphics may not be used in any advertising or
roentgen b75cab
.\" publicity relating to the software without the specific, prior written
roentgen b75cab
.\" permission of Sam Leffler and Silicon Graphics.
roentgen b75cab
.\" 
roentgen b75cab
.\" THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
roentgen b75cab
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
roentgen b75cab
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
roentgen b75cab
.\" 
roentgen b75cab
.\" IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
roentgen b75cab
.\" ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
roentgen b75cab
.\" OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
roentgen b75cab
.\" WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
roentgen b75cab
.\" LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
roentgen b75cab
.\" OF THIS SOFTWARE.
roentgen b75cab
.\"
roentgen b75cab
.if n .po 0
roentgen b75cab
.TH TIFFSetDirectory 3TIFF "October 15, 1995" "libtiff"
roentgen b75cab
.SH NAME
roentgen b75cab
TIFFSetDirectory, TIFFSetSubDirectory \- set the current directory for an open
roentgen b75cab
.SM TIFF
roentgen b75cab
file
roentgen b75cab
.SH SYNOPSIS
roentgen b75cab
.B "#include <tiffio.h>"</tiffio.h>
roentgen b75cab
.sp
roentgen b75cab
.BI "int TIFFSetDirectory(TIFF *" tif ", tdir_t " dirnum ")"
roentgen b75cab
.br
roentgen b75cab
.BI "int TIFFSetSubDirectory(TIFF *" tif ", uint32 " diroff ")"
roentgen b75cab
.SH DESCRIPTION
roentgen b75cab
.I TIFFSetDirectory
roentgen b75cab
changes the current directory and reads its contents with
roentgen b75cab
.IR TIFFReadDirectory .
roentgen b75cab
The parameter
roentgen b75cab
.I dirnum
roentgen b75cab
specifies the subfile/directory as an integer number, with the first directory
roentgen b75cab
numbered zero.
roentgen b75cab
.PP
roentgen b75cab
.I TIFFSetSubDirectory
roentgen b75cab
acts like 
roentgen b75cab
.IR TIFFSetDirectory ,
roentgen b75cab
except the directory is specified as a file offset instead of an index; this
roentgen b75cab
is required for accessing subdirectories linked through a
roentgen b75cab
.I SubIFD
roentgen b75cab
tag.
roentgen b75cab
.SH "RETURN VALUES"
roentgen b75cab
On successful return 1 is returned. Otherwise, 0 is returned if 
roentgen b75cab
.I dirnum
roentgen b75cab
or
roentgen b75cab
.I diroff
roentgen b75cab
specifies a non-existent directory, or if an error was encountered while
roentgen b75cab
reading the directory's contents.
roentgen b75cab
.SH DIAGNOSTICS
roentgen b75cab
All error messages are directed to the
roentgen b75cab
.IR TIFFError (3TIFF)
roentgen b75cab
routine.
roentgen b75cab
.PP
roentgen b75cab
.BR "%s: Error fetching directory count" .
roentgen b75cab
An error was encountered while reading the ``directory count'' field.
roentgen b75cab
.PP
roentgen b75cab
.BR "%s: Error fetching directory link" .
roentgen b75cab
An error was encountered while reading the ``link value'' that points to the
roentgen b75cab
next directory in a file.
roentgen b75cab
.SH "SEE ALSO"
roentgen b75cab
.IR TIFFCurrentDirectory (3TIFF),
roentgen b75cab
.IR TIFFOpen (3TIFF),
roentgen b75cab
.IR TIFFReadDirectory (3TIFF),
roentgen b75cab
.IR TIFFWriteDirectory (3TIFF),
roentgen b75cab
.IR libtiff (3TIFF)
roentgen b75cab
.PP
roentgen b75cab
Libtiff library home page:
roentgen b75cab
.BR http://www.remotesensing.org/libtiff/