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