Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentif_open.c
Go to the documentation of this file.
00001 /* $Id: tif_open.c,v 1.33.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 static const long typemask[13] = { 00033 (long)0L, /* TIFF_NOTYPE */ 00034 (long)0x000000ffL, /* TIFF_BYTE */ 00035 (long)0xffffffffL, /* TIFF_ASCII */ 00036 (long)0x0000ffffL, /* TIFF_SHORT */ 00037 (long)0xffffffffL, /* TIFF_LONG */ 00038 (long)0xffffffffL, /* TIFF_RATIONAL */ 00039 (long)0x000000ffL, /* TIFF_SBYTE */ 00040 (long)0x000000ffL, /* TIFF_UNDEFINED */ 00041 (long)0x0000ffffL, /* TIFF_SSHORT */ 00042 (long)0xffffffffL, /* TIFF_SLONG */ 00043 (long)0xffffffffL, /* TIFF_SRATIONAL */ 00044 (long)0xffffffffL, /* TIFF_FLOAT */ 00045 (long)0xffffffffL, /* TIFF_DOUBLE */ 00046 }; 00047 static const int bigTypeshift[13] = { 00048 0, /* TIFF_NOTYPE */ 00049 24, /* TIFF_BYTE */ 00050 0, /* TIFF_ASCII */ 00051 16, /* TIFF_SHORT */ 00052 0, /* TIFF_LONG */ 00053 0, /* TIFF_RATIONAL */ 00054 24, /* TIFF_SBYTE */ 00055 24, /* TIFF_UNDEFINED */ 00056 16, /* TIFF_SSHORT */ 00057 0, /* TIFF_SLONG */ 00058 0, /* TIFF_SRATIONAL */ 00059 0, /* TIFF_FLOAT */ 00060 0, /* TIFF_DOUBLE */ 00061 }; 00062 static const int litTypeshift[13] = { 00063 0, /* TIFF_NOTYPE */ 00064 0, /* TIFF_BYTE */ 00065 0, /* TIFF_ASCII */ 00066 0, /* TIFF_SHORT */ 00067 0, /* TIFF_LONG */ 00068 0, /* TIFF_RATIONAL */ 00069 0, /* TIFF_SBYTE */ 00070 0, /* TIFF_UNDEFINED */ 00071 0, /* TIFF_SSHORT */ 00072 0, /* TIFF_SLONG */ 00073 0, /* TIFF_SRATIONAL */ 00074 0, /* TIFF_FLOAT */ 00075 0, /* TIFF_DOUBLE */ 00076 }; 00077 00078 /* 00079 * Dummy functions to fill the omitted client procedures. 00080 */ 00081 static int 00082 _tiffDummyMapProc(thandle_t fd, tdata_t* pbase, toff_t* psize) 00083 { 00084 (void) fd; (void) pbase; (void) psize; 00085 return (0); 00086 } 00087 00088 static void 00089 _tiffDummyUnmapProc(thandle_t fd, tdata_t base, toff_t size) 00090 { 00091 (void) fd; (void) base; (void) size; 00092 } 00093 00094 /* 00095 * Initialize the shift & mask tables, and the 00096 * byte swapping state according to the file 00097 * contents and the machine architecture. 00098 */ 00099 static void 00100 TIFFInitOrder(TIFF* tif, int magic) 00101 { 00102 tif->tif_typemask = typemask; 00103 if (magic == TIFF_BIGENDIAN) { 00104 tif->tif_typeshift = bigTypeshift; 00105 #ifndef WORDS_BIGENDIAN 00106 tif->tif_flags |= TIFF_SWAB; 00107 #endif 00108 } else { 00109 tif->tif_typeshift = litTypeshift; 00110 #ifdef WORDS_BIGENDIAN 00111 tif->tif_flags |= TIFF_SWAB; 00112 #endif 00113 } 00114 } 00115 00116 int 00117 _TIFFgetMode(const char* mode, const char* module) 00118 { 00119 int m = -1; 00120 00121 switch (mode[0]) { 00122 case 'r': 00123 m = O_RDONLY; 00124 if (mode[1] == '+') 00125 m = O_RDWR; 00126 break; 00127 case 'w': 00128 case 'a': 00129 m = O_RDWR|O_CREAT; 00130 if (mode[0] == 'w') 00131 m |= O_TRUNC; 00132 break; 00133 default: 00134 TIFFErrorExt(0, module, "\"%s\": Bad mode", mode); 00135 break; 00136 } 00137 return (m); 00138 } 00139 00140 TIFF* 00141 TIFFClientOpen( 00142 const char* name, const char* mode, 00143 thandle_t clientdata, 00144 TIFFReadWriteProc readproc, 00145 TIFFReadWriteProc writeproc, 00146 TIFFSeekProc seekproc, 00147 TIFFCloseProc closeproc, 00148 TIFFSizeProc sizeproc, 00149 TIFFMapFileProc mapproc, 00150 TIFFUnmapFileProc unmapproc 00151 ) 00152 { 00153 static const char module[] = "TIFFClientOpen"; 00154 TIFF *tif; 00155 int m; 00156 const char* cp; 00157 00158 m = _TIFFgetMode(mode, module); 00159 if (m == -1) 00160 goto bad2; 00161 tif = (TIFF *)_TIFFmalloc(sizeof (TIFF) + strlen(name) + 1); 00162 if (tif == NULL) { 00163 TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name); 00164 goto bad2; 00165 } 00166 _TIFFmemset(tif, 0, sizeof (*tif)); 00167 tif->tif_name = (char *)tif + sizeof (TIFF); 00168 strcpy(tif->tif_name, name); 00169 tif->tif_mode = m &~ (O_CREAT|O_TRUNC); 00170 tif->tif_curdir = (tdir_t) -1; /* non-existent directory */ 00171 tif->tif_curoff = 0; 00172 tif->tif_curstrip = (tstrip_t) -1; /* invalid strip */ 00173 tif->tif_row = (uint32) -1; /* read/write pre-increment */ 00174 tif->tif_clientdata = clientdata; 00175 if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) { 00176 TIFFErrorExt(clientdata, module, 00177 "One of the client procedures is NULL pointer."); 00178 goto bad2; 00179 } 00180 tif->tif_readproc = readproc; 00181 tif->tif_writeproc = writeproc; 00182 tif->tif_seekproc = seekproc; 00183 tif->tif_closeproc = closeproc; 00184 tif->tif_sizeproc = sizeproc; 00185 if (mapproc) 00186 tif->tif_mapproc = mapproc; 00187 else 00188 tif->tif_mapproc = _tiffDummyMapProc; 00189 if (unmapproc) 00190 tif->tif_unmapproc = unmapproc; 00191 else 00192 tif->tif_unmapproc = _tiffDummyUnmapProc; 00193 _TIFFSetDefaultCompressionState(tif); /* setup default state */ 00194 /* 00195 * Default is to return data MSB2LSB and enable the 00196 * use of memory-mapped files and strip chopping when 00197 * a file is opened read-only. 00198 */ 00199 tif->tif_flags = FILLORDER_MSB2LSB; 00200 if (m == O_RDONLY ) 00201 tif->tif_flags |= TIFF_MAPPED; 00202 00203 #ifdef STRIPCHOP_DEFAULT 00204 if (m == O_RDONLY || m == O_RDWR) 00205 tif->tif_flags |= STRIPCHOP_DEFAULT; 00206 #endif 00207 00208 /* 00209 * Process library-specific flags in the open mode string. 00210 * The following flags may be used to control intrinsic library 00211 * behaviour that may or may not be desirable (usually for 00212 * compatibility with some application that claims to support 00213 * TIFF but only supports some braindead idea of what the 00214 * vendor thinks TIFF is): 00215 * 00216 * 'l' use little-endian byte order for creating a file 00217 * 'b' use big-endian byte order for creating a file 00218 * 'L' read/write information using LSB2MSB bit order 00219 * 'B' read/write information using MSB2LSB bit order 00220 * 'H' read/write information using host bit order 00221 * 'M' enable use of memory-mapped files when supported 00222 * 'm' disable use of memory-mapped files 00223 * 'C' enable strip chopping support when reading 00224 * 'c' disable strip chopping support 00225 * 'h' read TIFF header only, do not load the first IFD 00226 * 00227 * The use of the 'l' and 'b' flags is strongly discouraged. 00228 * These flags are provided solely because numerous vendors, 00229 * typically on the PC, do not correctly support TIFF; they 00230 * only support the Intel little-endian byte order. This 00231 * support is not configured by default because it supports 00232 * the violation of the TIFF spec that says that readers *MUST* 00233 * support both byte orders. It is strongly recommended that 00234 * you not use this feature except to deal with busted apps 00235 * that write invalid TIFF. And even in those cases you should 00236 * bang on the vendors to fix their software. 00237 * 00238 * The 'L', 'B', and 'H' flags are intended for applications 00239 * that can optimize operations on data by using a particular 00240 * bit order. By default the library returns data in MSB2LSB 00241 * bit order for compatibiltiy with older versions of this 00242 * library. Returning data in the bit order of the native cpu 00243 * makes the most sense but also requires applications to check 00244 * the value of the FillOrder tag; something they probably do 00245 * not do right now. 00246 * 00247 * The 'M' and 'm' flags are provided because some virtual memory 00248 * systems exhibit poor behaviour when large images are mapped. 00249 * These options permit clients to control the use of memory-mapped 00250 * files on a per-file basis. 00251 * 00252 * The 'C' and 'c' flags are provided because the library support 00253 * for chopping up large strips into multiple smaller strips is not 00254 * application-transparent and as such can cause problems. The 'c' 00255 * option permits applications that only want to look at the tags, 00256 * for example, to get the unadulterated TIFF tag information. 00257 */ 00258 for (cp = mode; *cp; cp++) 00259 switch (*cp) { 00260 case 'b': 00261 #ifndef WORDS_BIGENDIAN 00262 if (m&O_CREAT) 00263 tif->tif_flags |= TIFF_SWAB; 00264 #endif 00265 break; 00266 case 'l': 00267 #ifdef WORDS_BIGENDIAN 00268 if ((m&O_CREAT)) 00269 tif->tif_flags |= TIFF_SWAB; 00270 #endif 00271 break; 00272 case 'B': 00273 tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | 00274 FILLORDER_MSB2LSB; 00275 break; 00276 case 'L': 00277 tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | 00278 FILLORDER_LSB2MSB; 00279 break; 00280 case 'H': 00281 tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) | 00282 HOST_FILLORDER; 00283 break; 00284 case 'M': 00285 if (m == O_RDONLY) 00286 tif->tif_flags |= TIFF_MAPPED; 00287 break; 00288 case 'm': 00289 if (m == O_RDONLY) 00290 tif->tif_flags &= ~TIFF_MAPPED; 00291 break; 00292 case 'C': 00293 if (m == O_RDONLY) 00294 tif->tif_flags |= TIFF_STRIPCHOP; 00295 break; 00296 case 'c': 00297 if (m == O_RDONLY) 00298 tif->tif_flags &= ~TIFF_STRIPCHOP; 00299 break; 00300 case 'h': 00301 tif->tif_flags |= TIFF_HEADERONLY; 00302 break; 00303 } 00304 /* 00305 * Read in TIFF header. 00306 */ 00307 if (tif->tif_mode & O_TRUNC || 00308 !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) { 00309 if (tif->tif_mode == O_RDONLY) { 00310 TIFFErrorExt(tif->tif_clientdata, name, 00311 "Cannot read TIFF header"); 00312 goto bad; 00313 } 00314 /* 00315 * Setup header and write. 00316 */ 00317 #ifdef WORDS_BIGENDIAN 00318 tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB 00319 ? TIFF_LITTLEENDIAN : TIFF_BIGENDIAN; 00320 #else 00321 tif->tif_header.tiff_magic = tif->tif_flags & TIFF_SWAB 00322 ? TIFF_BIGENDIAN : TIFF_LITTLEENDIAN; 00323 #endif 00324 tif->tif_header.tiff_version = TIFF_VERSION; 00325 if (tif->tif_flags & TIFF_SWAB) 00326 TIFFSwabShort(&tif->tif_header.tiff_version); 00327 tif->tif_header.tiff_diroff = 0; /* filled in later */ 00328 00329 00330 /* 00331 * The doc for "fopen" for some STD_C_LIBs says that if you 00332 * open a file for modify ("+"), then you must fseek (or 00333 * fflush?) between any freads and fwrites. This is not 00334 * necessary on most systems, but has been shown to be needed 00335 * on Solaris. 00336 */ 00337 TIFFSeekFile( tif, 0, SEEK_SET ); 00338 00339 if (!WriteOK(tif, &tif->tif_header, sizeof (TIFFHeader))) { 00340 TIFFErrorExt(tif->tif_clientdata, name, 00341 "Error writing TIFF header"); 00342 goto bad; 00343 } 00344 /* 00345 * Setup the byte order handling. 00346 */ 00347 TIFFInitOrder(tif, tif->tif_header.tiff_magic); 00348 /* 00349 * Setup default directory. 00350 */ 00351 if (!TIFFDefaultDirectory(tif)) 00352 goto bad; 00353 tif->tif_diroff = 0; 00354 tif->tif_dirlist = NULL; 00355 tif->tif_dirlistsize = 0; 00356 tif->tif_dirnumber = 0; 00357 return (tif); 00358 } 00359 /* 00360 * Setup the byte order handling. 00361 */ 00362 if (tif->tif_header.tiff_magic != TIFF_BIGENDIAN && 00363 tif->tif_header.tiff_magic != TIFF_LITTLEENDIAN 00364 #if MDI_SUPPORT 00365 && 00366 #if HOST_BIGENDIAN 00367 tif->tif_header.tiff_magic != MDI_BIGENDIAN 00368 #else 00369 tif->tif_header.tiff_magic != MDI_LITTLEENDIAN 00370 #endif 00371 ) { 00372 TIFFErrorExt(tif->tif_clientdata, name, 00373 "Not a TIFF or MDI file, bad magic number %d (0x%x)", 00374 #else 00375 ) { 00376 TIFFErrorExt(tif->tif_clientdata, name, 00377 "Not a TIFF file, bad magic number %d (0x%x)", 00378 #endif 00379 tif->tif_header.tiff_magic, 00380 tif->tif_header.tiff_magic); 00381 goto bad; 00382 } 00383 TIFFInitOrder(tif, tif->tif_header.tiff_magic); 00384 /* 00385 * Swap header if required. 00386 */ 00387 if (tif->tif_flags & TIFF_SWAB) { 00388 TIFFSwabShort(&tif->tif_header.tiff_version); 00389 TIFFSwabLong(&tif->tif_header.tiff_diroff); 00390 } 00391 /* 00392 * Now check version (if needed, it's been byte-swapped). 00393 * Note that this isn't actually a version number, it's a 00394 * magic number that doesn't change (stupid). 00395 */ 00396 if (tif->tif_header.tiff_version == TIFF_BIGTIFF_VERSION) { 00397 TIFFErrorExt(tif->tif_clientdata, name, 00398 "This is a BigTIFF file. This format not supported\n" 00399 "by this version of libtiff." ); 00400 goto bad; 00401 } 00402 if (tif->tif_header.tiff_version != TIFF_VERSION) { 00403 TIFFErrorExt(tif->tif_clientdata, name, 00404 "Not a TIFF file, bad version number %d (0x%x)", 00405 tif->tif_header.tiff_version, 00406 tif->tif_header.tiff_version); 00407 goto bad; 00408 } 00409 tif->tif_flags |= TIFF_MYBUFFER; 00410 tif->tif_rawcp = tif->tif_rawdata = 0; 00411 tif->tif_rawdatasize = 0; 00412 00413 /* 00414 * Sometimes we do not want to read the first directory (for example, 00415 * it may be broken) and want to proceed to other directories. I this 00416 * case we use the TIFF_HEADERONLY flag to open file and return 00417 * immediately after reading TIFF header. 00418 */ 00419 if (tif->tif_flags & TIFF_HEADERONLY) 00420 return (tif); 00421 00422 /* 00423 * Setup initial directory. 00424 */ 00425 switch (mode[0]) { 00426 case 'r': 00427 tif->tif_nextdiroff = tif->tif_header.tiff_diroff; 00428 /* 00429 * Try to use a memory-mapped file if the client 00430 * has not explicitly suppressed usage with the 00431 * 'm' flag in the open mode (see above). 00432 */ 00433 if ((tif->tif_flags & TIFF_MAPPED) && 00434 !TIFFMapFileContents(tif, (tdata_t*) &tif->tif_base, &tif->tif_size)) 00435 tif->tif_flags &= ~TIFF_MAPPED; 00436 if (TIFFReadDirectory(tif)) { 00437 tif->tif_rawcc = -1; 00438 tif->tif_flags |= TIFF_BUFFERSETUP; 00439 return (tif); 00440 } 00441 break; 00442 case 'a': 00443 /* 00444 * New directories are automatically append 00445 * to the end of the directory chain when they 00446 * are written out (see TIFFWriteDirectory). 00447 */ 00448 if (!TIFFDefaultDirectory(tif)) 00449 goto bad; 00450 return (tif); 00451 } 00452 bad: 00453 tif->tif_mode = O_RDONLY; /* XXX avoid flush */ 00454 TIFFCleanup(tif); 00455 bad2: 00456 return ((TIFF*)0); 00457 } 00458 00459 /* 00460 * Query functions to access private data. 00461 */ 00462 00463 /* 00464 * Return open file's name. 00465 */ 00466 const char * 00467 TIFFFileName(TIFF* tif) 00468 { 00469 return (tif->tif_name); 00470 } 00471 00472 /* 00473 * Set the file name. 00474 */ 00475 const char * 00476 TIFFSetFileName(TIFF* tif, const char *name) 00477 { 00478 const char* old_name = tif->tif_name; 00479 tif->tif_name = (char *)name; 00480 return (old_name); 00481 } 00482 00483 /* 00484 * Return open file's I/O descriptor. 00485 */ 00486 int 00487 TIFFFileno(TIFF* tif) 00488 { 00489 return (tif->tif_fd); 00490 } 00491 00492 /* 00493 * Set open file's I/O descriptor, and return previous value. 00494 */ 00495 int 00496 TIFFSetFileno(TIFF* tif, int fd) 00497 { 00498 int old_fd = tif->tif_fd; 00499 tif->tif_fd = fd; 00500 return old_fd; 00501 } 00502 00503 /* 00504 * Return open file's clientdata. 00505 */ 00506 thandle_t 00507 TIFFClientdata(TIFF* tif) 00508 { 00509 return (tif->tif_clientdata); 00510 } 00511 00512 /* 00513 * Set open file's clientdata, and return previous value. 00514 */ 00515 thandle_t 00516 TIFFSetClientdata(TIFF* tif, thandle_t newvalue) 00517 { 00518 thandle_t m = tif->tif_clientdata; 00519 #ifdef USE_WIN32_FILEIO 00520 newvalue = (thandle_t) _get_osfhandle(newvalue); 00521 #endif /* USE_WIN32_FILEIO */ 00522 tif->tif_clientdata = newvalue; 00523 return m; 00524 } 00525 00526 /* 00527 * Return read/write mode. 00528 */ 00529 int 00530 TIFFGetMode(TIFF* tif) 00531 { 00532 return (tif->tif_mode); 00533 } 00534 00535 /* 00536 * Return read/write mode. 00537 */ 00538 int 00539 TIFFSetMode(TIFF* tif, int mode) 00540 { 00541 int old_mode = tif->tif_mode; 00542 tif->tif_mode = mode; 00543 return (old_mode); 00544 } 00545 00546 /* 00547 * Return nonzero if file is organized in 00548 * tiles; zero if organized as strips. 00549 */ 00550 int 00551 TIFFIsTiled(TIFF* tif) 00552 { 00553 return (isTiled(tif)); 00554 } 00555 00556 /* 00557 * Return current row being read/written. 00558 */ 00559 uint32 00560 TIFFCurrentRow(TIFF* tif) 00561 { 00562 return (tif->tif_row); 00563 } 00564 00565 /* 00566 * Return index of the current directory. 00567 */ 00568 tdir_t 00569 TIFFCurrentDirectory(TIFF* tif) 00570 { 00571 return (tif->tif_curdir); 00572 } 00573 00574 /* 00575 * Return current strip. 00576 */ 00577 tstrip_t 00578 TIFFCurrentStrip(TIFF* tif) 00579 { 00580 return (tif->tif_curstrip); 00581 } 00582 00583 /* 00584 * Return current tile. 00585 */ 00586 ttile_t 00587 TIFFCurrentTile(TIFF* tif) 00588 { 00589 return (tif->tif_curtile); 00590 } 00591 00592 /* 00593 * Return nonzero if the file has byte-swapped data. 00594 */ 00595 int 00596 TIFFIsByteSwapped(TIFF* tif) 00597 { 00598 return ((tif->tif_flags & TIFF_SWAB) != 0); 00599 } 00600 00601 /* 00602 * Return nonzero if the data is returned up-sampled. 00603 */ 00604 int 00605 TIFFIsUpSampled(TIFF* tif) 00606 { 00607 return (isUpSampled(tif)); 00608 } 00609 00610 /* 00611 * Return nonzero if the data is returned in MSB-to-LSB bit order. 00612 */ 00613 int 00614 TIFFIsMSB2LSB(TIFF* tif) 00615 { 00616 return (isFillOrder(tif, FILLORDER_MSB2LSB)); 00617 } 00618 00619 /* 00620 * Return nonzero if given file was written in big-endian order. 00621 */ 00622 int 00623 TIFFIsBigEndian(TIFF* tif) 00624 { 00625 return (tif->tif_header.tiff_magic == TIFF_BIGENDIAN); 00626 } 00627 00628 /* 00629 * Return pointer to file read method. 00630 */ 00631 TIFFReadWriteProc 00632 TIFFGetReadProc(TIFF* tif) 00633 { 00634 return (tif->tif_readproc); 00635 } 00636 00637 /* 00638 * Return pointer to file write method. 00639 */ 00640 TIFFReadWriteProc 00641 TIFFGetWriteProc(TIFF* tif) 00642 { 00643 return (tif->tif_writeproc); 00644 } 00645 00646 /* 00647 * Return pointer to file seek method. 00648 */ 00649 TIFFSeekProc 00650 TIFFGetSeekProc(TIFF* tif) 00651 { 00652 return (tif->tif_seekproc); 00653 } 00654 00655 /* 00656 * Return pointer to file close method. 00657 */ 00658 TIFFCloseProc 00659 TIFFGetCloseProc(TIFF* tif) 00660 { 00661 return (tif->tif_closeproc); 00662 } 00663 00664 /* 00665 * Return pointer to file size requesting method. 00666 */ 00667 TIFFSizeProc 00668 TIFFGetSizeProc(TIFF* tif) 00669 { 00670 return (tif->tif_sizeproc); 00671 } 00672 00673 /* 00674 * Return pointer to memory mapping method. 00675 */ 00676 TIFFMapFileProc 00677 TIFFGetMapFileProc(TIFF* tif) 00678 { 00679 return (tif->tif_mapproc); 00680 } 00681 00682 /* 00683 * Return pointer to memory unmapping method. 00684 */ 00685 TIFFUnmapFileProc 00686 TIFFGetUnmapFileProc(TIFF* tif) 00687 { 00688 return (tif->tif_unmapproc); 00689 } 00690 00691 /* vim: set ts=8 sts=8 sw=8 noet: */ 00692 /* 00693 * Local Variables: 00694 * mode: c 00695 * c-basic-offset: 8 00696 * fill-column: 78 00697 * End: 00698 */ Generated on Sat May 26 2012 04:18:24 for ReactOS by
1.7.6.1
|