ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

tif_extension.c
Go to the documentation of this file.
00001 /* $Header: /cvs/maptools/cvsroot/libtiff/libtiff/tif_extension.c,v 1.4.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  * Various routines support external extension of the tag set, and other
00031  * application extension capabilities. 
00032  */
00033 
00034 #include "tiffiop.h"
00035 
00036 int TIFFGetTagListCount( TIFF *tif )
00037 
00038 {
00039     TIFFDirectory* td = &tif->tif_dir;
00040     
00041     return td->td_customValueCount;
00042 }
00043 
00044 ttag_t TIFFGetTagListEntry( TIFF *tif, int tag_index )
00045 
00046 {
00047     TIFFDirectory* td = &tif->tif_dir;
00048 
00049     if( tag_index < 0 || tag_index >= td->td_customValueCount )
00050         return (ttag_t) -1;
00051     else
00052         return td->td_customValues[tag_index].info->field_tag;
00053 }
00054 
00055 /*
00056 ** This provides read/write access to the TIFFTagMethods within the TIFF
00057 ** structure to application code without giving access to the private
00058 ** TIFF structure.
00059 */
00060 TIFFTagMethods *TIFFAccessTagMethods( TIFF *tif )
00061 
00062 {
00063     return &(tif->tif_tagmethods);
00064 }
00065 
00066 void *TIFFGetClientInfo( TIFF *tif, const char *name )
00067 
00068 {
00069     TIFFClientInfoLink *link = tif->tif_clientinfo;
00070 
00071     while( link != NULL && strcmp(link->name,name) != 0 )
00072         link = link->next;
00073 
00074     if( link != NULL )
00075         return link->data;
00076     else
00077         return NULL;
00078 }
00079 
00080 void TIFFSetClientInfo( TIFF *tif, void *data, const char *name )
00081 
00082 {
00083     TIFFClientInfoLink *link = tif->tif_clientinfo;
00084 
00085     /*
00086     ** Do we have an existing link with this name?  If so, just
00087     ** set it.
00088     */
00089     while( link != NULL && strcmp(link->name,name) != 0 )
00090         link = link->next;
00091 
00092     if( link != NULL )
00093     {
00094         link->data = data;
00095         return;
00096     }
00097 
00098     /*
00099     ** Create a new link.
00100     */
00101 
00102     link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
00103     assert (link != NULL);
00104     link->next = tif->tif_clientinfo;
00105     link->name = (char *) _TIFFmalloc(strlen(name)+1);
00106     assert (link->name != NULL);
00107     strcpy(link->name, name);
00108     link->data = data;
00109 
00110     tif->tif_clientinfo = link;
00111 }
00112 /*
00113  * Local Variables:
00114  * mode: c
00115  * c-basic-offset: 8
00116  * fill-column: 78
00117  * End:
00118  */

Generated on Mon May 28 2012 04:19:21 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.