1This mail from Scott describes changes to the library that I have 2not made because I couldn't figure out exactly where they went. 3Anything not in this file has either been placed in the appropriate 4directory (e.g. libtiff/tif_win32.c) or applied to the current 5source code (e.g. libtiff/tiffiop.h). 6 7Note that the Window NT/Window 95 support is untested; Scott's work 8was done with an earlier version of the library. Hopefully this'll 9get cleaned up soon. 10 11 Sam 12 13Date: Fri, 14 Apr 95 17:01:42 EDT 14From: wagner@itek.com (scott wagner) 15Message-Id: <9504142101.AA00764@cyan.> 16To: sam@cthulhu.engr.sgi.com 17Subject: Re: Libtiff for Win32 (Windows NT / Windows 95) 18 19Hi, Sam! 20 21Enclosed are my libtiff for win32 pieces. They are in the form of 3 files 22(tif_w32.c, dllshell.c, and libtiff.def), and 2 diffs (for tiffiop.h and 23tiffio.h). 24 25Hope this is not too difficult to separate! 26 27Regards, 28Scott Wagner (wagner@itek.com) 29 30tif_w32.c --------------------------------------------------------------- 31 32tiffiop.h --------------------------------------------------------------- 33 34tiffio.h --------------------------------------------------------------- 3538a39 36> #ifdef _TIFFIOP_ 3739a41,43 38> #else 39> typedef void TIFF; /* Avoid ANSI undefined structure warning */ 40> #endif 4166a71,75 42> #ifdef WIN32 /* WIN32 identifies Win32 compiles */ 43> #pragma warn -sig /* Turn off Borland warn of long to short int convert */ 44> #pragma warn -par /* Turn off Borland warn "Parameter x is never used" */ 45> DECLARE_HANDLE(thandle_t); /* Win32 file handle */ 46> #else /* if not WIN32_ */ 4767a77 48> #endif /* defined WIN32 */ 49 50(Message tiff:1396) 51 -- using template mhl.format -- 52Date: Mon, 17 Apr 1995 07:51:03 EDT 53To: sam@cthulhu.engr.sgi.com 54 55From: wagner@itek.com (scott wagner) 56Subject: Libtiff for Win32 57 58Return-Path: sam@flake.asd.sgi.com 59Delivery-Date: Mon, 17 Apr 1995 05:36:50 PDT 60Return-Path: sam@flake.asd.sgi.com 61 62Hello, Sam! 63 64> ... libtiff for win32 pieces. They are in the form of 3 files 65> (tif_w32.c, dllshell.c, and libtiff.def), and 2 diffs (for tiffiop.h and 66> tiffio.h). 67> 68> I don't understand how these pieces fit together. Can you please explain 69> what dllshell.c and libtiff.def are for? 70 71Sorry I was short on documentation here ... I was rushing to get home to 72dinner on Friday and the material for you was the last loose end I had to 73deal with. Excuses aside ... 74 75The goal of the adaptation of libtiff to Win32 was to replace only one 76environment-specific code module and to make minimal changes to header 77files. tif_win32.c required one addition to tiffio.h (the 78DECLARE_HANDLE line, which is probably a better way to typedef thandle-t 79under Windows 3.1 as well); it also required the addition of pv_map_handle 80to the tiff structure and the conditional definition of the 81TIFFUnmapFileContents macro in tiffiop.h (this because Win32 uses a handle 82and a pointer in mapping memory, and I needed to save both). 83 84Additionally, I made a general style change to tiffio.h. If tiffio.h is 85included by a client, which does not include tiffiop.h, then ANSI compilers 86warn about the typedef of TIFF to a non-existent structure. To avoid this, 87I changed the typedef of TIFF in this case to void. 88 89I also made a style change in the tiff structure. All references to tif_fd 90in the library treat it as int, yet the tif_fd member itself is short. I 91changed this member to int and added the reserved member to maintain 9232-bit structure member alignment in a 32 bit environment. [ At cost of 934 more bytes in an already bloated structure! :-) ] As long as fd's are 94less than 64k, the old member works; this is not the case in Win32, and is 95not generally a safe assumption. 96 97The module dllshell.c and the file libtiff.def are not specific to the 98functionality of libtiff; they are used to make a Win32 dynamic link 99library, and would be best packaged with a Win32 makefile, which I have 100not yet perfected. I will, however, commit to a Borland and Microsoft C 101makefile for libtiff; perhaps these two could be combined with the 102makefile for the _next_ (!) release of libtiff when it is ready. 103 104Once again, sorry for the confused message on Friday. I hope that at 105least tif_w32 and the tiffio.h and tiffiop.h diffs will be useful for 106this release. 107 108Regards, 109Scott Wagner (wagner@itek.com) 110Itek Graphix 111Rochester, NY 112